From patchwork Thu Jul 14 12:43:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 9229713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 807F16075D for ; Thu, 14 Jul 2016 12:43:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7127327FA9 for ; Thu, 14 Jul 2016 12:43:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66119281E1; Thu, 14 Jul 2016 12:43:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D20C528236 for ; Thu, 14 Jul 2016 12:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbcGNMnx (ORCPT ); Thu, 14 Jul 2016 08:43:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbcGNMnw (ORCPT ); Thu, 14 Jul 2016 08:43:52 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F52EC02C6BA for ; Thu, 14 Jul 2016 12:43:41 +0000 (UTC) Received: from jtulak.brq.redhat.com (jtulak.brq.redhat.com [10.34.26.85]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6EChc2Q008413; Thu, 14 Jul 2016 08:43:40 -0400 From: Jan Tulak To: fstests@vger.kernel.org Cc: Jan Tulak 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 Message-Id: <1468500214-6237-3-git-send-email-jtulak@redhat.com> In-Reply-To: <1468500214-6237-1-git-send-email-jtulak@redhat.com> References: <1468500214-6237-1-git-send-email-jtulak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 14 Jul 2016 12:43:41 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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