Whamcloud - gitweb
LU-10673 tests: sanity test_56a fixes 26/31326/4
authorAlyona Romanenko <alyona.romanenko@seagate.com>
Thu, 15 Feb 2018 19:01:05 +0000 (22:01 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 Mar 2018 13:55:03 +0000 (13:55 +0000)
The $filenum is not equal to $found if stripe_count
more then 1.
The $filenum is not equal to $found if stripe_index
is not default.
Patch fixes the following:
 We will counted files twice with dual striped
 file as they will have objects on both stripes.
 Remove dir's stripe-offset from stripes-offset's sum of
 test dirs/files which get by getstripe -ir.

Author: Alyona Romanenko <alyona.romanenko@seagate.com>

Signed-off-by: Alyona Romanenko <alyona.romanenko@seagate.com>
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Test-Parameters: trivial testlist=sanity envdefinitions=ONLY=56a
Cray-bug-id: MRP-2738
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Change-Id: I911bf8b40b7688b4341f48409d9c5b57386cfe3d
Reviewed-on: https://review.whamcloud.com/31326
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index e99e0ed..ffb8a0d 100755 (executable)
@@ -4661,9 +4661,14 @@ test_56a() {
        local ostidx=1
        local obduuid=$(ostuuid_from_index $ostidx)
        local found=$($LFS getstripe -r --obd $obduuid $dir |
        local ostidx=1
        local obduuid=$(ostuuid_from_index $ostidx)
        local found=$($LFS getstripe -r --obd $obduuid $dir |
-                     egrep -c "obdidx|l_ost_idx")
+               grep 'lmm_stripe_offset:' | grep -c " $ostidx\$")
+
+       filenum=$($LFS getstripe -ir $dir | grep -c "^$ostidx\$")
+       [[ $($LFS getstripe -id $dir) -ne $ostidx ]] ||
+               ((filenum--))
+       [[ $($LFS getstripe -id $dir/dir) -ne $ostidx ]] ||
+               ((filenum--))
 
 
-       filenum=$($LFS getstripe -ir $dir | grep "^$ostidx\$" | wc -l)
        [[ $found -eq $filenum ]] ||
                error "$LFS getstripe --obd: found $found expect $filenum"
        [[ $($LFS getstripe -r -v --obd $obduuid $dir |
        [[ $found -eq $filenum ]] ||
                error "$LFS getstripe --obd: found $found expect $filenum"
        [[ $($LFS getstripe -r -v --obd $obduuid $dir |