From 49537d8d555948d298617e633dbaf84db4f99f75 Mon Sep 17 00:00:00 2001 From: Alyona Romanenko Date: Thu, 15 Feb 2018 22:01:05 +0300 Subject: [PATCH] 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 --- lustre/tests/sanity.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 | -- 1.8.3.1