Whamcloud - gitweb
LU-3720 test: use actual stripe count in sanity.sh 130d 03/7303/2
authorEmoly Liu <emoly.liu@intel.com>
Fri, 31 May 2013 20:14:08 +0000 (04:14 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Sep 2013 05:36:17 +0000 (05:36 +0000)
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 <emoly.liu@intel.com>
Change-Id: Iadb0daf16d7c121d2104f1fe49afa7f762a7f52a
Reviewed-on: http://review.whamcloud.com/7303
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index db9807c..5ac4621 100644 (file)
@@ -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