From patchwork Fri Dec 9 08:50:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9467693 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 77830607EE for ; Fri, 9 Dec 2016 08:51:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DD95284A3 for ; Fri, 9 Dec 2016 08:51:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 629A8285E1; Fri, 9 Dec 2016 08:51:11 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 E4317285ED for ; Fri, 9 Dec 2016 08:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932930AbcLIIvJ (ORCPT ); Fri, 9 Dec 2016 03:51:09 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35178 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932495AbcLIIvH (ORCPT ); Fri, 9 Dec 2016 03:51:07 -0500 Received: by mail-wm0-f67.google.com with SMTP id a20so2526385wme.2 for ; Fri, 09 Dec 2016 00:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9S8BIqh5iod/5DB644DFd5IP/m6vBfj9vAC7gKj16uQ=; b=rtFqYwASg3MCY72fd9sVpJ/qyj3ecH2bjTJsSlPXQJYATVanMmEfeaaDkbYKri7XAg 5JTtlxSmFbIf2taqV1kaRzRkGLIPYIMhkDTfrIuKGb5unm/Mj6v6L7/vOE7HbCGMuqah ycImT2iDPe97/9o/NWlCpEpI+QckUinjgUo2v12RFHi9I35l7vSB3ydAxQjEc8Yi81ry Rg6l7YWpdhuPzUdo+EagX5S2fJusSs1lSE7+Hl8Q/bMdzObDjypT31pzL3b24AfWUQ96 anSkW90jm9ximjxHntLry9OP03Fp7/uCgkTE/du5CfydkCEL7bZy/C22gL8TZZwmBeQx QMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9S8BIqh5iod/5DB644DFd5IP/m6vBfj9vAC7gKj16uQ=; b=GExvYVK1OMA7alhwg71jhYf+B/c5jHekaVE8McSvys9q+HOvf44/HVQoWkYgQAHvYU 0OHVVhm7jTsHdOoejQ9ao6dXXC4f43UJdK5CJjF6YIyyC9MWnlsKGsx/GQ134U4IBMyk plpiVNHuKOOVjQA85bfa8k9IGNhFHy5bpIPveFbir8LnVOgHZsQO6aRcWqLABPOfNesh iIUkCDp29zjNntchO3ct3EtFm+8DJf+7PA6qNW+Yb3cJ+ac+7VqkUF2o0oDIpnV5X611 uX2QD5X8gq8b/C178SA6ynCnWSLx6On2uArRPfRVWGWe/N8MQypwXbVkBtN9kUDqHN9m kovw== X-Gm-Message-State: AKaTC03MPsCpSVuqMuDYXRpBkow0tTwGtDxKOp8fWauQhSE5pFAdC8cgpcMDSSVMQX350w== X-Received: by 10.28.170.134 with SMTP id t128mr5421080wme.29.1481273466472; Fri, 09 Dec 2016 00:51:06 -0800 (PST) Received: from amir-VirtualBox.Home (bzq-109-65-102-174.red.bezeqint.net. [109.65.102.174]) by smtp.gmail.com with ESMTPSA id d184sm19466898wmd.8.2016.12.09.00.51.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Dec 2016 00:51:05 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Dave Chinner , fstests@vger.kernel.org Subject: [PATCH v2] common: fix excluding test groups Date: Fri, 9 Dec 2016 10:50:46 +0200 Message-Id: <1481273446-32502-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The -x flag is used to exclude tests that belong to certain groups from the test args list. When the test args list is expressed as a match pattern, -x fails to exclude the tests that match the pattern and belong to excluded groups. For example: $ ./check -n xfs/??? | wc -l 341 $ ./check -n -x fuzzers,dangerous_fuzzers xfs/??? | wc -l 341 After the fix: $ ./check -n -x fuzzers,dangerous_fuzzers xfs/??? | wc -l 315 This bug seems to date back to this git repo epoc. The fix also sorts out filtering of test that are not found in group files for the patten match input. For example: $ ./check xfs/001* ... xfs/001 2s xfs/001.out [failed, exit status 127] - no qualified output After the fix: $ ./check -n xfs/001* xfs/001.out - unknown test, ignored ... xfs/001 2s Signed-off-by: Amir Goldstein --- check | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) v2: - Expand test match pattern when processing arglist v1: - Expand test match pattern before excluding groups diff --git a/check b/check index 8f2a1bb..1d08718 100755 --- a/check +++ b/check @@ -281,18 +281,24 @@ if $have_test_arg; then status=1 exit $status ;; - *) test_dir=`dirname $1` - test_dir=${test_dir#$SRC_DIR/*} - test_name=`basename $1` - group_file=$SRC_DIR/$test_dir/group - - if egrep "^$test_name" $group_file >/dev/null ; then - # in group file ... OK - echo $SRC_DIR/$test_dir/$test_name >>$tmp.arglist - else - # oops - echo "$1 - unknown test, ignored" - fi + *) # Expand test pattern (e.g. xfs/???, *fs/001) + list=$(cd $SRC_DIR; echo $1) + for t in $list; do + test_dir=`dirname $t` + test_dir=${test_dir#$SRC_DIR/*} + test_name=`basename $t` + group_file=$SRC_DIR/$test_dir/group + + if egrep "^$test_name" $group_file >/dev/null + then + # in group file ... OK + echo $SRC_DIR/$test_dir/$test_name \ + >>$tmp.arglist + else + # oops + echo "$t - unknown test, ignored" + fi + done ;; esac