From patchwork Mon Jul 11 09:26:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 9223089 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 0F8EE604DB for ; Mon, 11 Jul 2016 09:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F21D426E8A for ; Mon, 11 Jul 2016 09:26:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E53872793D; Mon, 11 Jul 2016 09:26:19 +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 93F9D26E8A for ; Mon, 11 Jul 2016 09:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758154AbcGKJ0T (ORCPT ); Mon, 11 Jul 2016 05:26:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47386 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbcGKJ0S (ORCPT ); Mon, 11 Jul 2016 05:26:18 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 74FA73F72C; Mon, 11 Jul 2016 09:26:18 +0000 (UTC) Received: from jtulak.brq.redhat.com (jtulak.brq.redhat.com [10.34.26.85]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6B9QDO1019815; Mon, 11 Jul 2016 05:26:16 -0400 From: Jan Tulak To: fstests@vger.kernel.org Cc: david@fromorbit.com, eguan@redhat.com, Jan Tulak Subject: [PATCH 2/4] fstests: filename handling for extended names in ./check was on a wrong place Date: Mon, 11 Jul 2016 11:26:07 +0200 Message-Id: <1468229169-24045-3-git-send-email-jtulak@redhat.com> In-Reply-To: <1468229169-24045-1-git-send-email-jtulak@redhat.com> References: <1468229169-24045-1-git-send-email-jtulak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 11 Jul 2016 09:26:18 +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 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 --- 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