From patchwork Wed Feb 10 02:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079667 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.6 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=ham 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 E6BD4C433E9 for ; Wed, 10 Feb 2021 02:57:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2DFF64E53 for ; Wed, 10 Feb 2021 02:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233350AbhBJC5G (ORCPT ); Tue, 9 Feb 2021 21:57:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:41450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhBJC5G (ORCPT ); Tue, 9 Feb 2021 21:57:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9795E64E50; Wed, 10 Feb 2021 02:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925785; bh=Mt+wfWHPNvz0RPytu9MZYRqFwIJ8VG1vCjg4GS/+4ec=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=AapKa6Mm9c9++ch8rh05WqmIMvnZRTnbiysvMtqWZ6j4bXwlbA0QzQjGc/6tIIIbz IrdJepiZFRVZK9OD19lcbeFX6xvoBNBqRBbqjYYK9AZdRBMj90OS1t6xIq1W4YsRNU nSzREPklIWJuPNk8T7w3fKFA5x3mR5gQGHlgBCScP+HdxqzcHCaPT6Wmb/B/60QzGg bMsG4CEHiwzP5cUNC5R7KWeElgXwmYOOwWDUJnnz+PqMuBKUHu7CDcROJKZ33xL3uy cPM4HEnMvZnSxuVmK9wSZm3qU5r3sFX5omalxQpdAc6F5acoWcLN5Uqb/YrXelbotz TVKrcIutf16Hw== Subject: [PATCH 1/6] config: wrap xfs_metadump as $XFS_METADUMP_PROG like the other tools From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:25 -0800 Message-ID: <161292578528.3504537.14906312392933175461.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong When we set up a fstests run, preserve the path xfs_metadump binary with an $XFS_METADUMP_PROG wrapper, like we do for the other xfsprogs tools. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- common/config | 1 + common/rc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/config b/common/config index d83dfb28..d4cf8089 100644 --- a/common/config +++ b/common/config @@ -156,6 +156,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f" export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)" export XFS_REPAIR_PROG="$(type -P xfs_repair)" export XFS_DB_PROG="$(type -P xfs_db)" +export XFS_METADUMP_PROG="$(type -P xfs_metadump)" export XFS_ADMIN_PROG="$(type -P xfs_admin)" export XFS_GROWFS_PROG=$(type -P xfs_growfs) export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)" diff --git a/common/rc b/common/rc index 649b1cfd..ad54b3de 100644 --- a/common/rc +++ b/common/rc @@ -509,7 +509,7 @@ _scratch_metadump() [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ options="-l $SCRATCH_LOGDEV" - xfs_metadump $options "$@" $SCRATCH_DEV $dumpfile + $XFS_METADUMP_PROG $options "$@" $SCRATCH_DEV $dumpfile } _setup_large_ext4_fs() From patchwork Wed Feb 10 02:56:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079669 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.6 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,URIBL_BLOCKED autolearn=ham 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 37D1CC43381 for ; Wed, 10 Feb 2021 02:57:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AC5D64E6C for ; Wed, 10 Feb 2021 02:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbhBJC5M (ORCPT ); Tue, 9 Feb 2021 21:57:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:41474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhBJC5M (ORCPT ); Tue, 9 Feb 2021 21:57:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42FD664E53; Wed, 10 Feb 2021 02:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925791; bh=9rK37SCHWoZMw/WASHAYk0IjcDG0QLe4uPhRZsxhAaY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XiDApiD2/l+RASYs03cHj9Sfw5O81o00FtAo+aVOBD5HzYkww1i1xOW3eAKPolBVX UCitH/r4CLUBZb6NXWL3XYQMPg0PBK0VCa3u6oHmTYds7S1bnqwWN0gwxuDCTlvXju hF4QCOgAnZ1pi/PYRyQ8ynMExi9fGE6QB5kFAuh61xKAa3dHpPhXprHZjtf2sQ0Y1i f9/VRcNx6wIDFPtZnuFFlZQ5lfbLxNrXblAjgxtTgTeI18yeRXTgY7YkiB5HOu2/6I 7q8RMjhApOxZbqfww+Hmg3ihNZ2PKw4g1mUOh9g/9UqBP0syNVLXSUeH9TXReRguOb RDF0vfA8H1wBg== Subject: [PATCH 2/6] common: capture metadump output if xfs filesystem check fails From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:30 -0800 Message-ID: <161292579087.3504537.10519481439481869013.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Capture metadump output when various userspace repair and checker tools fail or indicate corruption, to aid in debugging. We don't bother to annotate xfs_check because it's bitrotting. Signed-off-by: Darrick J. Wong --- README | 2 ++ common/xfs | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/README b/README index 43bb0cee..36f72088 100644 --- a/README +++ b/README @@ -109,6 +109,8 @@ Preparing system for tests: - Set TEST_FS_MODULE_RELOAD=1 to unload the module and reload it between test invocations. This assumes that the name of the module is the same as FSTYP. + - Set SNAPSHOT_CORRUPT_XFS=1 to record compressed metadumps of XFS + filesystems if the various stages of _check_xfs_filesystem fail. - or add a case to the switch in common/config assigning these variables based on the hostname of your test diff --git a/common/xfs b/common/xfs index 2156749d..ad1eb6ee 100644 --- a/common/xfs +++ b/common/xfs @@ -432,6 +432,21 @@ _supports_xfs_scrub() return 0 } +# Save a compressed snapshot of a corrupt xfs filesystem for later debugging. +_snapshot_xfs() { + local metadump="$1" + local device="$2" + local logdev="$3" + local options="-a -o" + + if [ "$logdev" != "none" ]; then + options="$options -l $logdev" + fi + + $XFS_METADUMP_PROG $options "$device" "$metadump" >> "$seqres.full" 2>&1 + gzip -f "$metadump" >> "$seqres.full" 2>&1 & +} + # run xfs_check and friends on a FS. _check_xfs_filesystem() { @@ -482,6 +497,9 @@ _check_xfs_filesystem() # mounted ... mountpoint=`_umount_or_remount_ro $device` fi + if [ "$ok" -ne 1 ] && [ "$SNAPSHOT_CORRUPT_XFS" = "1" ]; then + _snapshot_xfs "$seqres.scrub.md" "$device" "$2" + fi $XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \ | tee $tmp.logprint | grep -q "" @@ -491,6 +509,8 @@ _check_xfs_filesystem() cat $tmp.logprint >>$seqres.full echo "*** end xfs_logprint output" >>$seqres.full + test "$SNAPSHOT_CORRUPT_XFS" = "1" && \ + _snapshot_xfs "$seqres.logprint.md" "$device" "$2" ok=0 fi @@ -516,6 +536,8 @@ _check_xfs_filesystem() cat $tmp.repair >>$seqres.full echo "*** end xfs_repair output" >>$seqres.full + test "$SNAPSHOT_CORRUPT_XFS" = "1" && \ + _snapshot_xfs "$seqres.repair.md" "$device" "$2" ok=0 fi rm -f $tmp.fs_check $tmp.logprint $tmp.repair @@ -529,6 +551,8 @@ _check_xfs_filesystem() cat $tmp.repair >>$seqres.full echo "*** end xfs_repair output" >>$seqres.full + test "$SNAPSHOT_CORRUPT_XFS" = "1" && \ + _snapshot_xfs "$seqres.rebuild.md" "$device" "$2" ok=0 fi rm -f $tmp.repair @@ -540,6 +564,8 @@ _check_xfs_filesystem() cat $tmp.repair >>$seqres.full echo "*** end xfs_repair output" >>$seqres.full + test "$SNAPSHOT_CORRUPT_XFS" = "1" && \ + _snapshot_xfs "$seqres.rebuildrepair.md" "$device" "$2" ok=0 fi rm -f $tmp.repair From patchwork Wed Feb 10 02:56:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079671 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.6 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=ham 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 02366C4332D for ; Wed, 10 Feb 2021 02:57:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C26A864E54 for ; Wed, 10 Feb 2021 02:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232991AbhBJC5S (ORCPT ); Tue, 9 Feb 2021 21:57:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:41492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhBJC5R (ORCPT ); Tue, 9 Feb 2021 21:57:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4B3D64E54; Wed, 10 Feb 2021 02:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925797; bh=AaVPoVeDsBlYC3J3v9d2DT6H+ZioUCv66BBxdeVIgpE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=TnR0mgerm9lAY83s/zLh0lDQMBTelPIBvYGMOdzMNGefdOeWLXkaIjz6Qll7rf+hh 5/nGxOAsb2utVVIsCWeBnf60gXuf6f59H9XF8ldWPr8ZuiVmx8tDBLpgfZ5mlpldjp NXNu+5bFRg4AWAS6etO9kJpHh6G7mzkCmfWotNMcwseRowN+s7wqR7WberRhqNy7h+ rqMixGpfwYI6VI6STQwJflJoaDRnUhkTLvEwtD3DEobPfIJYftrMfrFjkECiVC9POl XLoQ8/E15UAdWxinq9b+g1jUb71I1FEZe4C9p+jF/R8FeMVCrMTf8yaAcew/lNdJRn GClB0MP3gCsJQ== Subject: [PATCH 3/6] check: allow '-e testid' to exclude a single test From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:36 -0800 Message-ID: <161292579650.3504537.2704583548318437413.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This enables us to mask off specific tests. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- check | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check b/check index c6ad1d6c..e51cbede 100755 --- a/check +++ b/check @@ -79,6 +79,7 @@ testlist options -g group[,group...] include tests from these groups -x group[,group...] exclude tests from these groups -X exclude_file exclude individual tests + -e testlist exclude a specific list of tests -E external_file exclude individual tests [testlist] include tests matching names in testlist @@ -287,6 +288,11 @@ while [ $# -gt 0 ]; do -X) subdir_xfile=$2; shift ; ;; + -e) + xfile=$2; shift ; + echo "$xfile" | tr ', ' '\n\n' >> $tmp.xlist + ;; + -E) xfile=$2; shift ; if [ -f $xfile ]; then sed "s/#.*$//" "$xfile" >> $tmp.xlist From patchwork Wed Feb 10 02:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079673 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.6 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=ham 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 E779EC433E6 for ; Wed, 10 Feb 2021 02:57:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAA3564E66 for ; Wed, 10 Feb 2021 02:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233530AbhBJC5X (ORCPT ); Tue, 9 Feb 2021 21:57:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:41516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhBJC5W (ORCPT ); Tue, 9 Feb 2021 21:57:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F41C64D79; Wed, 10 Feb 2021 02:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925802; bh=XLgScXNNZg6BxJGZJhb/Hl+Xc6XS7HIqSnCPMJsZQwk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ESu3S3uVteNSqwG/7Mt41a/p2cejxL034wFGfRBuRO5QyjFK8CgsGQtYIdEY8FdMe MoEg0hemIuJMwydl3MCahVnDu2U0CTWLOj25Tpv40LmmM+5+n6SOMsx1K7vCzA7DV0 giEhRRZJqnJ2lPkictLbcNX0KHV3V80bz1iR0+6epog1tGg6WBk6eNRLIYmkU8+Qie d6tFlY4n0O1eBdKBXa4S8aF2WBZeuLLCMj0sLSboV/vKltSHOkn/y0KRC6AE3Q3xXU qXVTWUaodxMHmSH/RkrPs4iQtMKUaiVXmWI9MY2XHa65j20JlLTawrCNJ2IIIukXBW yVSUdVhOCseZQ== Subject: [PATCH 4/6] check: don't abort on non-existent excluded groups From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:42 -0800 Message-ID: <161292580215.3504537.12419725496679954055.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Don't abort the whole test run if we asked to exclude groups that aren't included in the candidate group list, since we actually /are/ satisfying the user's request. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check b/check index e51cbede..6f8db858 100755 --- a/check +++ b/check @@ -243,7 +243,7 @@ _prepare_test_list() list=$(get_group_list $xgroup) if [ -z "$list" ]; then echo "Group \"$xgroup\" is empty or not defined?" - exit 1 + continue fi trim_test_list $list From patchwork Wed Feb 10 02:56:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079675 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.6 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 545C6C433DB for ; Wed, 10 Feb 2021 02:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DA2F64E53 for ; Wed, 10 Feb 2021 02:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233600AbhBJC5l (ORCPT ); Tue, 9 Feb 2021 21:57:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:41580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhBJC5l (ORCPT ); Tue, 9 Feb 2021 21:57:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 178FF64E57; Wed, 10 Feb 2021 02:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925808; bh=mKLdF+O/j+lZIRBYEjFisyQ5SZBwAAOF9OS7bORd83w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=W4ELMoV3rQPRqWolYHpNiCKmQB5KbGc9tidvVa9kZ1l2/3rINlmg1pN5ZSu4v49Kq oo+7hS1Wwod/fz+aa+PVjgEfkzvdg0HgYW5luC3sPtBMJ6RuLkGK8/Syw6UZBnEESV ASrwgqnvpSUwyLcausQG0Z9KtD7MHoHheXp4i9ooxA4agvTkOOAN93/C/+Rdu+4aku ZzimA2e9gFZLduh120+Svot8oG7Ll1IkZbvLAGl81i+W6N8fl1PpMFEZaPGsFg44Dw 4THHNGyncOhbB/Dj0PXOX/7q3VXLDsbBGi/rfUQpDbTVdJXrbLgcTe//rlMqyOuaHe Phfo6xif+MJSg== Subject: [PATCH 5/6] check: run tests in exactly the order specified From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:47 -0800 Message-ID: <161292580772.3504537.14460569826738892955.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Introduce a new --exact-order switch to disable all sorting, filtering of repeated lines, and shuffling of test order. The goal of this is to be able to run tests in a specific order, namely to try to reproduce test failures that could be the result of a -r(andomize) run getting lucky. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- check | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/check b/check index 6f8db858..106ec8e1 100755 --- a/check +++ b/check @@ -20,6 +20,7 @@ diff="diff -u" showme=false have_test_arg=false randomize=false +exact_order=false export here=`pwd` xfile="" subdir_xfile="" @@ -67,6 +68,7 @@ check options -n show me, do not run tests -T output timestamps -r randomize test order + --exact-order run tests in the exact order specified -i iterate the test list times -d dump test output to stdout -b brief test summary @@ -249,17 +251,22 @@ _prepare_test_list() trim_test_list $list done - # sort the list of tests into numeric order - if $randomize; then - if type shuf >& /dev/null; then - sorter="shuf" + # sort the list of tests into numeric order unless we're running tests + # in the exact order specified + if ! $exact_order; then + if $randomize; then + if type shuf >& /dev/null; then + sorter="shuf" + else + sorter="awk -v seed=$RANDOM -f randomize.awk" + fi else - sorter="awk -v seed=$RANDOM -f randomize.awk" + sorter="cat" fi + list=`sort -n $tmp.list | uniq | $sorter` else - sorter="cat" + list=`cat $tmp.list` fi - list=`sort -n $tmp.list | uniq | $sorter` rm -f $tmp.list } @@ -304,7 +311,20 @@ while [ $# -gt 0 ]; do -udiff) diff="$diff -u" ;; -n) showme=true ;; - -r) randomize=true ;; + -r) + if $exact_order; then + echo "Cannot specify -r and --exact-order." + exit 1 + fi + randomize=true + ;; + --exact-order) + if $randomize; then + echo "Cannnot specify --exact-order and -r." + exit 1 + fi + exact_order=true + ;; -i) iterations=$2; shift ;; -T) timestamp=true ;; -d) DUMP_OUTPUT=true ;; From patchwork Wed Feb 10 02:56:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12079677 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.6 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 8979CC433E9 for ; Wed, 10 Feb 2021 02:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D2F064D79 for ; Wed, 10 Feb 2021 02:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbhBJC5l (ORCPT ); Tue, 9 Feb 2021 21:57:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:41586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbhBJC5l (ORCPT ); Tue, 9 Feb 2021 21:57:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0CAB64E58; Wed, 10 Feb 2021 02:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612925813; bh=Jctu2w3c0AYOfZudWG8jQ0l2prBCLIylzSLUqaa1HKM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=cSpZv64dSSHVFvqQLyZ66nxfUMrRiqr9s5h1kewUCEGUhwC8qlT1YoQHfPsHCbrVJ QXgvw+IbDUelqDuIHj7OT872DfDbrZU+3OWd0GG1Ju3Gj+KfQeu12QWijel4UhTzTy u0xOsbteUM/N8O/KXf2pEtPc4MWhttmnGSN1yRQMmibNppedHYvSrM1pF1h0aVKrED t+ckEr+lQK93dNMyGYWwXN5+nVOuAVN7LG/EVy/dWblQnzA0wWqZxKeX0jdusqfYT0 gw5m4SA0Q8MK7zSrkq902WHBx+EsM5XZ0476GGluiO9JDb92xqQvglSBfSM/qZhigk X7GkGj4HAnswA== Subject: [PATCH 6/6] fuzzy: capture core dumps from repair utilities From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 09 Feb 2021 18:56:53 -0800 Message-ID: <161292581331.3504537.1750366426922427428.stgit@magnolia> In-Reply-To: <161292577956.3504537.3260962158197387248.stgit@magnolia> References: <161292577956.3504537.3260962158197387248.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Always capture the core dumps when we run repair tools against a fuzzed filesystem. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- common/fuzzy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/fuzzy b/common/fuzzy index bd08af1c..809dee54 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -307,6 +307,9 @@ _scratch_xfs_fuzz_metadata() { echo "Verbs we propose to fuzz with:" echo $(echo "${verbs}") + # Always capture full core dumps from crashing tools + ulimit -c unlimited + echo "${fields}" | while read field; do echo "${verbs}" | while read fuzzverb; do __scratch_xfs_fuzz_mdrestore