]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/dump: do not override test cleanup trap
authorAmir Goldstein <amir73il@gmail.com>
Sun, 27 Jan 2019 07:50:56 +0000 (09:50 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sun, 3 Feb 2019 09:16:44 +0000 (17:16 +0800)
Instead, call _cleanup_dump explicitly from a private _cleanup.
Remove the generic cleanup bits (rm $tmp.*) from _cleanup_dump.

The only xfs/dump test that had anything other than rm $tmp.* in
_cleanup in xfs/287, but that was _scratch_unmount, which is not
needed anyway.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
36 files changed:
common/dump
tests/xfs/022
tests/xfs/023
tests/xfs/024
tests/xfs/025
tests/xfs/026
tests/xfs/027
tests/xfs/028
tests/xfs/035
tests/xfs/036
tests/xfs/037
tests/xfs/038
tests/xfs/039
tests/xfs/043
tests/xfs/046
tests/xfs/047
tests/xfs/055
tests/xfs/056
tests/xfs/059
tests/xfs/060
tests/xfs/061
tests/xfs/063
tests/xfs/064
tests/xfs/065
tests/xfs/066
tests/xfs/068
tests/xfs/266
tests/xfs/267
tests/xfs/268
tests/xfs/281
tests/xfs/282
tests/xfs/283
tests/xfs/287
tests/xfs/296
tests/xfs/301
tests/xfs/302

index b17771b9846cdd405defa037f9f35f661cb3b43a..6b08fc4e3bb243f62628c562a1e6f0281dca9245 100644 (file)
@@ -45,9 +45,6 @@ session_label="stress_$seq"
 nobody=4 # define this uid/gid as a number
 do_quota_check=true # do quota check if quotas enabled
 
-# install our cleaner
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
 # start inventory from a known base - move it aside for test
 for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
     if [ -d $dir ]; then
@@ -227,7 +224,7 @@ _wipe_fs()
 # Cleanup created dirs and files
 # Called by trap
 #
-_cleanup()
+_cleanup_dump()
 {
     # Some tests include this before checking _supported_fs xfs
     # and the sleeps & checks here get annoying
@@ -236,7 +233,6 @@ _cleanup()
     fi
 
     cd $here
-    rm -f $tmp.*
 
     if [ -n "$DEBUGDUMP" ]; then
        # save it for inspection
index e11627989c572693bb6ab2980a263f18dee2c631..e668a6fcdbd19ea36b2438c696f5c74fd3df770d 100755 (executable)
@@ -17,7 +17,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 . ./common/rc
 . ./common/dump
index b0763402364f38985e4d2371d1f7dbee238bc6e4..f7805b8562396f6c0b2e85c90b0d465af174c19b 100755 (executable)
@@ -15,7 +15,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index bf22215060467a55bc6d086eae0f30748e99761c..b4ecd7900e4e81bfc3ee403126b3dd06925d4f2d 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 5ce844e6253f2073088a22a72c47396a7e8bd94d..74039062185070e777572a487319a6ac66809a45 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index d4fd636c79978f6edb4f9f4e1d5bf926a23b32d0..96f712937cb2ca03b168960a1096bf91ba0af337 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 8459c5ad55c7efda3b14b73d4bc06efe4d6bac36..7a501f0321464fd029be6640ad3daf837fc7a5c6 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index b71039b907c402bcc209c3043a8a7e24cd8b7f17..bedfa3d36cff9ec680b2a95c36a19c4d78a8b4d6 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 1874173f4a52d6a36d886163dd1d5d30c031e5e4..2e09c35c3325aff0027fef1949f2e4b94e5793d9 100755 (executable)
@@ -14,7 +14,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 8d61a7193b0746b005f731bf31dbad1ac0ace075..a7e7d5720dd1667774279c7cc42c0918aa48a768 100755 (executable)
@@ -14,7 +14,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 478157e4797b46c565bc176e379100f7dbd4f806..aea557fcb60732c5c3982d5e79882697e05da355 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 43fdc2c339d9f89e202eee3814eee0debc8c0782..8ae93dad328af23900ca4943c2afeee678296632 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 79284afd59ecef98f0ce1ff9e7f3af560e567de3..7b213e33d6b2420c38f76eac3dc354835db2000f 100755 (executable)
@@ -14,7 +14,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index b60c2870914aa4478b6c9b50f6c3865a35eb84df..5db2d6f91cf3ac21cf38ba5dc6d8c7506f0a4f4c 100755 (executable)
@@ -16,7 +16,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index c5358c29c190650acb543963c1b0b1efc91f0642..0955e453ef4d9857b470d18011c36ccbe8617b7c 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index ddf871f872c004781e2f92b73ad8a40b321c6000..2fdfef141d78c414beffad2bcefd94ad35713039 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 8a30d4b3a8a7c157f5e4baef77bf0157008a5599..58144e982ba436beeee944ad4cda1c4d78e5ed1b 100755 (executable)
@@ -14,7 +14,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 533fef2ef695abb6acafeafeef16e914b65dd387..b0f70e90e6516730f40711fb3095ed000462a02c 100755 (executable)
@@ -14,7 +14,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 949dbe8154a356d393c12ffbbb9c250a4d3458b9..0121872ac28ae133a61abe2672fc4bcea8ad043e 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index ca7099832e85d49ab6865b49b94be0190bc0217d..a7048a66b88b89ab8ea0a04511a43f5abbd0774e 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index fcea0ee89a11fd02923b625689d5d12cdcd5b142..f8a639fc1dc2c6d40243317b277803d32e621d5f 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index f4c658070d66ed4f24ad958695945107ed58a9af..b6d4c03ad9e7c5aa84a046096c5b35cbaaa28360 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index f8fc382af629d07aa1245bceb90a20321dbec8d9..8adb406ab4f6d8f02a30ab631576f0d81835e3fd 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index 3fcdb604fac6bf8f92596a5f89711b930b3b7f21..c34724861e969e17e6d0af7024d6b8a0a2e385a2 100755 (executable)
@@ -16,7 +16,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index b7da7966a68093ce298445daddd6185c46fdf5a4..90e1251c945a844f8c4304ed1ef3f952dbc67b56 100755 (executable)
@@ -22,6 +22,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+    _cleanup_dump
     cd /
     rm -f $tmp.*
 }
index c755bc3e5bef773984937e5287f532d9e683127e..7f5900fccaf289878271a5a0ea306f4290d8c9c3 100755 (executable)
@@ -18,7 +18,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 . ./common/rc
 . ./common/dump
index 9084f5b9b5340d2f0ce2ffff5c71b7f72e91c4fb..73c1096dc2d051f76889440076af7de245cdf63d 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 #
 # Add a new file and append a subset of the fill'ed files
index 8887f4c1b87e943ffe2974ca8743c785aa12522e..d13ec19a53dfa6c5b8d3e7070af8e7ce9f133c87 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 #
 # create a 40 MiB file with an extended attr.
index c268630296ac3f31e78f8af65fef66adf7d686ce..fa5b9283dc036f3a5082ae75493e401f08dface8 100755 (executable)
@@ -15,7 +15,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0       # success is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 #
 # create two 12 MiB files with extended attrs.
index 9df6154c68a66f2954795a5e28c4e38ae9912c21..43534f10096306cef778e4f7633077ee80fab3f4 100755 (executable)
@@ -13,7 +13,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index bb4975c46f496679a48a953b0f653a68286fe3e4..3f0d8e599d907433f8e9813962791e752ab67e01 100755 (executable)
@@ -15,7 +15,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index e647cef978f885e604e3907d84d0f1999761ec2d..eab9f96b5cade24ad51c3d0a293c261a924a2b99 100755 (executable)
@@ -15,7 +15,14 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       _cleanup_dump
+       cd /
+       rm -f $tmp.*
+}
 
 # get standard environment, filters and checks
 . ./common/rc
index bde15e94218b9da8cfc426ec7fe1f075ac9702dc..8dc754a5842d2cb09ba6a3b942a8d9fbf93cdd0d 100755 (executable)
@@ -23,8 +23,8 @@ rm -f $seqres.full
 
 _cleanup()
 {
+       _cleanup_dump
        cd /
-       _scratch_unmount 2>/dev/null
        rm -rf $tmp.*
 }
 
index bc190fafa2a956cbfcb2e95d9771dbb7a5a39b8a..e17adaa11efcb67805448c161e3710c9cfd86cc6 100755 (executable)
@@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+    _cleanup_dump
     cd /
     rm -f $tmp.*
 }
index 440d314bde039494c4b932005d933c2bf4108935..231e4a185f4a901e50aa9645c42618adb9215803 100755 (executable)
@@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+    _cleanup_dump
     cd /
     rm -f $tmp.*
 }
index de619874dd3cd0096f030e2826f3c5a3572e23f9..92806a23dc98e00d4a6385172bccac52c6663ea4 100755 (executable)
@@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+    _cleanup_dump
     cd /
     rm -f $tmp.*
 }