Skip to contentSkip to conversation

XFSQA 166: support varying page sizes

PATCH In review David Chinner 3 participants 3 messages Mar 20, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 XFSQA 166: support varying page sizes

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.

---
 xfstests/166     |   38 +++++++++++++++++++++++++++++++-------
 xfstests/166.out |   10 +++++-----
 2 files changed, 36 insertions(+), 12 deletions(-)
xfstests/166.out +5 -5
Index: xfs-cmds/xfstests/166.out
===================================================================
@@ -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
xfstests/166 +31 -7
Index: xfs-cmds/xfstests/166
===================================================================
@@ -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
#1 lore raw
Quoted 4 lines · David Chinner

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.

Looks good.

#2 lore raw
In reply to David Chinner
Quoted 6 lines · David Chinner

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.

This fixes the failure I reported few days ago.

Josef 'Jeff' Sipek.

Signature · 2 lines
If I have trouble installing Linux, something is wrong. Very wrong.
		- Linus Torvalds