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>
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 ==============="