From: Alyona Romanenko Date: Thu, 15 Feb 2018 19:01:05 +0000 (+0300) Subject: LU-10673 tests: sanity test_56a fixes X-Git-Tag: 2.11.0-RC1~12 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F31326%2F4;p=fs%2Flustre-release.git LU-10673 tests: sanity test_56a fixes 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 Signed-off-by: Alyona Romanenko Signed-off-by: Elena Gryaznova Test-Parameters: trivial testlist=sanity envdefinitions=ONLY=56a Cray-bug-id: MRP-2738 Reviewed-by: Andriy Skulysh Reviewed-by: Parinay Kondekar Change-Id: I911bf8b40b7688b4341f48409d9c5b57386cfe3d Reviewed-on: https://review.whamcloud.com/31326 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e99e0ed..ffb8a0d 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -4661,9 +4661,14 @@ test_56a() { 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 |