From: Emoly Liu Date: Fri, 31 May 2013 20:14:08 +0000 (+0800) Subject: LU-3720 test: use actual stripe count in sanity.sh 130d X-Git-Tag: 2.4.92~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5cb384104b9100d6833534c08597c04fa0ea3680 LU-3720 test: use actual stripe count in sanity.sh 130d The test is expecting each OST to get a specific amount if data based in the size and stripe count, but if an OST is full, more data will be written to each of the other OSTs. To fix that, use the actual number of stripes allocated instead of the requested number of stripes. Signed-off-by: Emoly Liu Change-Id: Iadb0daf16d7c121d2104f1fe49afa7f762a7f52a Reviewed-on: http://review.whamcloud.com/7303 Tested-by: Hudson Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index db9807c..5ac4621 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -8026,10 +8026,14 @@ test_130d() { $SETSTRIPE -S 65536 -c $OSTCOUNT $fm_file||error "setstripe on $fm_file" [ "$(facet_fstype ost$(($($GETSTRIPE -i $fm_file) + 1)))" = "zfs" ] && skip "ORI-366/LU-1941: FIEMAP unimplemented on ZFS" && return - dd if=/dev/zero of=$fm_file bs=1M count=$OSTCOUNT || error "dd failed on $fm_file" + + local actual_stripecnt=$($GETSTRIPE -c $fm_file) + dd if=/dev/zero of=$fm_file bs=1M count=$actual_stripecnt || + error "dd failed on $fm_file" filefrag -ves $fm_file || error "filefrag $fm_file failed" - filefrag_op=`filefrag -ve $fm_file | grep -A 100 "ext:" | grep -v "ext:" | grep -v "found"` + filefrag_op=`filefrag -ve $fm_file | grep -A 100 "ext:" | + grep -v "ext:" | grep -v "found"` last_lun=`echo $filefrag_op | cut -d: -f5` @@ -8053,7 +8057,7 @@ test_130d() { (( tot_len += ext_len )) last_lun=$frag_lun done - if (( num_luns != OSTCOUNT || tot_len != 1024 )); then + if (( num_luns != actual_stripecnt || tot_len != 1024 )); then cleanup_130 error "FIEMAP on $fm_file failed; returned wrong number of luns or wrong len for OST $last_lun" return