All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: fstests@vger.kernel.org
Subject: [PATCH 6/8] fstests: consolidate no cleanup test setup
Date: Tue, 24 May 2022 17:34:09 +1000	[thread overview]
Message-ID: <20220524073411.1943480-7-david@fromorbit.com> (raw)
In-Reply-To: <20220524073411.1943480-1-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

Many of the XFS fuzzer tests define a "no cleanup" cleanup function.
Consolidate this in common/preamble and deduplicate all the tests
using this setup.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/preamble | 9 +++++++++
 tests/xfs/083   | 5 -----
 tests/xfs/085   | 5 -----
 tests/xfs/086   | 5 -----
 tests/xfs/087   | 5 -----
 tests/xfs/088   | 5 -----
 tests/xfs/089   | 5 -----
 tests/xfs/091   | 5 -----
 tests/xfs/093   | 5 -----
 tests/xfs/097   | 5 -----
 tests/xfs/098   | 5 -----
 tests/xfs/099   | 5 -----
 tests/xfs/100   | 5 -----
 tests/xfs/101   | 5 -----
 tests/xfs/102   | 5 -----
 tests/xfs/105   | 5 -----
 tests/xfs/112   | 5 -----
 tests/xfs/113   | 5 -----
 tests/xfs/117   | 5 -----
 tests/xfs/120   | 5 -----
 tests/xfs/123   | 5 -----
 tests/xfs/124   | 5 -----
 tests/xfs/125   | 5 -----
 tests/xfs/126   | 5 -----
 tests/xfs/130   | 5 -----
 25 files changed, 9 insertions(+), 120 deletions(-)

diff --git a/common/preamble b/common/preamble
index 0e8827c3..99e60a40 100644
--- a/common/preamble
+++ b/common/preamble
@@ -13,6 +13,15 @@ _cleanup()
 	rm -r -f $tmp.*
 }
 
+# Cleanup function for tests that want to leave a warm corpse behind for
+# debugging purposes. This should really only be used on tests that are designed
+# to fail (e.g. fuzzer tests) and not on tests that should always pass in normal
+# circumstances.
+_no_cleanup()
+{
+	cd /
+}
+
 # Standard cleanup function for tests using fsstress. THese tests all need to
 # kill fsstress processes when unexpectedly killed, and wait for them to finish.
 # Those tests can either register this function directly or call it from their
diff --git a/tests/xfs/083 b/tests/xfs/083
index 7666d204..a817c71f 100755
--- a/tests/xfs/083
+++ b/tests/xfs/083
@@ -10,11 +10,6 @@
 #
 . ./common/preamble
 _begin_fstest dangerous_fuzzers punch
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/085 b/tests/xfs/085
index 8aa8f2a0..6d171f5a 100755
--- a/tests/xfs/085
+++ b/tests/xfs/085
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/086 b/tests/xfs/086
index 031cb445..d0e26381 100755
--- a/tests/xfs/086
+++ b/tests/xfs/086
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/087 b/tests/xfs/087
index 9d1f59f0..bca4fdd0 100755
--- a/tests/xfs/087
+++ b/tests/xfs/087
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/088 b/tests/xfs/088
index de824223..b3743151 100755
--- a/tests/xfs/088
+++ b/tests/xfs/088
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/089 b/tests/xfs/089
index dae2d0d0..5567c3f0 100755
--- a/tests/xfs/089
+++ b/tests/xfs/089
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/091 b/tests/xfs/091
index c5db3337..8cda3146 100755
--- a/tests/xfs/091
+++ b/tests/xfs/091
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/093 b/tests/xfs/093
index 9fe1799a..a4308881 100755
--- a/tests/xfs/093
+++ b/tests/xfs/093
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/097 b/tests/xfs/097
index d66df458..8cdf7ce2 100755
--- a/tests/xfs/097
+++ b/tests/xfs/097
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/098 b/tests/xfs/098
index 21215ee5..7d2c5b8a 100755
--- a/tests/xfs/098
+++ b/tests/xfs/098
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/099 b/tests/xfs/099
index 2791e2df..a59022b6 100755
--- a/tests/xfs/099
+++ b/tests/xfs/099
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/100 b/tests/xfs/100
index e71e760e..6f3c36c5 100755
--- a/tests/xfs/100
+++ b/tests/xfs/100
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/101 b/tests/xfs/101
index 1cbcc973..437ba63f 100755
--- a/tests/xfs/101
+++ b/tests/xfs/101
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/102 b/tests/xfs/102
index 0ce3588a..b75883f6 100755
--- a/tests/xfs/102
+++ b/tests/xfs/102
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/105 b/tests/xfs/105
index 8a583da5..66c59c23 100755
--- a/tests/xfs/105
+++ b/tests/xfs/105
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/112 b/tests/xfs/112
index 4362f31c..b3fcf12f 100755
--- a/tests/xfs/112
+++ b/tests/xfs/112
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/113 b/tests/xfs/113
index e3f4fd4d..9d18532f 100755
--- a/tests/xfs/113
+++ b/tests/xfs/113
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/117 b/tests/xfs/117
index 4962c201..c8d1635d 100755
--- a/tests/xfs/117
+++ b/tests/xfs/117
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/120 b/tests/xfs/120
index 653948ee..e427b0c3 100755
--- a/tests/xfs/120
+++ b/tests/xfs/120
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/123 b/tests/xfs/123
index e191623a..48c8dd08 100755
--- a/tests/xfs/123
+++ b/tests/xfs/123
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/124 b/tests/xfs/124
index af738212..e9b04a17 100755
--- a/tests/xfs/124
+++ b/tests/xfs/124
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/125 b/tests/xfs/125
index a7280e2c..f5d28ef3 100755
--- a/tests/xfs/125
+++ b/tests/xfs/125
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/126 b/tests/xfs/126
index 55a12178..88d99227 100755
--- a/tests/xfs/126
+++ b/tests/xfs/126
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
diff --git a/tests/xfs/130 b/tests/xfs/130
index e7a0e6e3..c48858ea 100755
--- a/tests/xfs/130
+++ b/tests/xfs/130
@@ -9,11 +9,6 @@
 #
 . ./common/preamble
 _begin_fstest fuzzers clone
-
-_no_cleanup()
-{
-	cd /
-}
 _register_cleanup _no_cleanup
 
 # Import common functions.
-- 
2.35.1


  parent reply	other threads:[~2022-05-24  7:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24  7:34 [RFC PATCH 0/8] fstests: _cleanup() overrides are a mess Dave Chinner
2022-05-24  7:34 ` [PATCH 1/8] generic/038: kill background threads on interrupt Dave Chinner
2022-05-24  9:41   ` Amir Goldstein
2022-05-24 12:10     ` Dave Chinner
2022-05-24 12:30       ` Amir Goldstein
2022-05-24  7:34 ` [PATCH 2/8] fstests: _cleanup overrides are messy Dave Chinner
2022-05-24 16:16   ` Amir Goldstein
2022-05-24  7:34 ` [PATCH 3/8] xfs/*: clean up _cleanup override Dave Chinner
2022-05-24 10:42   ` Amir Goldstein
2022-05-24 12:27     ` Dave Chinner
2022-05-24 12:55       ` Amir Goldstein
2022-05-24 13:24         ` Dave Chinner
2022-05-24 14:17           ` Amir Goldstein
2022-05-24 16:32             ` Zorro Lang
2022-05-24 23:34             ` Dave Chinner
2022-05-25  2:54               ` Amir Goldstein
2022-05-24 17:13     ` Zorro Lang
2022-05-26 15:04       ` Zorro Lang
2022-05-26 23:39         ` Dave Chinner
2022-05-24  7:34 ` [PATCH 4/8] fstests: define a common _dump_cleanup function Dave Chinner
2022-05-24  9:04   ` Amir Goldstein
2022-05-24  9:52     ` Dave Chinner
2022-05-24  9:59       ` Amir Goldstein
2022-05-24  7:34 ` [PATCH 5/8] fstests: use a common fsstress cleanup function Dave Chinner
2022-05-24 12:25   ` Amir Goldstein
2022-05-24  7:34 ` Dave Chinner [this message]
2022-05-24 12:22   ` [PATCH 6/8] fstests: consolidate no cleanup test setup Amir Goldstein
2022-05-24 13:07     ` Dave Chinner
2022-05-24  7:34 ` [PATCH 7/8] fstests: Set up BUS trap for tests by default Dave Chinner
2022-05-24  8:48   ` Amir Goldstein
2022-05-24  7:34 ` [PATCH 8/8] fstests: cleanup _cleanup usage in shared Dave Chinner
2022-05-24 10:49   ` Amir Goldstein
2022-05-24 11:11   ` Amir Goldstein
2022-05-24  8:29 ` [RFC PATCH 0/8] fstests: _cleanup() overrides are a mess Amir Goldstein
2022-05-24  9:57   ` Dave Chinner
2022-05-24 10:01     ` Amir Goldstein
2022-05-24 10:13       ` Dave Chinner
2022-05-24 12:14         ` Amir Goldstein
2022-05-24 12:28           ` Dave Chinner
2022-05-24 12:34             ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220524073411.1943480-7-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.