Skip to contentSkip to conversation

xfstests: test different block sizes in a couple of tests

PATCH In review Dave Chinner 3 participants 7 messages Oct 10, 2011 – Oct 13, 2011

lore
Share & tools
lore
#0 lore raw

cover xfstests: test different block sizes in a couple of tests

Recently a problem was reported on test 225 when using a 512 byte block size. I couldn't reproduce this problem using MKFS_OPTION="-b size=512". The problem is that some tests use the TEST_DEV and MKFS_OPTION only applies to the SCRATCH_DEV. To change the block size of these tests, you need to specifically mkfs the TEST_DEV to use those block sizes. This is not a typical test config - the TEST_DEV is not supposed to be remade frequently, as it is designed to be used for aging and testing aged filesystems.

Change a couple of tests that are testing hole/allocation patterns to use the scratch device so that we get test coverage on multiple block sizes, not just the default 4k block size filesystems.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH 1/2 xfstests: make 225 use SCRATCH_DEV

From: Dave Chinner <[email protected]>

Use the scratch device for test 225 so that both custom mkfs and mount options impact the test (e.g. filesystem block size). This exposes test failures when using 512 byte block sizes, which currently not tested unless the test device is specifically created with a 512 byte block size.

Also clean up the file names to include the test number, and don't remove the test files after the test has finished so that it leaves behind a corpse that can be dissected when the test fails.

---
 225 |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)
225 +15 -18
index 76be888..e7f1d9c 100755
@@ -45,20 +45,17 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
+_require_scratch
 
-_setup_testdir
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount > /dev/null 2>&1
 
-fiemapfile=$TEST_DIR/fiemap.$$
-fiemaplog=$TEST_DIR/fiemap.$$.log
+rm -f $seq.full
+fiemapfile=$SCRATCH_MNT/$seq.fiemap
+fiemaplog=$SCRATCH_MNT/$seq.log
 
-[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
 
-_cleanup()
-{
-	rm -f $fiemapfile
-	rm -f $fiemaplog
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
+[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
 
 seed=`date +%s`
 
@@ -67,16 +64,16 @@ echo "using seed $seed" >> $fiemaplog
 echo "fiemap run without preallocation, with sync"
 $here/src/fiemap-tester -q -S -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
 
-echo "fiemap run without preallocation or sync"
-$here/src/fiemap-tester -q -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
-
-if grep -q "Operation not supported" $fiemaplog; then
-      _notrun "FIEMAP not supported by this filesystem type: $FSTYP"
+if [ $? -ne 0 ]; then
+	if grep -q "Operation not supported" $fiemaplog; then
+	      _notrun "FIEMAP not supported by this filesystem type: $FSTYP"
+	fi
+	status=$?
+	exit
 fi
 
-rm -f $fiemapfile
-rm -f $fiemaplog
-rm -f $seq.full
+echo "fiemap run without preallocation or sync"
+$here/src/fiemap-tester -q -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
 
 status=0
 exit
Signature · 6 lines
1.7.5.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw

PATCH 2/2 xfstests: make 203 pass on non-default block size filesystems

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

The xfs_bmap output in the golden image is filesystem block size dependent. Make all writes 64k to ensure that the allocation/hole pattern is consistent across all supported filesystem block sizes.

Also, use the SCRATCH_DEV instead of the TEST_DEV so that we test according to MKFS_OPTIONS rather than test on whatever setup the TEST_DEV was created with.

---
 203     |   20 +-
 203.out |  832 +++++++++++++++++++++++++++++++-------------------------------
 2 files changed, 427 insertions(+), 425 deletions(-)
203 +11 -9
index be69dfa..6ca3c24 100755
@@ -43,7 +43,7 @@ _write_holes()
 
 	offset=0
 	for i in `seq 0 $writes`; do
-		xfs_io -f $file -c "pwrite -q $offset 1"
+		xfs_io -f $file -c "pwrite -q $offset 64k"
 		let offset=$offset+0x100000
 	done
 }
@@ -52,18 +52,19 @@ _write_holes()
 #       1: [8..2047]: hole
 _filter_bmap()
 {
-	_filter_test_dir |
+	_filter_scratch |
 	awk '$3 ~ /hole/ { print $1, $2, $3; next }
              {print $1, $2; next}'
 }
 
 _cleanup()
 {
-	rm -f $TEST_DIR/hole_file*
-	rm -f $TEST_DIR/r??
+	rm -f $SCRATCH_DIR/r??
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
+rm -f $seq.full
+
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
@@ -71,19 +72,20 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs xfs
 _supported_os Linux
-
+_require_scratch
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount > /dev/null 2>&1
 
 for i in 10 14 15 16 17 28 29 30 31; do
-        rm -f $TEST_DIR/hole_file
-	_write_holes $TEST_DIR/hole_file${i} ${i}
+        rm -f $SCRATCH_MNT/hole_file
+	_write_holes $SCRATCH_MNT/hole_file${i} ${i}
 done
 
 for i in 10 14 15 16 17 28 29 30 31; do
-        xfs_bmap $TEST_DIR/hole_file${i} | _filter_bmap
+        xfs_bmap $SCRATCH_MNT/hole_file${i} | _filter_bmap
 	echo
 done
 
 # success, all done
 echo "*** done"
-rm -f $seq.full
 status=0
203.out +416 -416

843 lines not on this page · raw message

Signature · 6 lines
1.7.5.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] xfstests: make 203 pass on non-default block size filesystems

In reply to Dave Chinner
Quoted 11 lines · Dave Chinner

From: Dave Chinner <[email protected]>

The xfs_bmap output in the golden image is filesystem block size dependent. Make all writes 64k to ensure that the allocation/hole pattern is consistent across all supported filesystem block sizes.

Also, use the SCRATCH_DEV instead of the TEST_DEV so that we test according to MKFS_OPTIONS rather than test on whatever setup the TEST_DEV was created with.

Looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] xfstests: make 225 use SCRATCH_DEV

In reply to Dave Chinner
Quoted 8 lines · Dave Chinner

From: Dave Chinner <[email protected]>

Use the scratch device for test 225 so that both custom mkfs and mount options impact the test (e.g. filesystem block size). This exposes test failures when using 512 byte block sizes, which currently not tested unless the test device is specifically created with a 512 byte block size.

Quoted 5 lines

Also clean up the file names to include the test number, and don't remove the test files after the test has finished so that it leaves behind a corpse that can be dissected when the test fails.

Looks good.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] xfstests: make 203 pass on non-default block size filesystems

In reply to Dave Chinner
Quoted 11 lines · Dave Chinner

From: Dave Chinner <[email protected]>

The xfs_bmap output in the golden image is filesystem block size dependent. Make all writes 64k to ensure that the allocation/hole pattern is consistent across all supported filesystem block sizes.

Also, use the SCRATCH_DEV instead of the TEST_DEV so that we test according to MKFS_OPTIONS rather than test on whatever setup the TEST_DEV was created with.

A minor thing below, which I'll fix for you. Also one question. Otherwise looks good.

. . .

203 _write_holes() · line 62

Quoted 3 lines

_cleanup()
{

203 +0 -1
-	rm -f $TEST_DIR/hole_file*

You no longer delete the hole files because there's no need to (because scratch will likely be clobbered anyway)?

203 _write_holes() · line 62

Quoted 2 lines
203 +1 -1
-	rm -f $TEST_DIR/r??
+	rm -f $SCRATCH_DIR/r??

SCRATCH_MNT

(This is an annoyance that ought to be fixed everywhere I think--either make it SCRATCH_DIR or TEST_MNT.)

. . .

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs