All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Tulak <jtulak@redhat.com>
To: fstests@vger.kernel.org
Cc: Jan Tulak <jtulak@redhat.com>
Subject: [PATCH 2/6] fstests: filename handling for extended names in ./check was on a wrong place
Date: Thu, 14 Jul 2016 14:43:30 +0200	[thread overview]
Message-ID: <1468500214-6237-3-git-send-email-jtulak@redhat.com> (raw)
In-Reply-To: <1468500214-6237-1-git-send-email-jtulak@redhat.com>

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>
---
UPDATE:
Just more explanation in the commit message.

 check | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/check b/check
index 5be183f..ef6bd47 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
-- 
2.5.5


  parent reply	other threads:[~2016-07-14 12:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 12:43 [PATCH 0/6 v3] xfstests: some small fixes and mkfs validation test Jan Tulak
2016-07-14 12:43 ` [PATCH 1/6] xfstests: Fix installation for extended names Jan Tulak
2016-07-14 12:43 ` Jan Tulak [this message]
2016-07-14 12:43 ` [PATCH 3/6] xfstests: remove unused variable Jan Tulak
2016-07-14 12:43 ` [PATCH 4/6] xfstests: add _require_xfs_mkfs_validation to common/rc Jan Tulak
2016-07-14 14:21   ` Eryu Guan
2016-07-14 15:16     ` Jan Tulak
2016-07-14 15:57   ` [PATCH v2] " Jan Tulak
2016-07-14 12:43 ` [PATCH 5/6] xfstests: update xfs/096 for new behaviour Jan Tulak
2016-07-14 12:43 ` [PATCH 6/6] xfstests: Add mkfs input validation tests Jan Tulak
2016-07-16  9:33   ` Eryu Guan
2016-07-17 23:30     ` Dave Chinner
2016-07-18 11:29       ` Jan Tulak
2016-07-18 11:29         ` Jan Tulak
2016-07-18 11:47         ` Eryu Guan
2016-07-18 11:47           ` Eryu Guan
2016-07-18 11:54           ` Jan Tulak
2016-07-18 11:54             ` Jan Tulak
2016-07-18 12:33             ` Jan Tulak
2016-07-18 12:33               ` Jan Tulak
2016-07-20 23:54               ` Dave Chinner
2016-07-20 23:54                 ` Dave Chinner
2016-07-21 14:24                 ` Jan Tulak
2016-07-21 14:24                   ` Jan Tulak
2016-07-21 22:40                   ` Dave Chinner
2016-07-21 22:40                     ` Dave Chinner
2016-07-22 13:08                     ` Jan Tulak
2016-07-22 13:08                       ` Jan Tulak
2016-07-16 10:28 ` [PATCH 0/6 v3] xfstests: some small fixes and mkfs validation test Eryu Guan
2016-07-18  8:47 ` [PATCH v2] xfstests: Fix installation for extended names Jan Tulak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468500214-6237-3-git-send-email-jtulak@redhat.com \
    --to=jtulak@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.