Whamcloud - gitweb
LU-16027 tests: sanity:test_66: specify blocksize explicitly 83/47983/3
authorElena Gryaznova <elena.gryaznova@hpe.com>
Tue, 19 Jul 2022 13:15:42 +0000 (16:15 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Sep 2022 05:54:17 +0000 (05:54 +0000)
Fix test_66() to be independent from BLOCKSIZE environment
variable.

To reproduce the failure, just run:
  llmount.sh
  export BLOCKSIZE=4096; ONLY=66 sh sanity.sh
  == sanity test 66: update inode blocks count on client ==
  8+0 records in
  8+0 records out
  8192 bytes (8.2 kB, 8.0 KiB) copied, 0.00589935 s, 1.4 MB/s
  sanity test_66: @@@@@@ FAIL: /mnt/lustre/f66 blocks 2 < 8

Test-Parameters: trivial testlist=sanity env=ONLY=66
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
HPE-bug-id: LUS-11014
Reviewed-by: Vladimir Saveliev <vlaidimir.saveliev@hpe.com>
Change-Id: I0adca724518cb955e3664d33a36628ae19a1712d
Reviewed-on: https://review.whamcloud.com/47983
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 6166cfb..214611e 100755 (executable)
@@ -9629,12 +9629,12 @@ run_test 65n "don't inherit default layout from root for new subdirectories"
 test_66() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run"
 
-       COUNT=${COUNT:-8}
+       local COUNT=${COUNT:-8}
        dd if=/dev/zero of=$DIR/f66 bs=1k count=$COUNT
        sync; sync_all_data; sync; sync_all_data
        cancel_lru_locks osc
-       BLOCKS=`ls -s $DIR/f66 | awk '{ print $1 }'`
-       [ $BLOCKS -ge $COUNT ] || error "$DIR/f66 blocks $BLOCKS < $COUNT"
+       local BLOCKS=$(ls -s --block-size=1k $DIR/f66 | awk '{ print $1 }')
+       (( BLOCKS >= COUNT )) || error "$DIR/f66 blocks $BLOCKS < $COUNT"
 }
 run_test 66 "update inode blocks count on client ==============="