public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] XFSQA 166: support varying page sizes
@ 2008-03-20  6:37 David Chinner
  2008-03-20  7:46 ` Christoph Hellwig
  2008-03-20 20:36 ` Josef 'Jeff' Sipek
  0 siblings, 2 replies; 3+ messages in thread
From: David Chinner @ 2008-03-20  6:37 UTC (permalink / raw)
  To: xfs-dev; +Cc: xfs-oss

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@sgi.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-20 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20  6:37 [PATCH] XFSQA 166: support varying page sizes David Chinner
2008-03-20  7:46 ` Christoph Hellwig
2008-03-20 20:36 ` Josef 'Jeff' Sipek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox