From patchwork Fri May 4 00:05:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 10379485 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 3D1B060353 for ; Fri, 4 May 2018 00:06:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2957F292A8 for ; Fri, 4 May 2018 00:06:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DE5A292B0; Fri, 4 May 2018 00:06:12 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 B0D84292A8 for ; Fri, 4 May 2018 00:06:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbeEDAGJ (ORCPT ); Thu, 3 May 2018 20:06:09 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:44233 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbeEDAGG (ORCPT ); Thu, 3 May 2018 20:06:06 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail06.adl6.internode.on.net with ESMTP; 04 May 2018 09:35:11 +0930 Received: from discord.disaster.area ([192.168.1.111]) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1fEODl-000504-FU; Fri, 04 May 2018 10:05:09 +1000 Received: from dave by discord.disaster.area with local (Exim 4.91) (envelope-from ) id 1fEODl-0000ey-D5; Fri, 04 May 2018 10:05:09 +1000 From: Dave Chinner To: fstests@vger.kernel.org Cc: willy@infradead.org Subject: [PATCH] check: run auto test group by default Date: Fri, 4 May 2018 10:05:09 +1000 Message-Id: <20180504000509.2498-1-david@fromorbit.com> X-Mailer: git-send-email 2.17.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Chinner Everyone who starts using fstests runs "check" without parameters, and then has problems with it running dangerous tests. most people just want fstests to act as a regression test suite, not a fuzzer or exercise known crash conditions. Hence make the default behaviour to be "run the auto group" rather than "run every test". To enable people to run all tests easily (if they really want to) add a special group keyword named "all". This wildcard will trigger selecting all the tests in fstests as per the original "check without parameters" behaviour. Signed-Off-By: Dave Chinner Reviewed-by: Eric Sandeen Reviewed-by: Darrick J. Wong --- check | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/check b/check index 84a35e6724ab..170004d4b2a2 100755 --- a/check +++ b/check @@ -102,6 +102,8 @@ a test file name match pattern (e.g. xfs/*). group argument is either a name of a tests group to collect from all the test dirs (e.g. quick) or a name of a tests group to collect from a specific tests dir in the form of / (e.g. xfs/quick). +If you want to run all the tests in teh test suite, use "-g all" to specify all +groups. exclude_file argument refers to a name of a file inside each test directory. for every test dir where this file is found, the listed test names are @@ -220,22 +222,24 @@ _prepare_test_list() fi # Specified groups to include - for group in $GROUP_LIST; do - list=$(get_group_list $group) - if [ -z "$list" ]; then - echo "Group \"$group\" is empty or not defined?" - exit 1 - fi + # Note that the CLI processing adds a leading space to the first group + # parameter, so we have to catch that here checking for "all" + if ! $have_test_arg && [ "$GROUP_LIST" == " all" ]; then + # no test numbers, do everything + get_all_tests + else + for group in $GROUP_LIST; do + list=$(get_group_list $group) + if [ -z "$list" ]; then + echo "Group \"$group\" is empty or not defined?" + exit 1 + fi - for t in $list; do - grep -s "^$t\$" $tmp.list >/dev/null || \ + for t in $list; do + grep -s "^$t\$" $tmp.list >/dev/null || \ echo "$t" >>$tmp.list + done done - done - - if ! $have_test_arg && [ -z "$GROUP_LIST" ]; then - # no test numbers, do everything - get_all_tests fi # Specified groups to exclude @@ -364,6 +368,10 @@ if $have_test_arg; then shift done +elif [ -z "$GROUP_LIST" ]; then + # default group list is the auto group. If any other group or test is + # specified, we use that instead. + GROUP_LIST="auto" fi # we need common/rc