xfstests: extended names fixes
v2 cover xfstests: extended names fixes
Some fixes for extended names in tests (tests/baz/123-foo-bar). This version has more patches than previous, because I split the second patch into three.
Jan Tulak (4):
xfstests: Fix installation for extended names
fstests: filename handling for extended names in ./check was on a
wrong place
xfstests: remove unused variable
xfstests: filename handling - fix early wildcard expansion
check | 26 +++++++++++++------------- include/buildrules | 31 +++++++++++++++++++++++++++++++ tests/btrfs/Makefile | 4 ++-- tests/cifs/Makefile | 4 ++-- tests/ext4/Makefile | 4 ++-- tests/f2fs/Makefile | 4 ++-- tests/generic/Makefile | 4 ++-- tests/overlay/Makefile | 4 ++-- tests/shared/Makefile | 4 ++-- tests/udf/Makefile | 4 ++-- tests/xfs/Makefile | 4 ++-- 11 files changed, 62 insertions(+), 31 deletions(-)
Signature · 1 line
2.5.5
PATCH v2 1/4 xfstests: Fix installation for extended names
xfstests supports extended test names like 314-foo-bar, but installation of these tests was skipped (not matching a regexp). So this patch fixes the makefiles in tests/*/
The include/buildrules change was written by Dave Chinner.
---
UPDATE:
Use Dave's code to at first select all files and then separate output and test files. BTW, in this version, when most of this version is written by Dave, should I add Signed-off-by, or is better to keep it mentioned only in the text?
--- include/buildrules | 31 +++++++++++++++++++++++++++++++ tests/btrfs/Makefile | 4 ++-- tests/cifs/Makefile | 4 ++-- tests/ext4/Makefile | 4 ++-- tests/f2fs/Makefile | 4 ++-- tests/generic/Makefile | 4 ++-- tests/overlay/Makefile | 4 ++-- tests/shared/Makefile | 4 ++-- tests/udf/Makefile | 4 ++-- tests/xfs/Makefile | 4 ++-- 10 files changed, 49 insertions(+), 18 deletions(-)
include/buildrules +31 -0
@@ -100,3 +100,34 @@ MAKEDEP := $(MAKEDEPEND) $(CFLAGS) cp /dev/null .dep; \ fi +# Gather files for installing into two lists: +# TESTS with executable scripts and OUTFILES with all the test outputs. +# Makefile has a very small matching, so we have to go this long way. + +# Start with all test related files: +ALLFILES = $(wildcard [0-9]??*) + +# Now build a list of known output files. Unfortunately, the +# multiple output test files are poorly handled as makefiles don't +# handle wildcarded multi-suffix matching. Hence we separate the +# processing of these right now. +EXTENDED_OUTFILES = $(wildcard [0-9]??*.out.*) +BASIC_OUTFILES = $(wildcard [0-9]??*.out) +OUTFILES = $(EXTENDED_OUTFILES) $(BASIC_OUTFILES) + +# Strip suffix to get matching tests. We want to strip from the +# first "." to the end, but makefiles don't have a built in +# operative for that. So: +# +# Hack: strip the multiple segments after .out with repeated basename calls. +EXTFILTER1 = $(basename $(EXTENDED_OUTFILES)) +EXTFILTER2 = $(basename $(EXTFILTER1)) +EXTFILTER3 = $(basename $(EXTFILTER2)) +EXTFILTER4 = $(basename $(EXTFILTER3)) + +# final filter list +FILTER = $(basename $(EXTFILTER4) $(BASIC_OUTFILES)) + +# finally, select the test files by filtering against against the +# stripped output files and sort them to remove duplicates. +TESTS = $(sort $(filter $(ALLFILES), $(FILTER)))
tests/btrfs/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/cifs/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/ext4/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/f2fs/Makefile +2 -2
@@ -13,9 +13,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/generic/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/overlay/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/shared/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/udf/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
tests/xfs/Makefile +2 -2
@@ -12,9 +12,9 @@ include $(BUILDRULES) install: $(INSTALL) -m 755 -d $(TARGET_DIR) - $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) $(INSTALL) -m 644 group $(TARGET_DIR) - $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) # Nothing. install-dev install-lib:
Signature · 1 line
2.5.5
PATCH v2 2/4 fstests: filename handling for extended names in ./check was on a wrong place
In reply to Jan TulakThe code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved at the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
--- check | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
check +14 -13
@@ -543,6 +543,20 @@ for section in $HOST_OPTIONS_SECTIONS; do for seq in $list do err=false + if [ ! -f $seq ]; then + # Try to get full name in case the user supplied only seq id + # and the test has a name. A bit of hassle to find really + # the test and not its sample output or helping files. + bname=$(basename $seq) + full_seq=$(find $(dirname $seq) -name $bname* -executable | + awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ + END { print shortest }') + if [ -f $full_seq ] \ + && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then + seq=$full_seq + seqnum=${full_seq#*/} + fi + fi # the filename for the test and the name output are different. # we don't include the tests/ directory in the name output.
@@ -566,19 +580,6 @@ for section in $HOST_OPTIONS_SECTIONS; do if $showme; then echo continue - elif [ ! -f $seq ]; then - # Try to get full name in case the user supplied only seq id - # and the test has a name. A bit of hassle to find really - # the test and not its sample output or helping files. - bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | - awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ - END { print shortest }') - if [ -f $full_seq ] \ - && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then - seq=$full_seq - seqnum=${full_seq#*/} - fi fi if [ ! -f $seq ]; then
Signature · 1 line
2.5.5
PATCH v2 3/4 xfstests: remove unused variable
In reply to Jan TulakAfter the previous patch moved few lines of code, one seqnum assignment is now immediately overwritten by another. Remove the useless one.
--- check | 1 - 1 file changed, 1 deletion(-)
check +0 -1
@@ -554,7 +554,6 @@ for section in $HOST_OPTIONS_SECTIONS; do if [ -f $full_seq ] \ && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then seq=$full_seq - seqnum=${full_seq#*/} fi fi
Signature · 1 line
2.5.5
PATCH v2 4/4 xfstests: filename handling - fix early wildcard expansion
In reply to Jan TulakAdd quotation marks around the wildcarded name.
--- check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
check +1 -1
@@ -548,7 +548,7 @@ for section in $HOST_OPTIONS_SECTIONS; do # and the test has a name. A bit of hassle to find really # the test and not its sample output or helping files. bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | + full_seq=$(find $(dirname $seq) -name "$bname*" -executable | awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ END { print shortest }') if [ -f $full_seq ] \
Signature · 1 line
2.5.5
Re: [PATCH 4/4] xfstests: filename handling - fix early wildcard expansion
Quoted 1 line · Jan Tulak
Add quotation marks around the wildcarded name.
This makes no difference for me, the original code is working well. Did I miss anything?
[root@dhcp-66-86-11 xfstests]# bname=999 [root@dhcp-66-86-11 xfstests]# find tests/xfs -name "$bname*" tests/xfs/999-test-case
tests/xfs/999-test-case.out
[root@dhcp-66-86-11 xfstests]# find tests/xfs -name $bname* tests/xfs/999-test-case
tests/xfs/999-test-case.out
Thanks,
Eryu
Quoted 22 lines
Signed-off-by Jan Tulak <[email protected]>--- check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)check +1
-1@@ -548,7 +548,7 @@ for section in $HOST_OPTIONS_SECTIONS; do # and the test has a name. A bit of hassle to find really # the test and not its sample output or helping files. bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | + full_seq=$(find $(dirname $seq) -name "$bname*" -executable | awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ END { print shortest }') if [ -f $full_seq ] \Signature · 1 line
2.5.5
Re: [PATCH 2/4] fstests: filename handling for extended names in ./check was on a wrong place
In reply to Jan TulakQuoted 5 lines · Jan Tulak
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved at the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
Signed-off-by Jan Tulak <[email protected]>
Can you please include more details in the description? It seems not so clear to me what the problem is from the description.
If I understand it correctly (after playing around), prior to the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 tests
After applying the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999-test-case 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 tests
So the test name is always correct, right?
Thanks,
Eryu
Quoted 52 lines
--- check | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)check +14
-13@@ -543,6 +543,20 @@ for section in $HOST_OPTIONS_SECTIONS; do for seq in $list do err=false + if [ ! -f $seq ]; then + # Try to get full name in case the user supplied only seq id + # and the test has a name. A bit of hassle to find really + # the test and not its sample output or helping files. + bname=$(basename $seq) + full_seq=$(find $(dirname $seq) -name $bname* -executable | + awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ + END { print shortest }') + if [ -f $full_seq ] \ + && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then + seq=$full_seq + seqnum=${full_seq#*/} + fi + fi # the filename for the test and the name output are different. # we don't include the tests/ directory in the name output.@@ -566,19 +580,6 @@ for section in $HOST_OPTIONS_SECTIONS; do if $showme; then echo continue - elif [ ! -f $seq ]; then - # Try to get full name in case the user supplied only seq id - # and the test has a name. A bit of hassle to find really - # the test and not its sample output or helping files. - bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | - awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ - END { print shortest }') - if [ -f $full_seq ] \ - && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then - seq=$full_seq - seqnum=${full_seq#*/} - fi fi if [ ! -f $seq ]; thenSignature · 1 line
2.5.5
Re: [PATCH 4/4] xfstests: filename handling - fix early wildcard expansion
In reply to Eryu GuanQuoted 6 lines · Eryu Guan
Quoted 1 line · Jan Tulak
Add quotation marks around the wildcarded name.
This makes no difference for me, the original code is working well. Did I miss anything?
Quoted 8 lines
[root@dhcp-66-86-11 xfstests]# bname=999 [root@dhcp-66-86-11 xfstests]# find tests/xfs -name "$bname*" tests/xfs/999-test-case
tests/xfs/999-test-case.out
[root@dhcp-66-86-11 xfstests]# find tests/xfs -name $bname* tests/xfs/999-test-case
tests/xfs/999-test-case.out
Hmmm. The move of the code alone was not enough to fix an issue I had, but now I can't remember when it happened, no matter what. :( I'm beginning to think I might forget to save the file after moving the code. In which case...
So either drop it and if it appears again, then I will resubmit, or keep it there "just to be sure". I'm OK with both these options, so whatever is more in line with your idea of a clean repo. :-)
Thanks,
Jan
Quoted 25 lines
Thanks,
EryuQuoted 22 lines
Signed-off-by Jan Tulak <[email protected]>--- check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)check +1
-2@@ -548,7 +548,7 @@ for section in $HOST_OPTIONS_SECTIONS; do # and the test has a name. A bit of hassle to find really # the test and not its sample output or helping files. bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | + full_seq=$(find $(dirname $seq) -name "$bname*" -executable | awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ END { print shortest }') if [ -f $full_seq ] \ --2.5.5
Signature · 2 lines
Jan Tulak [email protected] / [email protected]
Re: [PATCH 2/4] fstests: filename handling for extended names in ./check was on a wrong place
In reply to Eryu GuanQuoted 17 lines · Eryu Guan
Quoted 5 lines · Jan Tulak
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved at the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
Signed-off-by Jan Tulak <[email protected]>Can you please include more details in the description? It seems not so clear to me what the problem is from the description.
If I understand it correctly (after playing around), prior to the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 tests
Quoted 9 lines
After applying the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999-test-case 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 testsSo the test name is always correct, right?
Yes. Most importantly, this fixes issues around other name-based operations, see the new message:
---
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved to the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
An example of this issue is $testname.notrun file. When _notrun "foo" was run during ./check foo/$name command, it created $name.notrun. But few lines later, it wanted $fullname.notrun. So if you did ./check foo/999, but the file was 999-bar-baz, then you got comparing outputs (and most likely a fail) instead of a skip.
Another example of this mix is in xfstests output:
./check xfs/999
[...]
xfs/999 0s ... 0s
Ran: xfs/999-test-case
---
Do you like it now? And do want it as a new version of the patch? :-)
Cheers,
Jan
Quoted 55 lines
Thanks,
EryuQuoted 52 lines
--- check | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)check +14
-14@@ -543,6 +543,20 @@ for section in $HOST_OPTIONS_SECTIONS; do for seq in $list do err=false + if [ ! -f $seq ]; then + # Try to get full name in case the user supplied only seq id + # and the test has a name. A bit of hassle to find really + # the test and not its sample output or helping files. + bname=$(basename $seq) + full_seq=$(find $(dirname $seq) -name $bname* -executable | + awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ + END { print shortest }') + if [ -f $full_seq ] \ + && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then + seq=$full_seq + seqnum=${full_seq#*/} + fi + fi # the filename for the test and the name output are different. # we don't include the tests/ directory in the name output.@@ -566,19 +580,6 @@ for section in $HOST_OPTIONS_SECTIONS; do if $showme; then echo continue - elif [ ! -f $seq ]; then - # Try to get full name in case the user supplied only seq id - # and the test has a name. A bit of hassle to find really - # the test and not its sample output or helping files. - bname=$(basename $seq) - full_seq=$(find $(dirname $seq) -name $bname* -executable | - awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\ - END { print shortest }') - if [ -f $full_seq ] \ - && [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then - seq=$full_seq - seqnum=${full_seq#*/} - fi fi if [ ! -f $seq ]; then --2.5.5
Signature · 2 lines
Jan Tulak [email protected] / [email protected]
Re: [PATCH 4/4] xfstests: filename handling - fix early wildcard expansion
In reply to Jan TulakQuoted 16 lines · Jan Tulak
Quoted 6 lines · Eryu Guan
Quoted 1 line · Jan Tulak
Add quotation marks around the wildcarded name.
This makes no difference for me, the original code is working well. Did I miss anything?
Quoted 8 lines
[root@dhcp-66-86-11 xfstests]# bname=999 [root@dhcp-66-86-11 xfstests]# find tests/xfs -name "$bname*" tests/xfs/999-test-case
tests/xfs/999-test-case.out
[root@dhcp-66-86-11 xfstests]# find tests/xfs -name $bname* tests/xfs/999-test-case
tests/xfs/999-test-case.out
Quoted 8 lines
Hmmm. The move of the code alone was not enough to fix an issue I had, but now I can't remember when it happened, no matter what. :( I'm beginning to think I might forget to save the file after moving the code. In which case...
So either drop it and if it appears again, then I will resubmit, or keep it there "just to be sure". I'm OK with both these options, so whatever is more in line with your idea of a clean repo. :-)
I'd prefer to drop it for now, and fix it when we know what the exact issue is :)
Thanks,
Eryu
Re: [PATCH 2/4] fstests: filename handling for extended names in ./check was on a wrong place
In reply to Jan TulakQuoted 41 lines · Jan Tulak
Quoted 17 lines · Eryu Guan
Quoted 5 lines · Jan Tulak
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved at the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
Signed-off-by Jan Tulak <[email protected]>Can you please include more details in the description? It seems not so clear to me what the problem is from the description.
If I understand it correctly (after playing around), prior to the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 testsQuoted 9 lines
After applying the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999-test-case 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 testsSo the test name is always correct, right?
Yes. Most importantly, this fixes issues around other name-based operations, see the new message:
---
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved to the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.An example of this issue is $testname.notrun file. When
_notrun"foo" was run during ./check foo/$name command, it created $name.notrun. But few lines later, it wanted $fullname.notrun. So if you did ./check foo/999, but the file was 999-bar-baz, then you got comparing outputs (and most likely a fail) instead of a skip.
Quoted 8 lines
Another example of this mix is in xfstests output:
./check xfs/999
[...]
xfs/999 0s ... 0s
Ran: xfs/999-test-case
---Do you like it now? And do want it as a new version of the patch? :-)
This does read better to me, thanks! And seems you're going to send a new patchset, then please send a new version with updated description.
Thanks!
Eryu
Re: [PATCH 2/4] fstests: filename handling for extended names in ./check was on a wrong place
Quoted 49 lines · Eryu Guan
Quoted 48 lines · Jan Tulak
Quoted 17 lines · Eryu Guan
Quoted 5 lines · Jan Tulak
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved at the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.
Signed-off-by Jan Tulak <[email protected]>Can you please include more details in the description? It seems not so clear to me what the problem is from the description.
If I understand it correctly (after playing around), prior to the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 testsQuoted 9 lines
After applying the patch:
[root@dhcp-66-86-11 xfstests]# ./check xfs/999
...
xfs/999-test-case 0s ... 0s
Ran: xfs/999-test-case
Passed all 1 testsSo the test name is always correct, right?
Yes. Most importantly, this fixes issues around other name-based operations, see the new message:
---
The code handling "./check foo/123", when the real test is "foo/123-bar-baz" was moved to the earliest position, so everything working with the test name or path will know the full name. Thus, no "123" and "123-bar-baz" mix is possible.An example of this issue is $testname.notrun file. When
_notrun"foo" was run during ./check foo/$name command, it created $name.notrun. But few lines later, it wanted $fullname.notrun. So if you did ./check foo/999, but the file was 999-bar-baz, then you got comparing outputs (and most likely a fail) instead of a skip.Another example of this mix is in xfstests output:
./check xfs/999
[...]
xfs/999 0s ... 0s
Ran: xfs/999-test-case
---
Quoted 5 lines
Quoted 1 line
Do you like it now? And do want it as a new version of the patch? :-)
This does read better to me, thanks! And seems you're going to send a new patchset, then please send a new version with updated description.
New version submitted with updated description.
Thanks,
Jan
Signature · 2 lines
Jan Tulak [email protected] / [email protected]
Re: [PATCH 1/4] xfstests: Fix installation for extended names
In reply to Jan TulakQuoted 36 lines · Jan Tulak
xfstests supports extended test names like 314-foo-bar, but installation of these tests was skipped (not matching a regexp). So this patch fixes the makefiles in tests/*/
The
include/buildruleschange was written by Dave Chinner.Signed-off-by Jan Tulak <[email protected]>---
UPDATE:
Use Dave's code to at first select all files and then separate output and test files. BTW, in this version, when most of this version is written by Dave, should I add Signed-off-by, or is better to keep it mentioned only in the text?--- include/buildrules | 31 +++++++++++++++++++++++++++++++ tests/btrfs/Makefile | 4 ++-- tests/cifs/Makefile | 4 ++-- tests/ext4/Makefile | 4 ++-- tests/f2fs/Makefile | 4 ++-- tests/generic/Makefile | 4 ++-- tests/overlay/Makefile | 4 ++-- tests/shared/Makefile | 4 ++-- tests/udf/Makefile | 4 ++-- tests/xfs/Makefile | 4 ++-- 10 files changed, 49 insertions(+), 18 deletions(-)include/buildrules +3
-0@@ -100,3 +100,34 @@ MAKEDEP := $(MAKEDEPEND) $(CFLAGS) cp /dev/null .dep; \ fi +# Gather files for installing into two lists: +# TESTS with executable scripts and OUTFILES with all the test outputs. +# Makefile has a very small matching, so we have to go this long way.
include/buildrules MAKEDEP := $(MAKEDEPEND) $(CFLAGS) · line 115
Quoted 10 lines
include/buildrules +10
-0+ +# Start with all test related files: +ALLFILES = $(wildcard [0-9]??*) + +# Now build a list of known output files. Unfortunately, the +# multiple output test files are poorly handled as makefiles don't +# handle wildcarded multi-suffix matching. Hence we separate the +# processing of these right now. +EXTENDED_OUTFILES = $(wildcard [0-9]??*.out.*) +BASIC_OUTFILES = $(wildcard [0-9]??*.out)
This turns out to be not sufficient, [0-9]??.cfg files are missed, so tests like ext4/001 and generic/088 fail due to "no qualified output", because _link_out_file() failed to work correctly without these *.cfg files.
Adding another wildcard to match cfg files works for me. e.g.
EXTENDED_OUTFILE_CFGS = $(wildcard [0-9]??.cfg)
then update OUTFILES accordingly
include/buildrules MAKEDEP := $(MAKEDEPEND) $(CFLAGS) · line 116
Quoted 1 line
include/buildrules +1
-0+OUTFILES = $(EXTENDED_OUTFILES) $(BASIC_OUTFILES)
OUTFILES = $(EXTENDED_OUTFILES) $(EXTENDED_OUTFILE_CFGS) $(BASIC_OUTFILES)
Can you please send an updated version of this patch?
Thanks,
Eryu