diff --git a/common/rc b/common/rc index c2b20da7..5b78b7b8 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 983de983..46ce6ae4 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 00000000..7ffdfc07 --- /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 f097b283..848981f8 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 00000000..7ffdfc07 --- /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 cd9b9ec1..b2b6142c 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 00000000..7ffdfc07 --- /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 120be64e..9a899a86 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 00000000..7ffdfc07 --- /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 a43455f5..d2f5ed19 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 00000000..7ffdfc07 --- /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 48a97e1d..59d68c31 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 00000000..7ffdfc07 --- /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 576d437e..dab111aa 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 00000000..88e90e57 --- /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 70eac93e..25f2f697 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 00000000..7ffdfc07 --- /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 32b8c87c..280d0366 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 00000000..7ffdfc07 --- /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 97479230..2f765b82 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 00000000..7ffdfc07 --- /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 55a52257..59eeff6e 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 00000000..7ffdfc07 --- /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 cc747d30..920ba288 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 fff1d6b4..f1178fdc 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 00000000..7ffdfc07 --- /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 c6343f86..f6cd3f30 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 00000000..7ffdfc07 --- /dev/null +++ b/tests/xfs/146.cfg @@ -0,0 +1,2 @@ +irix: irix +linux: linux