aboutsummaryrefslogtreecommitdiffstats
path: root/check
diff options
context:
space:
mode:
authorJan Tulak <jtulak@redhat.com>2016-07-14 14:43:30 +0200
committerEryu Guan <eguan@redhat.com>2016-07-18 16:55:04 +0800
commit1fd02fd4ceb7ea779e9f42a1251f5e606dd53ab3 (patch)
tree86b43a7aaaa73210a2443894384bd346425b4018 /check
parentcb15a45be8cd278dc2ca3b719b9c2a836a3bfde2 (diff)
downloadxfstests-dev-1fd02fd4ceb7ea779e9f42a1251f5e606dd53ab3.tar.gz
check: fix extended names handling
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 Signed-off-by: Jan Tulak <jtulak@redhat.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Diffstat (limited to 'check')
-rwxr-xr-xcheck27
1 files changed, 14 insertions, 13 deletions
diff --git a/check b/check
index 5be183f008..f6a2c7b472 100755
--- a/check
+++ b/check
@@ -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