From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85A57C48BE5 for ; Sat, 12 Jun 2021 00:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60175613CC for ; Sat, 12 Jun 2021 00:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbhFLAg6 (ORCPT ); Fri, 11 Jun 2021 20:36:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbhFLAg6 (ORCPT ); Fri, 11 Jun 2021 20:36:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 77510613CA; Sat, 12 Jun 2021 00:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623458099; bh=z+9mgYXnWJMycu1NAUPLasLLXoTogmaSkYWZWM0d0iI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CX4PC9DUYDg5zVX3jWl3MF0Rk+nEoJPv1nrnWhg3rMQlsujWmEuU4n4ZeAeCbRf29 kxk09+LkCYF1b3bQOr1Eq29eUcZ23qZ2P9txw0ECwdE+vF/rnsdh+MufLMQfSmNAii LT+mElkUy0sQ+nwIMORw6svClg7vIJo0Efz75z1NR+8K1iGlu2yExDuLkCekVRsIs2 RkDRVSW4DR0G+htRzla19M4z08goissTm3oCwhtTUjV7qKS6CyLwpU+VOakWDtbf6O abXyYBkob7wmrAsiDOh+8u1aLcfxfkjOYg3WEQ7d4iL/zq2gh+09gJfuL9G+asrc9H 1jSh3W8p0LZ6Q== Date: Fri, 11 Jun 2021 17:34:59 -0700 From: "Darrick J. Wong" To: Eric Biggers Cc: guaneryu@gmail.com, linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, amir73il@gmail.com Subject: Re: [PATCH 05/13] fstests: move test group info to test files Message-ID: <20210612003459.GH2945738@locust> References: <162317276202.653489.13006238543620278716.stgit@locust> <162317278957.653489.1221763643277904130.stgit@locust> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org On Fri, Jun 11, 2021 at 05:17:00PM -0700, Eric Biggers wrote: > On Fri, Jun 11, 2021 at 04:29:30PM -0700, Eric Biggers wrote: > > On Tue, Jun 08, 2021 at 10:19:49AM -0700, Darrick J. Wong wrote: > > > From: Darrick J. Wong > > > > > > Refactor every test in the entire test suite to use the new boilerplate > > > functions. This also migrates all the test group information into the > > > test files. This patch has been autogenerated via the command: > > > > > > ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs > > > > > > NOTE: This patch submission only contains diffs of the first seven btrfs > > > tests because vger rejects 1.5MB patches. The full conversion is in the > > > git branch linked from the cover letter. > > > > > > Signed-off-by: Darrick J. Wong > > [...] > > > diff --git a/tests/btrfs/006 b/tests/btrfs/006 > > > index 67f1fcd8..c0f9541a 100755 > > > --- a/tests/btrfs/006 > > > +++ b/tests/btrfs/006 > > > @@ -7,23 +7,17 @@ > > > # run basic btrfs information commands in various ways > > > # sanity tests: filesystem show, label, sync, and device stats > > > # > > > -seq=`basename $0` > > > -seqres=$RESULT_DIR/$seq > > > -echo "== QA output created by $seq" > > > - > > > -here=`pwd` > > > -tmp=/tmp/$$ > > > -status=1 # failure is the default! > > > -trap "_cleanup; exit \$status" 0 1 2 3 15 > > > +. ./common/preamble > > > +_begin_fstest auto quick volume > > > > > > +# Override the default cleanup function. > > > _cleanup() > > > { > > > cd / > > > rm -f $tmp.* > > > } > > > > A lot of the _cleanup() functions (such as the one above) are identical to the > > one in common/preamble. It might make sense to make tools/convert-group > > recognize these and remove them. > > The following command would remove most of them, including ones that omit the > "cd /" or use "rm -rf" instead of "rm -f": > > sed -z -E -i 's/(#[^#\n]*\n)*_cleanup\(\)\n\{\n(\s+cd \/\n)?\s+rm -r?f "?\$tmp"?\.\*\n\}\n\n?//' tests/*/* > > I'm not sure how far you want to go, though. Ooh nice, I'll incorporate this, thanks! --D > > - Eric