All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3 v2] Output selection
@ 2015-11-24 10:39 Jan Kara
  2015-11-24 10:39 ` [PATCH 1/3] common: Factor out function to get OS name Jan Kara
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jan Kara @ 2015-11-24 10:39 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

From: Jan Kara <jack@suse.com>

Hello,

the patch series below addresses some issues with test ext4/001. First two
patches improve _link_out_file helper function to allow selection of output
(or in general linking any file when using _link_out_file_named() variant)
based on a feature string (usually mount options, fs features, operating
system) passed to the function (if no feature string is passed, the function
defaults to using "operating system name","mount options"). This feature
is useful when e.g. different mount options change behavior of the filesystem
and thus different output is generated but we want to have the test working
for all mount options.

Patch 3 uses the output selection function in ext4/001 to select different
output files based on mount options.

Comments welcome!

								Honza
--

Changes since v1:
* rebased on the current head of xfstests
* integrated output selection with _link_out_file and converted all tests
  using it


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

* [PATCH 1/3] common: Factor out function to get OS name
  2015-11-24 10:39 [PATCH 0/3 v2] Output selection Jan Kara
@ 2015-11-24 10:39 ` Jan Kara
  2015-12-07 23:24   ` Theodore Ts'o
  2015-11-24 10:39 ` [PATCH 2/3] common: Improve _link_output_file to be more versatile Jan Kara
  2015-11-24 10:39 ` [PATCH 3/3] ext4/001: Select different output based on mount options Jan Kara
  2 siblings, 1 reply; 11+ messages in thread
From: Jan Kara @ 2015-11-24 10:39 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

Signed-off-by: Jan Kara <jack@suse.cz>
---
 common/rc | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/common/rc b/common/rc
index 4c2f42c8d0eb..81418280f163 100644
--- a/common/rc
+++ b/common/rc
@@ -2188,6 +2188,18 @@ _full_platform_details()
      echo "$os/$platform $host $kernel"
 }
 
+_get_os_name()
+{
+	if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
+		echo 'irix'
+	elif [ "`uname`" == "Linux" ]; then
+		echo 'linux'
+	else
+		echo Unknown operating system: `uname`
+		exit
+	fi
+}
+
 _link_out_file()
 {
 	if [ -z "$1" -o -z "$2" ]; then
@@ -2195,14 +2207,8 @@ _link_out_file()
 		exit
 	fi
 	rm -f $2
-	if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
-		ln -s $1.irix $2
-	elif [ "`uname`" == "Linux" ]; then
-		ln -s $1.linux $2
-	else
-		echo Error test $seq does not run on the operating system: `uname`
-		exit
-	fi
+	SUFFIX=$(_get_os_name())
+	ln -s $1.$SUFFIX $2
 }
 
 _die()
-- 
2.1.4


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

* [PATCH 2/3] common: Improve _link_output_file to be more versatile
  2015-11-24 10:39 [PATCH 0/3 v2] Output selection Jan Kara
  2015-11-24 10:39 ` [PATCH 1/3] common: Factor out function to get OS name Jan Kara
@ 2015-11-24 10:39 ` Jan Kara
  2015-12-07 23:26     ` Theodore Ts'o
  2015-11-24 10:39 ` [PATCH 3/3] ext4/001: Select different output based on mount options Jan Kara
  2 siblings, 1 reply; 11+ messages in thread
From: Jan Kara @ 2015-11-24 10:39 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

From: Jan Kara <jack@suse.com>

Currently _link_output_file() selects output file suffix based on the
current operating system. Make it more versatile by allowing selection
of output file suffix based on any feature string. The idea is that
in config file ($seq.cfg) there are several lines like:

feat1,feat2: suffix

The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
if no argument is passed) and selects output file with a suffix for
which all features are present in the feature string. If there is no
matching line, output with 'default' suffix is selected.

Update all tests using _link_out_file to the new calling convention.

Signed-off-by: Jan Kara <jack@suse.com>
---
 common/rc                   |  49 +++++++++--
 tests/generic/088           |   2 +-
 tests/generic/088.cfg       |   2 +
 tests/xfs/018               |   2 +-
 tests/xfs/018.cfg           |   2 +
 tests/xfs/022               |   2 +-
 tests/xfs/022.cfg           |   2 +
 tests/xfs/023               |   2 +-
 tests/xfs/023.cfg           |   2 +
 tests/xfs/030               |   2 +-
 tests/xfs/030.cfg           |   2 +
 tests/xfs/031               |   2 +-
 tests/xfs/031.cfg           |   2 +
 tests/xfs/033               |   6 +-
 tests/xfs/033.cfg           |   3 +
 tests/xfs/033.crc.out.linux | 197 --------------------------------------------
 tests/xfs/033.out.crc.linux | 197 ++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/035               |   2 +-
 tests/xfs/035.cfg           |   2 +
 tests/xfs/036               |   2 +-
 tests/xfs/036.cfg           |   2 +
 tests/xfs/039               |   2 +-
 tests/xfs/039.cfg           |   2 +
 tests/xfs/043               |   2 +-
 tests/xfs/043.cfg           |   2 +
 tests/xfs/055               |   2 +-
 tests/xfs/082               |   2 +-
 tests/xfs/082.cfg           |   2 +
 tests/xfs/146               |   2 +-
 tests/xfs/146.cfg           |   2 +
 30 files changed, 283 insertions(+), 219 deletions(-)
 create mode 100644 tests/generic/088.cfg
 create mode 100644 tests/xfs/018.cfg
 create mode 100644 tests/xfs/022.cfg
 create mode 100644 tests/xfs/023.cfg
 create mode 100644 tests/xfs/030.cfg
 create mode 100644 tests/xfs/031.cfg
 create mode 100644 tests/xfs/033.cfg
 delete mode 100644 tests/xfs/033.crc.out.linux
 create mode 100644 tests/xfs/033.out.crc.linux
 create mode 100644 tests/xfs/035.cfg
 create mode 100644 tests/xfs/036.cfg
 create mode 100644 tests/xfs/039.cfg
 create mode 100644 tests/xfs/043.cfg
 create mode 100644 tests/xfs/082.cfg
 create mode 100644 tests/xfs/146.cfg

diff --git a/common/rc b/common/rc
index 81418280f163..8256a15050dc 100644
--- a/common/rc
+++ b/common/rc
@@ -2200,15 +2200,52 @@ _get_os_name()
 	fi
 }
 
+_link_out_file_named()
+{
+	export FEATURES=$2
+	SUFFIX=$(perl -e '
+		my %feathash;
+		my $feature, $result, $suffix, $opts;
+
+		foreach $feature (split(/,/, $ENV{"FEATURES"})) {
+			$feathash{$feature} = 1;
+		}
+		$result = "default";
+		while (<>) {
+			my $found = 1;
+
+			chomp;
+			($opts, $suffix) = split(/ *: */);
+			foreach my $opt (split(/,/, $opts)) {
+				if (!exists($feathash{$opt})) {
+					$found = 0;
+					last;
+				}
+			}
+			if ($found == 1) {
+				$result = $suffix;
+				last;
+			}
+		}
+		print $result
+		' <$seqfull.cfg)
+	rm -f $1
+	SRC=$(basename $1)
+	ln -fs $SRC.$SUFFIX $1
+}
+
 _link_out_file()
 {
-	if [ -z "$1" -o -z "$2" ]; then
-		echo Error must pass src and dst.
-		exit
+	if [ $# -eq 0 ]; then
+		FEATURES="$(_get_os_name)"
+		if [ -n "$MOUNT_OPTIONS" ]; then
+			FEATURES=$FEATURES,${MOUNT_OPTIONS##"-o "}
+		fi
+	else
+		FEATURES=$1
 	fi
-	rm -f $2
-	SUFFIX=$(_get_os_name())
-	ln -s $1.$SUFFIX $2
+
+	_link_out_file_named $seqfull.out "$FEATURES"
 }
 
 _die()
diff --git a/tests/generic/088 b/tests/generic/088
index 983de983c059..46ce6ae4e25d 100755
--- a/tests/generic/088
+++ b/tests/generic/088
@@ -43,7 +43,7 @@ _filter()
 }
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs generic
diff --git a/tests/generic/088.cfg b/tests/generic/088.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/generic/088.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/018 b/tests/xfs/018
index f097b283207e..848981f87ff4 100755
--- a/tests/xfs/018
+++ b/tests/xfs/018
@@ -54,7 +54,7 @@ _require_scratch
 _require_v2log
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/018.cfg b/tests/xfs/018.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/018.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/022 b/tests/xfs/022
index cd9b9ec18c5e..b2b6142cb285 100755
--- a/tests/xfs/022
+++ b/tests/xfs/022
@@ -39,7 +39,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/022.cfg b/tests/xfs/022.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/022.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/023 b/tests/xfs/023
index 120be64e432d..9a899a86268d 100755
--- a/tests/xfs/023
+++ b/tests/xfs/023
@@ -38,7 +38,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/023.cfg b/tests/xfs/023.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/023.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/030 b/tests/xfs/030
index a43455f595ba..d2f5ed1917db 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -46,7 +46,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common/repair
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # nuke the superblock, AGI, AGF, AGFL; then try repair the damage
 #
diff --git a/tests/xfs/030.cfg b/tests/xfs/030.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/030.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/031 b/tests/xfs/031
index 48a97e1d5f4f..59d68c31f9a1 100755
--- a/tests/xfs/031
+++ b/tests/xfs/031
@@ -39,7 +39,7 @@ rm -f $seqres.full
 . ./common/filter
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _check_repair()
 {
diff --git a/tests/xfs/031.cfg b/tests/xfs/031.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/031.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/033 b/tests/xfs/033
index 576d437e33ff..dab111aa00f4 100755
--- a/tests/xfs/033
+++ b/tests/xfs/033
@@ -84,11 +84,11 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 	_scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
 
 # link correct .out file
+FEATURES=$(_get_os_name)
 if [ $_fs_has_crcs -eq 1 ]; then
-	_link_out_file $seq.crc.out $seqfull.out
-else
-	_link_out_file $seq.out $seqfull.out
+	FEATURES=$FEATURES,crc
 fi
+_link_out_file_named $seqfull.out "$FEATURES"
 
 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
 	sed -e 's/ //g' -e 's/^/export /'`
diff --git a/tests/xfs/033.cfg b/tests/xfs/033.cfg
new file mode 100644
index 000000000000..88e90e575804
--- /dev/null
+++ b/tests/xfs/033.cfg
@@ -0,0 +1,3 @@
+irix: irix
+linux,crc: crc.linux
+linux: linux
diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.crc.out.linux
deleted file mode 100644
index a6e86b9c8a28..000000000000
--- a/tests/xfs/033.crc.out.linux
+++ /dev/null
@@ -1,197 +0,0 @@
-QA output created by 033
-meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
-data     = bsize=XXX blocks=XXX, imaxpct=PCT
-         = sunit=XXX swidth=XXX, unwritten=X
-naming   =VERN bsize=XXX
-log      =LDEV bsize=XXX blocks=XXX
-realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
-Corrupting root inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared root inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-root inode lost
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing root directory
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-resetting inode INO nlinks from 1 to 2
-done
-Corrupting rt bitmap inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared realtime bitmap inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime bitmap inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting rt summary inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared realtime summary inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime summary inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting root inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared root inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-root inode lost
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing root directory
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-resetting inode INO nlinks from 1 to 2
-done
-Corrupting rt bitmap inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared realtime bitmap inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime bitmap inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting rt summary inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared realtime summary inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime summary inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
diff --git a/tests/xfs/033.out.crc.linux b/tests/xfs/033.out.crc.linux
new file mode 100644
index 000000000000..a6e86b9c8a28
--- /dev/null
+++ b/tests/xfs/033.out.crc.linux
@@ -0,0 +1,197 @@
+QA output created by 033
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+Corrupting root inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting root inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
diff --git a/tests/xfs/035 b/tests/xfs/035
index 70eac93eff29..25f2f6972f9a 100755
--- a/tests/xfs/035
+++ b/tests/xfs/035
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/035.cfg b/tests/xfs/035.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/035.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/036 b/tests/xfs/036
index 32b8c87c175f..280d03665ba9 100755
--- a/tests/xfs/036
+++ b/tests/xfs/036
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/036.cfg b/tests/xfs/036.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/036.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/039 b/tests/xfs/039
index 974792300e8b..2f765b825b9d 100755
--- a/tests/xfs/039
+++ b/tests/xfs/039
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/039.cfg b/tests/xfs/039.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/039.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/043 b/tests/xfs/043
index 55a52257a7d8..59eeff6e7777 100755
--- a/tests/xfs/043
+++ b/tests/xfs/043
@@ -39,7 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/043.cfg b/tests/xfs/043.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/043.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/055 b/tests/xfs/055
index cc747d3018a1..920ba2886cc0 100755
--- a/tests/xfs/055
+++ b/tests/xfs/055
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/082 b/tests/xfs/082
index fff1d6b48dc2..f1178fdc9311 100755
--- a/tests/xfs/082
+++ b/tests/xfs/082
@@ -55,7 +55,7 @@ _require_scratch
 _require_v2log 
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/082.cfg b/tests/xfs/082.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/082.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/tests/xfs/146 b/tests/xfs/146
index c6343f86f73a..f6cd3f30215a 100755
--- a/tests/xfs/146
+++ b/tests/xfs/146
@@ -48,7 +48,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
diff --git a/tests/xfs/146.cfg b/tests/xfs/146.cfg
new file mode 100644
index 000000000000..7ffdfc078230
--- /dev/null
+++ b/tests/xfs/146.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
-- 
2.1.4


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

* [PATCH 3/3] ext4/001: Select different output based on mount options
  2015-11-24 10:39 [PATCH 0/3 v2] Output selection Jan Kara
  2015-11-24 10:39 ` [PATCH 1/3] common: Factor out function to get OS name Jan Kara
  2015-11-24 10:39 ` [PATCH 2/3] common: Improve _link_output_file to be more versatile Jan Kara
@ 2015-11-24 10:39 ` Jan Kara
  2015-12-07 23:26   ` Theodore Ts'o
  2 siblings, 1 reply; 11+ messages in thread
From: Jan Kara @ 2015-11-24 10:39 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

From: Jan Kara <jack@suse.com>

Depending on mount options, we handle unwritten extents somewhat
differently. So sometimes we end up zeroing out unwritten extent and
converting it to written one and sometimes we just split it. Choose
expected output based on mount options.

Signed-off-by: Jan Kara <jack@suse.com>
---
 tests/ext4/001             |   4 +
 tests/ext4/001.cfg         |   2 +
 tests/ext4/001.out         | 333 ---------------------------------------------
 tests/ext4/001.out.default | 333 +++++++++++++++++++++++++++++++++++++++++++++
 tests/ext4/001.out.nozero  | 333 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 672 insertions(+), 333 deletions(-)
 create mode 100644 tests/ext4/001.cfg
 delete mode 100644 tests/ext4/001.out
 create mode 100644 tests/ext4/001.out.default
 create mode 100644 tests/ext4/001.out.nozero

diff --git a/tests/ext4/001 b/tests/ext4/001
index 5409f488dd54..c22a5e1ed520 100755
--- a/tests/ext4/001
+++ b/tests/ext4/001
@@ -22,6 +22,7 @@
 #-----------------------------------------------------------------------
 #
 
+seqfull=$0
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
@@ -48,6 +49,9 @@ _supported_os Linux
 _require_xfs_io_command "fzero"
 _require_test
 
+# Select appropriate golden output based on mount options
+_link_out_file
+
 testfile=$TEST_DIR/001.$$
 
 # Standard zero range tests
diff --git a/tests/ext4/001.cfg b/tests/ext4/001.cfg
new file mode 100644
index 000000000000..1942203f91ea
--- /dev/null
+++ b/tests/ext4/001.cfg
@@ -0,0 +1,2 @@
+dax: nozero
+dioread_nolock: nozero
diff --git a/tests/ext4/001.out b/tests/ext4/001.out
deleted file mode 100644
index c2f728483b23..000000000000
--- a/tests/ext4/001.out
+++ /dev/null
@@ -1,333 +0,0 @@
-QA output created by 001
-	1. into a hole
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	2. into allocated space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	3. into unwritten space
-0: [0..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-	4. hole -> data
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..31]: data
-3: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-	5. hole -> unwritten
-0: [0..7]: hole
-1: [8..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	6. data -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: hole
-1b3779878366498b28c702ef88c4a773
-	7. data -> unwritten
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: hole
-1b3779878366498b28c702ef88c4a773
-	8. unwritten -> hole
-0: [0..23]: unwritten
-1: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	9. unwritten -> data
-0: [0..23]: unwritten
-1: [24..31]: data
-2: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-	10. hole -> data -> hole
-0: [0..7]: hole
-1: [8..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	12. unwritten -> data -> unwritten
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-daa100df6e6711906b61c9ab5aa16032
-	13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: unwritten
-e1f024eedd27ea6b1c3e9b841c850404
-	15. data -> hole @ 0
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	16. data -> cache cold ->hole
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	17. data -> hole in single block file
-0: [0..7]: data
-0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-0000200 0000 0000 0000 0000 0000 0000 0000 0000
-*
-0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-	1. into a hole
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	2. into allocated space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	3. into unwritten space
-0: [0..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-	4. hole -> data
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..31]: data
-3: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-	5. hole -> unwritten
-0: [0..7]: hole
-1: [8..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	6. data -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: hole
-1b3779878366498b28c702ef88c4a773
-	7. data -> unwritten
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: hole
-1b3779878366498b28c702ef88c4a773
-	8. unwritten -> hole
-0: [0..23]: unwritten
-1: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	9. unwritten -> data
-0: [0..23]: unwritten
-1: [24..31]: data
-2: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-	10. hole -> data -> hole
-0: [0..7]: hole
-1: [8..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	11. data -> hole -> data
-0: [0..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	12. unwritten -> data -> unwritten
-0: [0..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-	13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: unwritten
-e1f024eedd27ea6b1c3e9b841c850404
-	15. data -> hole @ 0
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	16. data -> cache cold ->hole
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	17. data -> hole in single block file
-0: [0..7]: data
-0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-0000200 0000 0000 0000 0000 0000 0000 0000 0000
-*
-0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-	1. into a hole
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	2. into allocated space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	3. into unwritten space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	4. hole -> data
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	5. hole -> unwritten
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	6. data -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	8. unwritten -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	9. unwritten -> data
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	10. hole -> data -> hole
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	12. unwritten -> data -> unwritten
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: unwritten
-e1f024eedd27ea6b1c3e9b841c850404
-	15. data -> hole @ 0
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	16. data -> cache cold ->hole
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	17. data -> hole in single block file
-0: [0..7]: data
-0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-0000200 0000 0000 0000 0000 0000 0000 0000 0000
-*
-0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-	1. into a hole
-0: [0..7]: hole
-1: [8..23]: unwritten
-2: [24..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-	2. into allocated space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	3. into unwritten space
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	4. hole -> data
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	5. hole -> unwritten
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	6. data -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	8. unwritten -> hole
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	9. unwritten -> data
-0: [0..7]: data
-1: [8..23]: unwritten
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-	10. hole -> data -> hole
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	12. unwritten -> data -> unwritten
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: unwritten
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-	14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: unwritten
-e1f024eedd27ea6b1c3e9b841c850404
-	15. data -> hole @ 0
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	16. data -> cache cold ->hole
-0: [0..15]: unwritten
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-	17. data -> hole in single block file
-0: [0..7]: data
-0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
-0000200 0000 0000 0000 0000 0000 0000 0000 0000
-*
-0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
-*
diff --git a/tests/ext4/001.out.default b/tests/ext4/001.out.default
new file mode 100644
index 000000000000..c2f728483b23
--- /dev/null
+++ b/tests/ext4/001.out.default
@@ -0,0 +1,333 @@
+QA output created by 001
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	4. hole -> data
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..31]: data
+3: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	5. hole -> unwritten
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: hole
+1b3779878366498b28c702ef88c4a773
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: hole
+1b3779878366498b28c702ef88c4a773
+	8. unwritten -> hole
+0: [0..23]: unwritten
+1: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	9. unwritten -> data
+0: [0..23]: unwritten
+1: [24..31]: data
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	10. hole -> data -> hole
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+daa100df6e6711906b61c9ab5aa16032
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	4. hole -> data
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..31]: data
+3: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	5. hole -> unwritten
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: hole
+1b3779878366498b28c702ef88c4a773
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: hole
+1b3779878366498b28c702ef88c4a773
+	8. unwritten -> hole
+0: [0..23]: unwritten
+1: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	9. unwritten -> data
+0: [0..23]: unwritten
+1: [24..31]: data
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	10. hole -> data -> hole
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	11. data -> hole -> data
+0: [0..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	4. hole -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	5. hole -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	8. unwritten -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	9. unwritten -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	10. hole -> data -> hole
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	4. hole -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	5. hole -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	8. unwritten -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	9. unwritten -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	10. hole -> data -> hole
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
diff --git a/tests/ext4/001.out.nozero b/tests/ext4/001.out.nozero
new file mode 100644
index 000000000000..c631034e3ec1
--- /dev/null
+++ b/tests/ext4/001.out.nozero
@@ -0,0 +1,333 @@
+QA output created by 001
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	4. hole -> data
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..31]: data
+3: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	5. hole -> unwritten
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: hole
+1b3779878366498b28c702ef88c4a773
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: hole
+1b3779878366498b28c702ef88c4a773
+	8. unwritten -> hole
+0: [0..23]: unwritten
+1: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	9. unwritten -> data
+0: [0..23]: unwritten
+1: [24..31]: data
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	10. hole -> data -> hole
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	4. hole -> data
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..31]: data
+3: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	5. hole -> unwritten
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: hole
+1b3779878366498b28c702ef88c4a773
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: hole
+1b3779878366498b28c702ef88c4a773
+	8. unwritten -> hole
+0: [0..23]: unwritten
+1: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	9. unwritten -> data
+0: [0..23]: unwritten
+1: [24..31]: data
+2: [32..39]: hole
+cc63069677939f69a6e8f68cae6a6dac
+	10. hole -> data -> hole
+0: [0..7]: hole
+1: [8..31]: unwritten
+2: [32..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..39]: unwritten
+daa100df6e6711906b61c9ab5aa16032
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	4. hole -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	5. hole -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	8. unwritten -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	9. unwritten -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	10. hole -> data -> hole
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+	1. into a hole
+0: [0..7]: hole
+1: [8..23]: unwritten
+2: [24..39]: hole
+daa100df6e6711906b61c9ab5aa16032
+	2. into allocated space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	3. into unwritten space
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	4. hole -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	5. hole -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	6. data -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	7. data -> unwritten
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	8. unwritten -> hole
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	9. unwritten -> data
+0: [0..7]: data
+1: [8..23]: unwritten
+2: [24..39]: data
+cc58a7417c2d7763adc45b6fcd3fa024
+	10. hole -> data -> hole
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	11. data -> hole -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	12. unwritten -> data -> unwritten
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	13. data -> unwritten -> data
+0: [0..7]: data
+1: [8..31]: unwritten
+2: [32..39]: data
+f6aeca13ec49e5b266cd1c913cd726e3
+	14. data -> hole @ EOF
+0: [0..23]: data
+1: [24..39]: unwritten
+e1f024eedd27ea6b1c3e9b841c850404
+	15. data -> hole @ 0
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	16. data -> cache cold ->hole
+0: [0..15]: unwritten
+1: [16..39]: data
+eecb7aa303d121835de05028751d301c
+	17. data -> hole in single block file
+0: [0..7]: data
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
-- 
2.1.4


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

* Re: [PATCH 1/3] common: Factor out function to get OS name
  2015-11-24 10:39 ` [PATCH 1/3] common: Factor out function to get OS name Jan Kara
@ 2015-12-07 23:24   ` Theodore Ts'o
  0 siblings, 0 replies; 11+ messages in thread
From: Theodore Ts'o @ 2015-12-07 23:24 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests, linux-ext4

On Tue, Nov 24, 2015 at 11:39:56AM +0100, Jan Kara wrote:
> Signed-off-by: Jan Kara <jack@suse.cz>

Reviewed-by: Theodore Ts'o <tytso@mit.edu>


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

* Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
  2015-11-24 10:39 ` [PATCH 2/3] common: Improve _link_output_file to be more versatile Jan Kara
@ 2015-12-07 23:26     ` Theodore Ts'o
  0 siblings, 0 replies; 11+ messages in thread
From: Theodore Ts'o @ 2015-12-07 23:26 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests, linux-ext4, Jan Kara

On Tue, Nov 24, 2015 at 11:39:57AM +0100, Jan Kara wrote:
> From: Jan Kara <jack@suse.com>
> 
> Currently _link_output_file() selects output file suffix based on the
> current operating system. Make it more versatile by allowing selection
> of output file suffix based on any feature string. The idea is that
> in config file ($seq.cfg) there are several lines like:
> 
> feat1,feat2: suffix
> 
> The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
> if no argument is passed) and selects output file with a suffix for
> which all features are present in the feature string. If there is no
> matching line, output with 'default' suffix is selected.
> 
> Update all tests using _link_out_file to the new calling convention.
> 
> Signed-off-by: Jan Kara <jack@suse.com>

I made a slight change so that if $seqfull.cfg doesn't exist, we use
./common/default.cfg instead.  This avoids the need to create a large
number of identical files:

>  tests/generic/088.cfg       |   2 +
>  tests/xfs/018.cfg           |   2 +
>  tests/xfs/022.cfg           |   2 +
>  tests/xfs/023.cfg           |   2 +
>  tests/xfs/030.cfg           |   2 +
>  tests/xfs/031.cfg           |   2 +
>  tests/xfs/035.cfg           |   2 +
>  tests/xfs/036.cfg           |   2 +
>  tests/xfs/039.cfg           |   2 +
>  tests/xfs/043.cfg           |   2 +
>  tests/xfs/082.cfg           |   2 +
>  tests/xfs/146.cfg           |   2 +

What do you think?

						- Ted

commit 37c2d44b6cc6772f0daa10761fb532b5662dc6fc
Author: Jan Kara <jack@suse.com>
Date:   Tue Nov 24 11:39:57 2015 +0100

    common: Improve _link_output_file to be more versatile
    
    Currently _link_output_file() selects output file suffix based on the
    current operating system. Make it more versatile by allowing selection
    of output file suffix based on any feature string. The idea is that
    in config file ($seq.cfg) there are several lines like:
    
    feat1,feat2: suffix
    
    The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
    if no argument is passed) and selects output file with a suffix for
    which all features are present in the feature string. If there is no
    matching line, output with 'default' suffix is selected.
    
    Update all tests using _link_out_file to the new calling convention.
    
    Signed-off-by: Jan Kara <jack@suse.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>

diff --git a/common/default.cfg b/common/default.cfg
new file mode 100644
index 0000000..7ffdfc0
--- /dev/null
+++ b/common/default.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/common/rc b/common/rc
index 62216f4..3b4cbe0 100644
--- a/common/rc
+++ b/common/rc
@@ -2205,15 +2205,60 @@ _get_os_name()
 	fi
 }
 
+_link_out_file_named()
+{
+	local cfg_file
+	export FEATURES=$2
+
+	if test -f $seqfull.cfg; then
+		cfg_file=$seqfull.cfg
+	else
+		cfg_file=./common/default.cfg
+	fi
+
+	SUFFIX=$(perl -e '
+		my %feathash;
+		my $feature, $result, $suffix, $opts;
+
+		foreach $feature (split(/,/, $ENV{"FEATURES"})) {
+			$feathash{$feature} = 1;
+		}
+		$result = "default";
+		while (<>) {
+			my $found = 1;
+
+			chomp;
+			($opts, $suffix) = split(/ *: */);
+			foreach my $opt (split(/,/, $opts)) {
+				if (!exists($feathash{$opt})) {
+					$found = 0;
+					last;
+				}
+			}
+			if ($found == 1) {
+				$result = $suffix;
+				last;
+			}
+		}
+		print $result
+		' <$cfg_file)
+	rm -f $1
+	SRC=$(basename $1)
+	ln -fs $SRC.$SUFFIX $1
+}
+
 _link_out_file()
 {
-	if [ -z "$1" -o -z "$2" ]; then
-		echo Error must pass src and dst.
-		exit
+	if [ $# -eq 0 ]; then
+		FEATURES="$(_get_os_name)"
+		if [ -n "$MOUNT_OPTIONS" ]; then
+			FEATURES=$FEATURES,${MOUNT_OPTIONS##"-o "}
+		fi
+	else
+		FEATURES=$1
 	fi
-	rm -f $2
-	SUFFIX=$(_get_os_name())
-	ln -s $1.$SUFFIX $2
+
+	_link_out_file_named $seqfull.out "$FEATURES"
 }
 
 _die()
diff --git a/tests/generic/088 b/tests/generic/088
index 983de98..46ce6ae 100755
--- a/tests/generic/088
+++ b/tests/generic/088
@@ -43,7 +43,7 @@ _filter()
 }
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs generic
diff --git a/tests/xfs/018 b/tests/xfs/018
index f097b28..848981f 100755
--- a/tests/xfs/018
+++ b/tests/xfs/018
@@ -54,7 +54,7 @@ _require_scratch
 _require_v2log
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/022 b/tests/xfs/022
index cd9b9ec..b2b6142 100755
--- a/tests/xfs/022
+++ b/tests/xfs/022
@@ -39,7 +39,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/023 b/tests/xfs/023
index 120be64..9a899a8 100755
--- a/tests/xfs/023
+++ b/tests/xfs/023
@@ -38,7 +38,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/030 b/tests/xfs/030
index a43455f..d2f5ed1 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -46,7 +46,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common/repair
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # nuke the superblock, AGI, AGF, AGFL; then try repair the damage
 #
diff --git a/tests/xfs/031 b/tests/xfs/031
index 48a97e1..59d68c3 100755
--- a/tests/xfs/031
+++ b/tests/xfs/031
@@ -39,7 +39,7 @@ rm -f $seqres.full
 . ./common/filter
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _check_repair()
 {
diff --git a/tests/xfs/033 b/tests/xfs/033
index 576d437..dab111a 100755
--- a/tests/xfs/033
+++ b/tests/xfs/033
@@ -84,11 +84,11 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 	_scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
 
 # link correct .out file
+FEATURES=$(_get_os_name)
 if [ $_fs_has_crcs -eq 1 ]; then
-	_link_out_file $seq.crc.out $seqfull.out
-else
-	_link_out_file $seq.out $seqfull.out
+	FEATURES=$FEATURES,crc
 fi
+_link_out_file_named $seqfull.out "$FEATURES"
 
 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
 	sed -e 's/ //g' -e 's/^/export /'`
diff --git a/tests/xfs/033.cfg b/tests/xfs/033.cfg
new file mode 100644
index 0000000..88e90e5
--- /dev/null
+++ b/tests/xfs/033.cfg
@@ -0,0 +1,3 @@
+irix: irix
+linux,crc: crc.linux
+linux: linux
diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.out.crc.linux
similarity index 100%
rename from tests/xfs/033.crc.out.linux
rename to tests/xfs/033.out.crc.linux
diff --git a/tests/xfs/035 b/tests/xfs/035
index 70eac93..25f2f69 100755
--- a/tests/xfs/035
+++ b/tests/xfs/035
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/036 b/tests/xfs/036
index 32b8c87..280d036 100755
--- a/tests/xfs/036
+++ b/tests/xfs/036
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/039 b/tests/xfs/039
index 9747923..2f765b8 100755
--- a/tests/xfs/039
+++ b/tests/xfs/039
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/043 b/tests/xfs/043
index 55a5225..59eeff6 100755
--- a/tests/xfs/043
+++ b/tests/xfs/043
@@ -39,7 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/055 b/tests/xfs/055
index cc747d3..920ba28 100755
--- a/tests/xfs/055
+++ b/tests/xfs/055
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/082 b/tests/xfs/082
index fff1d6b..f1178fd 100755
--- a/tests/xfs/082
+++ b/tests/xfs/082
@@ -55,7 +55,7 @@ _require_scratch
 _require_v2log 
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/146 b/tests/xfs/146
index c6343f8..f6cd3f3 100755
--- a/tests/xfs/146
+++ b/tests/xfs/146
@@ -48,7 +48,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1

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

* Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
@ 2015-12-07 23:26     ` Theodore Ts'o
  0 siblings, 0 replies; 11+ messages in thread
From: Theodore Ts'o @ 2015-12-07 23:26 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests, linux-ext4, Jan Kara

On Tue, Nov 24, 2015 at 11:39:57AM +0100, Jan Kara wrote:
> From: Jan Kara <jack@suse.com>
> 
> Currently _link_output_file() selects output file suffix based on the
> current operating system. Make it more versatile by allowing selection
> of output file suffix based on any feature string. The idea is that
> in config file ($seq.cfg) there are several lines like:
> 
> feat1,feat2: suffix
> 
> The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
> if no argument is passed) and selects output file with a suffix for
> which all features are present in the feature string. If there is no
> matching line, output with 'default' suffix is selected.
> 
> Update all tests using _link_out_file to the new calling convention.
> 
> Signed-off-by: Jan Kara <jack@suse.com>

I made a slight change so that if $seqfull.cfg doesn't exist, we use
./common/default.cfg instead.  This avoids the need to create a large
number of identical files:

>  tests/generic/088.cfg       |   2 +
>  tests/xfs/018.cfg           |   2 +
>  tests/xfs/022.cfg           |   2 +
>  tests/xfs/023.cfg           |   2 +
>  tests/xfs/030.cfg           |   2 +
>  tests/xfs/031.cfg           |   2 +
>  tests/xfs/035.cfg           |   2 +
>  tests/xfs/036.cfg           |   2 +
>  tests/xfs/039.cfg           |   2 +
>  tests/xfs/043.cfg           |   2 +
>  tests/xfs/082.cfg           |   2 +
>  tests/xfs/146.cfg           |   2 +

What do you think?

						- Ted

commit 37c2d44b6cc6772f0daa10761fb532b5662dc6fc
Author: Jan Kara <jack@suse.com>
Date:   Tue Nov 24 11:39:57 2015 +0100

    common: Improve _link_output_file to be more versatile
    
    Currently _link_output_file() selects output file suffix based on the
    current operating system. Make it more versatile by allowing selection
    of output file suffix based on any feature string. The idea is that
    in config file ($seq.cfg) there are several lines like:
    
    feat1,feat2: suffix
    
    The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
    if no argument is passed) and selects output file with a suffix for
    which all features are present in the feature string. If there is no
    matching line, output with 'default' suffix is selected.
    
    Update all tests using _link_out_file to the new calling convention.
    
    Signed-off-by: Jan Kara <jack@suse.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>

diff --git a/common/default.cfg b/common/default.cfg
new file mode 100644
index 0000000..7ffdfc0
--- /dev/null
+++ b/common/default.cfg
@@ -0,0 +1,2 @@
+irix: irix
+linux: linux
diff --git a/common/rc b/common/rc
index 62216f4..3b4cbe0 100644
--- a/common/rc
+++ b/common/rc
@@ -2205,15 +2205,60 @@ _get_os_name()
 	fi
 }
 
+_link_out_file_named()
+{
+	local cfg_file
+	export FEATURES=$2
+
+	if test -f $seqfull.cfg; then
+		cfg_file=$seqfull.cfg
+	else
+		cfg_file=./common/default.cfg
+	fi
+
+	SUFFIX=$(perl -e '
+		my %feathash;
+		my $feature, $result, $suffix, $opts;
+
+		foreach $feature (split(/,/, $ENV{"FEATURES"})) {
+			$feathash{$feature} = 1;
+		}
+		$result = "default";
+		while (<>) {
+			my $found = 1;
+
+			chomp;
+			($opts, $suffix) = split(/ *: */);
+			foreach my $opt (split(/,/, $opts)) {
+				if (!exists($feathash{$opt})) {
+					$found = 0;
+					last;
+				}
+			}
+			if ($found == 1) {
+				$result = $suffix;
+				last;
+			}
+		}
+		print $result
+		' <$cfg_file)
+	rm -f $1
+	SRC=$(basename $1)
+	ln -fs $SRC.$SUFFIX $1
+}
+
 _link_out_file()
 {
-	if [ -z "$1" -o -z "$2" ]; then
-		echo Error must pass src and dst.
-		exit
+	if [ $# -eq 0 ]; then
+		FEATURES="$(_get_os_name)"
+		if [ -n "$MOUNT_OPTIONS" ]; then
+			FEATURES=$FEATURES,${MOUNT_OPTIONS##"-o "}
+		fi
+	else
+		FEATURES=$1
 	fi
-	rm -f $2
-	SUFFIX=$(_get_os_name())
-	ln -s $1.$SUFFIX $2
+
+	_link_out_file_named $seqfull.out "$FEATURES"
 }
 
 _die()
diff --git a/tests/generic/088 b/tests/generic/088
index 983de98..46ce6ae 100755
--- a/tests/generic/088
+++ b/tests/generic/088
@@ -43,7 +43,7 @@ _filter()
 }
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs generic
diff --git a/tests/xfs/018 b/tests/xfs/018
index f097b28..848981f 100755
--- a/tests/xfs/018
+++ b/tests/xfs/018
@@ -54,7 +54,7 @@ _require_scratch
 _require_v2log
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/022 b/tests/xfs/022
index cd9b9ec..b2b6142 100755
--- a/tests/xfs/022
+++ b/tests/xfs/022
@@ -39,7 +39,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/023 b/tests/xfs/023
index 120be64..9a899a8 100755
--- a/tests/xfs/023
+++ b/tests/xfs/023
@@ -38,7 +38,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/030 b/tests/xfs/030
index a43455f..d2f5ed1 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -46,7 +46,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common/repair
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # nuke the superblock, AGI, AGF, AGFL; then try repair the damage
 #
diff --git a/tests/xfs/031 b/tests/xfs/031
index 48a97e1..59d68c3 100755
--- a/tests/xfs/031
+++ b/tests/xfs/031
@@ -39,7 +39,7 @@ rm -f $seqres.full
 . ./common/filter
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _check_repair()
 {
diff --git a/tests/xfs/033 b/tests/xfs/033
index 576d437..dab111a 100755
--- a/tests/xfs/033
+++ b/tests/xfs/033
@@ -84,11 +84,11 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 	_scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
 
 # link correct .out file
+FEATURES=$(_get_os_name)
 if [ $_fs_has_crcs -eq 1 ]; then
-	_link_out_file $seq.crc.out $seqfull.out
-else
-	_link_out_file $seq.out $seqfull.out
+	FEATURES=$FEATURES,crc
 fi
+_link_out_file_named $seqfull.out "$FEATURES"
 
 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
 	sed -e 's/ //g' -e 's/^/export /'`
diff --git a/tests/xfs/033.cfg b/tests/xfs/033.cfg
new file mode 100644
index 0000000..88e90e5
--- /dev/null
+++ b/tests/xfs/033.cfg
@@ -0,0 +1,3 @@
+irix: irix
+linux,crc: crc.linux
+linux: linux
diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.out.crc.linux
similarity index 100%
rename from tests/xfs/033.crc.out.linux
rename to tests/xfs/033.out.crc.linux
diff --git a/tests/xfs/035 b/tests/xfs/035
index 70eac93..25f2f69 100755
--- a/tests/xfs/035
+++ b/tests/xfs/035
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/036 b/tests/xfs/036
index 32b8c87..280d036 100755
--- a/tests/xfs/036
+++ b/tests/xfs/036
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/039 b/tests/xfs/039
index 9747923..2f765b8 100755
--- a/tests/xfs/039
+++ b/tests/xfs/039
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/043 b/tests/xfs/043
index 55a5225..59eeff6 100755
--- a/tests/xfs/043
+++ b/tests/xfs/043
@@ -39,7 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/055 b/tests/xfs/055
index cc747d3..920ba28 100755
--- a/tests/xfs/055
+++ b/tests/xfs/055
@@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/dump
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 # real QA test starts here
 _supported_fs xfs
diff --git a/tests/xfs/082 b/tests/xfs/082
index fff1d6b..f1178fd 100755
--- a/tests/xfs/082
+++ b/tests/xfs/082
@@ -55,7 +55,7 @@ _require_scratch
 _require_v2log 
 
 # link correct .out file
-_link_out_file $seq.op $seqfull.op
+_link_out_file_named $seqfull.op $(_get_os_name)
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
diff --git a/tests/xfs/146 b/tests/xfs/146
index c6343f8..f6cd3f3 100755
--- a/tests/xfs/146
+++ b/tests/xfs/146
@@ -48,7 +48,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 # link correct .out file
-_link_out_file $seq.out $seqfull.out
+_link_out_file
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1

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

* Re: [PATCH 3/3] ext4/001: Select different output based on mount options
  2015-11-24 10:39 ` [PATCH 3/3] ext4/001: Select different output based on mount options Jan Kara
@ 2015-12-07 23:26   ` Theodore Ts'o
  0 siblings, 0 replies; 11+ messages in thread
From: Theodore Ts'o @ 2015-12-07 23:26 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests, linux-ext4, Jan Kara

On Tue, Nov 24, 2015 at 11:39:58AM +0100, Jan Kara wrote:
> From: Jan Kara <jack@suse.com>
> 
> Depending on mount options, we handle unwritten extents somewhat
> differently. So sometimes we end up zeroing out unwritten extent and
> converting it to written one and sometimes we just split it. Choose
> expected output based on mount options.
> 
> Signed-off-by: Jan Kara <jack@suse.com>

Reviewed-by: Theodore Ts'o <tytso@mit.edu>

						- Ted

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

* Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
  2015-12-07 23:26     ` Theodore Ts'o
  (?)
@ 2015-12-09 12:27     ` Jan Kara
  2015-12-09 15:17       ` Christoph Hellwig
  2015-12-21  0:34       ` Dave Chinner
  -1 siblings, 2 replies; 11+ messages in thread
From: Jan Kara @ 2015-12-09 12:27 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Jan Kara, fstests, linux-ext4, Jan Kara

On Mon 07-12-15 18:26:19, Ted Tso wrote:
> On Tue, Nov 24, 2015 at 11:39:57AM +0100, Jan Kara wrote:
> > From: Jan Kara <jack@suse.com>
> > 
> > Currently _link_output_file() selects output file suffix based on the
> > current operating system. Make it more versatile by allowing selection
> > of output file suffix based on any feature string. The idea is that
> > in config file ($seq.cfg) there are several lines like:
> > 
> > feat1,feat2: suffix
> > 
> > The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
> > if no argument is passed) and selects output file with a suffix for
> > which all features are present in the feature string. If there is no
> > matching line, output with 'default' suffix is selected.
> > 
> > Update all tests using _link_out_file to the new calling convention.
> > 
> > Signed-off-by: Jan Kara <jack@suse.com>
> 
> I made a slight change so that if $seqfull.cfg doesn't exist, we use
> ./common/default.cfg instead.  This avoids the need to create a large
> number of identical files:
> 
> >  tests/generic/088.cfg       |   2 +
> >  tests/xfs/018.cfg           |   2 +
> >  tests/xfs/022.cfg           |   2 +
> >  tests/xfs/023.cfg           |   2 +
> >  tests/xfs/030.cfg           |   2 +
> >  tests/xfs/031.cfg           |   2 +
> >  tests/xfs/035.cfg           |   2 +
> >  tests/xfs/036.cfg           |   2 +
> >  tests/xfs/039.cfg           |   2 +
> >  tests/xfs/043.cfg           |   2 +
> >  tests/xfs/082.cfg           |   2 +
> >  tests/xfs/146.cfg           |   2 +
> 
> What do you think?

So I'm somewhat undecided whether this is better or not ;). It certainly
saves us some churn with identical .cfg files for linux vs irix configs
but OTOH I don't expect there to be much more .cfg files selecting between
irix and linux so this is mostly one-time issue. So I guess I'll leave it
upto Dave and his taste to decide what he finds better.

								Honza

> commit 37c2d44b6cc6772f0daa10761fb532b5662dc6fc
> Author: Jan Kara <jack@suse.com>
> Date:   Tue Nov 24 11:39:57 2015 +0100
> 
>     common: Improve _link_output_file to be more versatile
>     
>     Currently _link_output_file() selects output file suffix based on the
>     current operating system. Make it more versatile by allowing selection
>     of output file suffix based on any feature string. The idea is that
>     in config file ($seq.cfg) there are several lines like:
>     
>     feat1,feat2: suffix
>     
>     The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
>     if no argument is passed) and selects output file with a suffix for
>     which all features are present in the feature string. If there is no
>     matching line, output with 'default' suffix is selected.
>     
>     Update all tests using _link_out_file to the new calling convention.
>     
>     Signed-off-by: Jan Kara <jack@suse.com>
>     Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> 
> diff --git a/common/default.cfg b/common/default.cfg
> new file mode 100644
> index 0000000..7ffdfc0
> --- /dev/null
> +++ b/common/default.cfg
> @@ -0,0 +1,2 @@
> +irix: irix
> +linux: linux
> diff --git a/common/rc b/common/rc
> index 62216f4..3b4cbe0 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2205,15 +2205,60 @@ _get_os_name()
>  	fi
>  }
>  
> +_link_out_file_named()
> +{
> +	local cfg_file
> +	export FEATURES=$2
> +
> +	if test -f $seqfull.cfg; then
> +		cfg_file=$seqfull.cfg
> +	else
> +		cfg_file=./common/default.cfg
> +	fi
> +
> +	SUFFIX=$(perl -e '
> +		my %feathash;
> +		my $feature, $result, $suffix, $opts;
> +
> +		foreach $feature (split(/,/, $ENV{"FEATURES"})) {
> +			$feathash{$feature} = 1;
> +		}
> +		$result = "default";
> +		while (<>) {
> +			my $found = 1;
> +
> +			chomp;
> +			($opts, $suffix) = split(/ *: */);
> +			foreach my $opt (split(/,/, $opts)) {
> +				if (!exists($feathash{$opt})) {
> +					$found = 0;
> +					last;
> +				}
> +			}
> +			if ($found == 1) {
> +				$result = $suffix;
> +				last;
> +			}
> +		}
> +		print $result
> +		' <$cfg_file)
> +	rm -f $1
> +	SRC=$(basename $1)
> +	ln -fs $SRC.$SUFFIX $1
> +}
> +
>  _link_out_file()
>  {
> -	if [ -z "$1" -o -z "$2" ]; then
> -		echo Error must pass src and dst.
> -		exit
> +	if [ $# -eq 0 ]; then
> +		FEATURES="$(_get_os_name)"
> +		if [ -n "$MOUNT_OPTIONS" ]; then
> +			FEATURES=$FEATURES,${MOUNT_OPTIONS##"-o "}
> +		fi
> +	else
> +		FEATURES=$1
>  	fi
> -	rm -f $2
> -	SUFFIX=$(_get_os_name())
> -	ln -s $1.$SUFFIX $2
> +
> +	_link_out_file_named $seqfull.out "$FEATURES"
>  }
>  
>  _die()
> diff --git a/tests/generic/088 b/tests/generic/088
> index 983de98..46ce6ae 100755
> --- a/tests/generic/088
> +++ b/tests/generic/088
> @@ -43,7 +43,7 @@ _filter()
>  }
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs generic
> diff --git a/tests/xfs/018 b/tests/xfs/018
> index f097b28..848981f 100755
> --- a/tests/xfs/018
> +++ b/tests/xfs/018
> @@ -54,7 +54,7 @@ _require_scratch
>  _require_v2log
>  
>  # link correct .out file
> -_link_out_file $seq.op $seqfull.op
> +_link_out_file_named $seqfull.op $(_get_os_name)
>  
>  echo "*** init FS"
>  umount $SCRATCH_DEV >/dev/null 2>&1
> diff --git a/tests/xfs/022 b/tests/xfs/022
> index cd9b9ec..b2b6142 100755
> --- a/tests/xfs/022
> +++ b/tests/xfs/022
> @@ -39,7 +39,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/023 b/tests/xfs/023
> index 120be64..9a899a8 100755
> --- a/tests/xfs/023
> +++ b/tests/xfs/023
> @@ -38,7 +38,7 @@ trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/030 b/tests/xfs/030
> index a43455f..d2f5ed1 100755
> --- a/tests/xfs/030
> +++ b/tests/xfs/030
> @@ -46,7 +46,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  . ./common/repair
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # nuke the superblock, AGI, AGF, AGFL; then try repair the damage
>  #
> diff --git a/tests/xfs/031 b/tests/xfs/031
> index 48a97e1..59d68c3 100755
> --- a/tests/xfs/031
> +++ b/tests/xfs/031
> @@ -39,7 +39,7 @@ rm -f $seqres.full
>  . ./common/filter
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  _check_repair()
>  {
> diff --git a/tests/xfs/033 b/tests/xfs/033
> index 576d437..dab111a 100755
> --- a/tests/xfs/033
> +++ b/tests/xfs/033
> @@ -84,11 +84,11 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
>  	_scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
>  
>  # link correct .out file
> +FEATURES=$(_get_os_name)
>  if [ $_fs_has_crcs -eq 1 ]; then
> -	_link_out_file $seq.crc.out $seqfull.out
> -else
> -	_link_out_file $seq.out $seqfull.out
> +	FEATURES=$FEATURES,crc
>  fi
> +_link_out_file_named $seqfull.out "$FEATURES"
>  
>  `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
>  	sed -e 's/ //g' -e 's/^/export /'`
> diff --git a/tests/xfs/033.cfg b/tests/xfs/033.cfg
> new file mode 100644
> index 0000000..88e90e5
> --- /dev/null
> +++ b/tests/xfs/033.cfg
> @@ -0,0 +1,3 @@
> +irix: irix
> +linux,crc: crc.linux
> +linux: linux
> diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.out.crc.linux
> similarity index 100%
> rename from tests/xfs/033.crc.out.linux
> rename to tests/xfs/033.out.crc.linux
> diff --git a/tests/xfs/035 b/tests/xfs/035
> index 70eac93..25f2f69 100755
> --- a/tests/xfs/035
> +++ b/tests/xfs/035
> @@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/036 b/tests/xfs/036
> index 32b8c87..280d036 100755
> --- a/tests/xfs/036
> +++ b/tests/xfs/036
> @@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/039 b/tests/xfs/039
> index 9747923..2f765b8 100755
> --- a/tests/xfs/039
> +++ b/tests/xfs/039
> @@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/043 b/tests/xfs/043
> index 55a5225..59eeff6 100755
> --- a/tests/xfs/043
> +++ b/tests/xfs/043
> @@ -39,7 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/055 b/tests/xfs/055
> index cc747d3..920ba28 100755
> --- a/tests/xfs/055
> +++ b/tests/xfs/055
> @@ -37,7 +37,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
>  . ./common/dump
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  # real QA test starts here
>  _supported_fs xfs
> diff --git a/tests/xfs/082 b/tests/xfs/082
> index fff1d6b..f1178fd 100755
> --- a/tests/xfs/082
> +++ b/tests/xfs/082
> @@ -55,7 +55,7 @@ _require_scratch
>  _require_v2log 
>  
>  # link correct .out file
> -_link_out_file $seq.op $seqfull.op
> +_link_out_file_named $seqfull.op $(_get_os_name)
>  
>  echo "*** init FS"
>  umount $SCRATCH_DEV >/dev/null 2>&1
> diff --git a/tests/xfs/146 b/tests/xfs/146
> index c6343f8..f6cd3f3 100755
> --- a/tests/xfs/146
> +++ b/tests/xfs/146
> @@ -48,7 +48,7 @@ _supported_fs xfs
>  _supported_os Linux IRIX
>  
>  # link correct .out file
> -_link_out_file $seq.out $seqfull.out
> +_link_out_file
>  
>  _require_scratch
>  _scratch_mkfs_xfs >/dev/null 2>&1
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
  2015-12-09 12:27     ` Jan Kara
@ 2015-12-09 15:17       ` Christoph Hellwig
  2015-12-21  0:34       ` Dave Chinner
  1 sibling, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2015-12-09 15:17 UTC (permalink / raw)
  To: Jan Kara; +Cc: Theodore Ts'o, fstests, linux-ext4, Jan Kara

Maybe it's time to drop IRIX support?  I'm pretty sure it hasn't worked
for a long time..

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

* Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
  2015-12-09 12:27     ` Jan Kara
  2015-12-09 15:17       ` Christoph Hellwig
@ 2015-12-21  0:34       ` Dave Chinner
  1 sibling, 0 replies; 11+ messages in thread
From: Dave Chinner @ 2015-12-21  0:34 UTC (permalink / raw)
  To: Jan Kara; +Cc: Theodore Ts'o, fstests, linux-ext4, Jan Kara

On Wed, Dec 09, 2015 at 01:27:07PM +0100, Jan Kara wrote:
> On Mon 07-12-15 18:26:19, Ted Tso wrote:
> > On Tue, Nov 24, 2015 at 11:39:57AM +0100, Jan Kara wrote:
> > > From: Jan Kara <jack@suse.com>
> > > 
> > > Currently _link_output_file() selects output file suffix based on the
> > > current operating system. Make it more versatile by allowing selection
> > > of output file suffix based on any feature string. The idea is that
> > > in config file ($seq.cfg) there are several lines like:
> > > 
> > > feat1,feat2: suffix
> > > 
> > > The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
> > > if no argument is passed) and selects output file with a suffix for
> > > which all features are present in the feature string. If there is no
> > > matching line, output with 'default' suffix is selected.
> > > 
> > > Update all tests using _link_out_file to the new calling convention.
> > > 
> > > Signed-off-by: Jan Kara <jack@suse.com>
> > 
> > I made a slight change so that if $seqfull.cfg doesn't exist, we use
> > ./common/default.cfg instead.  This avoids the need to create a large
> > number of identical files:
> > 
> > >  tests/generic/088.cfg       |   2 +
> > >  tests/xfs/018.cfg           |   2 +
> > >  tests/xfs/022.cfg           |   2 +
> > >  tests/xfs/023.cfg           |   2 +
> > >  tests/xfs/030.cfg           |   2 +
> > >  tests/xfs/031.cfg           |   2 +
> > >  tests/xfs/035.cfg           |   2 +
> > >  tests/xfs/036.cfg           |   2 +
> > >  tests/xfs/039.cfg           |   2 +
> > >  tests/xfs/043.cfg           |   2 +
> > >  tests/xfs/082.cfg           |   2 +
> > >  tests/xfs/146.cfg           |   2 +
> > 
> > What do you think?
> 
> So I'm somewhat undecided whether this is better or not ;). It certainly
> saves us some churn with identical .cfg files for linux vs irix configs
> but OTOH I don't expect there to be much more .cfg files selecting between
> irix and linux so this is mostly one-time issue. So I guess I'll leave it
> upto Dave and his taste to decide what he finds better.

I'll take the one-time change here, but as Christoph suggested it
really is getting to the point where we should stop considering
xfstests to be a cross-platform test suite. Just another cleanup to
be done...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

end of thread, other threads:[~2015-12-21  0:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 10:39 [PATCH 0/3 v2] Output selection Jan Kara
2015-11-24 10:39 ` [PATCH 1/3] common: Factor out function to get OS name Jan Kara
2015-12-07 23:24   ` Theodore Ts'o
2015-11-24 10:39 ` [PATCH 2/3] common: Improve _link_output_file to be more versatile Jan Kara
2015-12-07 23:26   ` Theodore Ts'o
2015-12-07 23:26     ` Theodore Ts'o
2015-12-09 12:27     ` Jan Kara
2015-12-09 15:17       ` Christoph Hellwig
2015-12-21  0:34       ` Dave Chinner
2015-11-24 10:39 ` [PATCH 3/3] ext4/001: Select different output based on mount options Jan Kara
2015-12-07 23:26   ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.