xfs
[Top] [All Lists]

[PATCH] XFSQA 166: support varying page sizes

To: xfs-dev <xfs-dev@xxxxxxx>
Subject: [PATCH] XFSQA 166: support varying page sizes
From: David Chinner <dgc@xxxxxxx>
Date: Thu, 20 Mar 2008 17:37:13 +1100
Cc: xfs-oss <xfs@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
Make the filter check the resultant output based on
the initial written region size. hence page size of the
machine will not affect the output of the filter.
Modify the golden output to match.

Signed-off-by: Dave Chinner <dgc@xxxxxxx>
---
 xfstests/166     |   38 +++++++++++++++++++++++++++++++-------
 xfstests/166.out |   10 +++++-----
 2 files changed, 36 insertions(+), 12 deletions(-)

Index: xfs-cmds/xfstests/166.out
===================================================================
--- xfs-cmds.orig/xfstests/166.out      2007-06-20 13:42:46.000000000 +1000
+++ xfs-cmds/xfstests/166.out   2008-03-19 09:40:03.518840554 +1100
@@ -1,6 +1,6 @@
 QA output created by 166
-0: [0..31]: XX..YY AG (AA..BB) 32
-1: [32..127]: XX..YY AG (AA..BB) 96 10000
-2: [128..159]: XX..YY AG (AA..BB) 32
-3: [160..223]: XX..YY AG (AA..BB) 64 10000
-4: [224..255]: XX..YY AG (AA..BB) 32
+0: [AA..BB] XX..YY AG (AA..BB) RIGHT GOOD
+1: [AA..BB] XX..YY AG (AA..BB) RIGHT GOOD
+2: [AA..BB] XX..YY AG (AA..BB) RIGHT GOOD
+3: [AA..BB] XX..YY AG (AA..BB) RIGHT GOOD
+4: [AA..BB] XX..YY AG (AA..BB) RIGHT GOOD
Index: xfs-cmds/xfstests/166
===================================================================
--- xfs-cmds.orig/xfstests/166  2007-06-20 13:42:46.000000000 +1000
+++ xfs-cmds/xfstests/166       2008-03-19 09:40:03.518840554 +1100
@@ -27,14 +27,38 @@ _cleanup()
 . ./common.rc
 . ./common.filter
 
+# assumes 1st, 3rd and 5th blocks are single written blocks,
+# the others are unwritten.
 _filter_blocks()
 {
-       $AWK_PROG '/[0-9]/ {
-               if ($7)
-                       print $1, $2, "XX..YY", "AG", "(AA..BB)", $6, $7;
-               else
-                       print $1, $2, "XX..YY", "AG", "(AA..BB)", $6;
-       }'
+       $AWK_PROG '
+/[0-9]/ {
+       if (!written_size) {
+               written_size = $6
+               unwritten1 = ((1048576/512) / 2) - written_size
+               unwritten2 = ((1048576/512) / 2) - 2 * written_size
+       }
+
+       if ($7) {
+               size = "RIGHT"
+               flags = "GOOD"
+               if (unwritten1) {
+                       if ($6 != unwritten1)
+                               size = "WRONG"
+                       unwritten1 = 0;
+               } else if ($6 != unwritten2) {
+                       size = "WRONG"
+               }
+               if ($7 < 10000)
+                       flags = "BAD"
+       } else {
+               size = "RIGHT"
+               flags = "GOOD"
+               if ($6 != written_size)
+                       size = "WRONG"
+       }
+       print $1, "[AA..BB]", "XX..YY", "AG", "(AA..BB)", size, flags
+}'
 }
 
 # real QA test starts here
@@ -48,7 +72,7 @@ _scratch_mount
 
 TEST_FILE=$SCRATCH_MNT/test_file
 TEST_PROG=$here/src/unwritten_mmap
-FILE_SIZE=131072
+FILE_SIZE=1048576
 
 rm -f $TEST_FILE
 $TEST_PROG $FILE_SIZE $TEST_FILE


<Prev in Thread] Current Thread [Next in Thread>