Output selection
v2 cover Output selection
From: Jan Kara <[email protected]>
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
PATCH v2 1/3 common: Factor out function to get OS name
--- common/rc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
common/rc +14 -8
@@ -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()
Signature · 1 line
2.1.4
Re: [PATCH 1/3] common: Factor out function to get OS name
Quoted 1 line · Jan Kara
Signed-off-by Jan Kara <[email protected]>
PATCH v2 2/3 common: Improve _link_output_file to be more versatile
In reply to Jan KaraFrom: Jan Kara <[email protected]>
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.
--- 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
common/rc +43 -6
@@ -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()
tests/generic/088 +1 -1
@@ -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
tests/generic/088.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/018 +1 -1
@@ -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
tests/xfs/018.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/022 +1 -1
@@ -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
tests/xfs/022.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/023 +1 -1
@@ -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
tests/xfs/023.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/030 +1 -1
@@ -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 #
tests/xfs/030.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/031 +1 -1
@@ -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() {
tests/xfs/031.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/033 +3 -3
@@ -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 /'`
tests/xfs/033.cfg new file +3 -0
@@ -0,0 +1,3 @@ +irix: irix +linux,crc: crc.linux +linux: linux
tests/xfs/033.crc.out.linux deleted +0 -197
197 lines not on this page · raw message
tests/xfs/033.out.crc.linux new file +197 -0
197 lines not on this page · raw message
tests/xfs/035 +1 -1
@@ -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
tests/xfs/035.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/036 +1 -1
@@ -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
tests/xfs/036.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/039 +1 -1
@@ -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
tests/xfs/039.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/043 +1 -1
@@ -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
tests/xfs/043.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/055 +1 -1
@@ -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
tests/xfs/082 +1 -1
@@ -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
tests/xfs/082.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
tests/xfs/146 +1 -1
@@ -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
tests/xfs/146.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
Signature · 1 line
2.1.4
Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
Quoted 9 lines · Jan Kara
From: Jan Kara <[email protected]>
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
Quoted 8 lines
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_fileto the new calling convention.Signed-off-by Jan Kara <[email protected]>
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:
Quoted 4 lines
tests/generic/088.cfg | 2 + tests/xfs/018.cfg | 2 + tests/xfs/022.cfg | 2 + tests/xfs/023.cfg | 2 +
Quoted 8 lines
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 <[email protected]> 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.
common/default.cfg new file +2 -0
@@ -0,0 +1,2 @@ +irix: irix +linux: linux
common/rc +51 -6
66 lines not on this page · raw message
tests/generic/088 +1 -1
@@ -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
tests/xfs/018 +1 -1
@@ -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
tests/xfs/022 +1 -1
@@ -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
tests/xfs/023 +1 -1
@@ -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
tests/xfs/030 +1 -1
@@ -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 #
tests/xfs/031 +1 -1
@@ -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() {
tests/xfs/033 +3 -3
@@ -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 /'`
tests/xfs/033.cfg new file +3 -0
@@ -0,0 +1,3 @@ +irix: irix +linux,crc: crc.linux +linux: linux
tests/xfs/033.out.crc.linux renamed from tests/xfs/033.crc.out.linux +0 -0
tests/xfs/035 +1 -1
@@ -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
tests/xfs/036 +1 -1
@@ -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
tests/xfs/039 +1 -1
@@ -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
tests/xfs/043 +1 -1
@@ -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
tests/xfs/055 +1 -1
@@ -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
tests/xfs/082 +1 -1
@@ -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
tests/xfs/146 +1 -1
@@ -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
Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
Quoted 36 lines · Ted Tso
Quoted 9 lines · Jan Kara
From: Jan Kara <[email protected]>
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
Quoted 8 lines
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_fileto the new calling convention.Signed-off-by Jan Kara <[email protected]>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:
Quoted 4 lines
tests/generic/088.cfg | 2 + tests/xfs/018.cfg | 2 + tests/xfs/022.cfg | 2 + tests/xfs/023.cfg | 2 +Quoted 8 lines
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 +
Quoted 1 line
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
Quoted 303 lines
commit
37c2d44b6cc6772f0daa10761fb532b5662dc6fcAuthor: Jan Kara <[email protected]> Date: Tue Nov 24 11:39:57 2015 +0100common: Improve
_link_output_fileto be more versatileCurrently
_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_fileto the new calling convention.Signed-off-by Jan Kara <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>common/default.cfg new file +2
-0@@ -0,0 +1,2 @@ +irix: irix +linux: linuxcommon/rc +51
-6@@ -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()tests/generic/088 +1
-1@@ -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 generictests/xfs/018 +1
-1@@ -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>&1tests/xfs/022 +1
-1@@ -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 xfstests/xfs/023 +1
-1@@ -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 xfstests/xfs/030 +1
-1@@ -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 #tests/xfs/031 +1
-1@@ -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() {tests/xfs/033 +3
-3@@ -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 /'`tests/xfs/033.cfg new file +3
-0@@ -0,0 +1,3 @@ +irix: irix +linux,crc: crc.linux +linux: linuxtests/xfs/033.out.crc.linux renamed from tests/xfs/033.crc.out.linux +0
-0tests/xfs/035 +1
-1@@ -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 xfstests/xfs/036 +1
-1@@ -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 xfstests/xfs/039 +1
-1@@ -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 xfstests/xfs/043 +1
-1@@ -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 xfstests/xfs/055 +1
-1@@ -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 xfstests/xfs/082 +1
-1@@ -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>&1tests/xfs/146 +1
-1@@ -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
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
Maybe it's time to drop IRIX support? I'm pretty sure it hasn't worked for a long time..
Re: [PATCH 2/3] common: Improve _link_output_file to be more versatile
In reply to Jan KaraQuoted 37 lines · Jan Kara
Quoted 36 lines · Ted Tso
Quoted 9 lines · Jan Kara
From: Jan Kara <[email protected]>
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
Quoted 8 lines
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_fileto the new calling convention.Signed-off-by Jan Kara <[email protected]>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:
Quoted 12 lines
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 +
Quoted 7 lines
Quoted 1 line
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.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v2 3/3 ext4/001: Select different output based on mount options
In reply to Jan KaraFrom: Jan Kara <[email protected]>
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.
--- 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
tests/ext4/001 +4 -0
@@ -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
tests/ext4/001.cfg new file +2 -0
@@ -0,0 +1,2 @@ +dax: nozero +dioread_nolock: nozero
tests/ext4/001.out deleted +0 -333
333 lines not on this page · raw message
tests/ext4/001.out.default new file +333 -0
333 lines not on this page · raw message
tests/ext4/001.out.nozero new file +333 -0
333 lines not on this page · raw message
Signature · 1 line
2.1.4
Re: [PATCH 3/3] ext4/001: Select different output based on mount options
Quoted 8 lines · Jan Kara
From: Jan Kara <[email protected]>
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 <[email protected]>
- Ted