From 5c62a6cdf4ccd885411815243f756b3d77b2ce11 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Tue, 25 Mar 2008 05:19:50 +0000 Subject: [PATCH] xfsqa test 166 fails on 64k page machine test 166 output is dependent on page size (mmap related). Make the output filter turn the output into something independent of page size whilst checking that the output is valid. Merge of master-melb:xfs-cmds:30702a by kenmcd. Make the file size and I/O size large enough that 64k pages are handled correctly. --- 166 | 38 +++++++++++++++++++++++++++++++------- 166.out | 10 +++++----- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/166 b/166 index 4562b39a..3094640c 100644 --- a/166 +++ b/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 diff --git a/166.out b/166.out index c562847d..bf72ecdf 100644 --- a/166.out +++ b/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 -- 2.39.5