xfstests: use a common _filter_test_dir function
authorAlex Elder <aelder@sgi.com>
Fri, 22 Oct 2010 14:09:24 +0000 (14:09 +0000)
committerAlex Elder <aelder@sgi.com>
Mon, 25 Oct 2010 15:15:58 +0000 (10:15 -0500)
Christoph Hellwig suggested that a function similar to the common
"_filter_scratch" function ought to be created to handle filtering
of the TEST_DIR and TEST_DEV variables.  This patch implements that.

The name "_filter_test" seems like it might suggest it does
something different, so I'm calling this one "_filter_test_dir".
This unfortunately makes the "test" and "scratch" functions have
different naming conventions, but I guess we should be accustomed to
that by now (consider "TEST_DIR" and "SCRATCH_MNT").

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
084
084.out
088
203
common.filter

diff --git a/084 b/084
index 622eb4f00ab54a22e4ddc1658d6868872a0f0f89..e04a402f82d84a224660895377008d281b1a6a6d 100755 (executable)
--- a/084
+++ b/084
@@ -39,8 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
 _filter_resv()
 {
-       sed -e "s,$TEST_DIR/resv,[TESTFILE],g" \
-           -e 's/[0-9][0-9]* bytes/NUM bytes/g'
+       _filter_test_dir | sed -e 's/[0-9][0-9]* bytes/NUM bytes/g'
 }
 
 pgsize=`$here/src/feature -s`
diff --git a/084.out b/084.out
index efaf4a2906e8ab46276546ea2be9e2db750aff53..e2e6a66b5d4bfc6b9c620a1dc48ff803493d367f 100644 (file)
--- a/084.out
+++ b/084.out
@@ -1,9 +1,9 @@
 QA output created by 084
 
 *** First case - I/O blocksize same as pagesize
-reserved NUM bytes for [TESTFILE] using XFS_IOC_RESVSP64
+reserved NUM bytes for TEST_DIR/resv using XFS_IOC_RESVSP64
 done
 
 *** Second case - 512 byte I/O blocksize
-reserved NUM bytes for [TESTFILE] using XFS_IOC_RESVSP64
+reserved NUM bytes for TEST_DIR/resv using XFS_IOC_RESVSP64
 done
diff --git a/088 b/088
index f6f0e265f35bb0691d06ddaecdd9098d4da45fc6..9fd0df5276726eb0b3ef8a9990c6c71395468a8b 100755 (executable)
--- a/088
+++ b/088
@@ -39,8 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
 _filter()
 {
-    sed -e "s#$TEST_DIR#TEST_DIR#g" \
-        -e '/----------/d'
+    _filter_test_dir | sed -e '/----------/d'
 }
 
 # link correct .out file
diff --git a/203 b/203
index 80c449dbd4a2f88ee1b24cf25023dae4a0d824be..6fae36146e0eea112c415bc04e63cb4a2db813fa 100755 (executable)
--- a/203
+++ b/203
@@ -48,7 +48,7 @@ _write_holes()
 #       1: [8..2047]: hole
 _filter_bmap()
 {
-       sed "s#$TEST_DIR#TEST_DIR#g" | \
+       _filter_test_dir |
        awk '$3 ~ /hole/ { print $1, $2, $3; next }
              {print $1, $2; next}'
 }
index c2e45689c2388e784c894d580d27e264a3308a4b..7de0774cb1281c90e6e09bb1858e87e79e535a78 100644 (file)
@@ -214,6 +214,11 @@ _filter_xfs_io_unique()
     common_line_filter | _filter_xfs_io
 }
 
+_filter_test_dir()
+{
+       sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g"
+}
+
 _filter_scratch()
 {
        sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"