fstests: _cleanup() overrides are a mess
cover fstests: _cleanup() overrides are a mess
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Essentially, we use _cleanup() functions as a way of overriding the default trap handler we install in _begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*
THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanup local_cleanup
While this looks more verbose, it means we can actually reuse the same cleanup function across lots of tests.
A large number of xfsdump tests were all using the same override cleanup function to call _cleanup_dump. These are all changed to:
. ./common/dump_register_cleanup _cleanup_dump
and _cleanup_dump stacks like this:
_cleanup_dump()
{
#do xfsdump cleanup stuff
_cleanup
}
and we don't need to do anything else. There is one xfsdump test that needs it's own cleanup. It stacks like this:
local_cleanup()
{
rm -f $testfile
_cleanup_dump
}_register_cleanup local_cleanup
All the tests that run fsstress in the background now have a common cleanup function that kills fsstress processes defined in common/preamble. They just do:
_register_cleanup _cleanup_fsstress
And now every test that puts fsstress in the background behaves correctly and kills all the background fsstree processes when interrupted.
The conversion is by no means complete. I've named the local cleanup functions by what they do so we can go back and derive commonality between them. The number of different variations on tearing down loops devices is crazy, and half of them are buggy. I haven't worked through these yet, so you'll see lots of tests with:
_loop_cleanup()
{
......
_cleanup
}_register_cleanup _loop_cleanup
That have similar but different ways of cleaning up loop devices.
I also added a _no_cleanup() function, as there are a large number of xfs fuzzer tests that want to leave a warm corpse behind so that debugging what just happened is easy.
I also added BUS to the default signal trap set - well over a 100 tests in tests/xfs had a line like:
_register_cleanup "_cleanup" BUS
just to add BUS signals to the set that would cause the cleanup function to run. Just make it the default!
Overall, this significantly reduces the amount of boiler plate in tests, and sets us down the path of common cleanup functions that tests may not even need to define. e.g. just including ./common/dmflakey registers the _cleanup_dmflakey() trap that will do all the necessary cleanup when the test exists. This makes the tests simpler, more robust and reduces the maintenance burden of over 1700 individual tests....
I won't put the full diffstat in this mail, but the benefits should be clean from the summary:
360 files changed, 420 insertions(+), 1781 deletions(-)
I've lost count of the number of test bugs I killed in removing all this code, and that's largely just in the tests/xfs directory. So before I go spend another couple of days on converting the rest of fstests, I figured I better make sure everyone is OK with these changes.
Thoughts, comments?
-Dave.
PATCH 1/8 generic/038: kill background threads on interrupt
From: Dave Chinner <[email protected]>
When I ctrl-c g/038, it either does nothing or it leaves processes running in the background. It is not cleaning up it's background processes correctly, so add kill vectors into the cleanup. Make sure we only kill in the cleanup trap if the background processes are running.
--- tests/generic/038 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
tests/generic/038 +10 -6
@@ -36,6 +36,10 @@ _begin_fstest auto stress trim # Override the default cleanup function. _cleanup() { + [ -n "${create_pids}" ] && kill ${create_pids[@]} + [ -n "${fallocate_pids}" ] && kill ${fallocate_pids[@]} + [ -n "${trim_pids}" ] && kill ${trim_pids[@]} + wait rm -fr $tmp }
@@ -47,6 +51,8 @@ _supported_fs generic _require_scratch _require_xfs_io_command "falloc" +echo "Silence is golden" + # Keep allocating and deallocating 1G of data space with the goal of creating # and deleting 1 block group constantly. The intention is to race with the # fstrim loop below.
@@ -121,6 +127,7 @@ _scratch_mount _require_fs_space $SCRATCH_MNT $((10 * 1024 * 1024)) _require_batched_discard $SCRATCH_MNT + for ((i = 0; i < $((4 * $LOAD_FACTOR)); i++)); do trim_loop & trim_pids[$i]=$!
@@ -136,12 +143,9 @@ create_files "foobar" kill ${fallocate_pids[@]} kill ${trim_pids[@]} wait +unset create_pids +unset fallocate_pids +unset trim_pids -# The fstests framework will now check for fs consistency with fsck. -# The trimming was racy and caused some btree nodes to get full of zeroes on -# disk, which obviously caused fs metadata corruption. The race often lead -# to missing free space entries in a block group's free space cache too. - -echo "Silence is golden" status=0 exit
Signature · 1 line
2.35.1
Re: [PATCH 1/8] generic/038: kill background threads on interrupt
Quoted 19 lines · Dave Chinner
From: Dave Chinner <[email protected]>
When I ctrl-c g/038, it either does nothing or it leaves processes running in the background. It is not cleaning up it's background processes correctly, so add kill vectors into the cleanup. Make sure we only kill in the cleanup trap if the background processes are running.
Signed-off-by Dave Chinner <[email protected]>--- tests/generic/038 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)tests/generic/038 +0
-0
tests/generic/038 _begin_fstest auto stress trim · line 42
Quoted 7 lines
tests/generic/038 +4
-0@@ -36,6 +36,10 @@ _begin_fstest auto stress trim # Override the default cleanup function. _cleanup() { + [ -n "${create_pids}" ] && kill ${create_pids[@]} + [ -n "${fallocate_pids}" ] && kill ${fallocate_pids[@]} + [ -n "${trim_pids}" ] && kill ${trim_pids[@]} + wait
Following the pattern of recently fixed generic/019, Please redirect stderr of kill to /dev/null
and I think we would rather not wait in cleanup callbacks which could potentially block forever?
tests/generic/038 _begin_fstest auto stress trim · line 43
Quoted 1 line
tests/generic/038 +0
-0rm -fr $tmp
I suppose another patch is going to replace that with the proper _cleanup()? Patches from vger have been VERY slowly trickling into my mailbox.
Quoted 20 lines
tests/generic/038 +3
-0}@@ -47,6 +51,8 @@ _supported_fs generic _require_scratch _require_xfs_io_command "falloc" +echo "Silence is golden" + # Keep allocating and deallocating 1G of data space with the goal of creating # and deleting 1 block group constantly. The intention is to race with the # fstrim loop below.@@ -121,6 +127,7 @@ _scratch_mount _require_fs_space $SCRATCH_MNT $((10 * 1024 * 1024)) _require_batched_discard $SCRATCH_MNT + for ((i = 0; i < $((4 * $LOAD_FACTOR)); i++)); do trim_loop & trim_pids[$i]=$!
tests/generic/038 create_files "foobar" · line 146
Quoted 4 lines
tests/generic/038 +1
-0@@ -136,12 +143,9 @@ create_files "foobar" kill ${fallocate_pids[@]} kill ${trim_pids[@]} wait +unset create_pids
This one should be moved up to after the wait in create_files()
Thanks,
Amir.
Re: [PATCH 1/8] generic/038: kill background threads on interrupt
Quoted 15 lines · Amir Goldstein
Quoted 14 lines · Dave Chinner
From: Dave Chinner <[email protected]>
When I ctrl-c g/038, it either does nothing or it leaves processes running in the background. It is not cleaning up it's background processes correctly, so add kill vectors into the cleanup. Make sure we only kill in the cleanup trap if the background processes are running.
Signed-off-by Dave Chinner <[email protected]>--- tests/generic/038 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Quoted 15 lines
tests/generic/038 _begin_fstest auto stress trim · line 42
Quoted 12 lines
tests/generic/038 +4
-0@@ -36,6 +36,10 @@ _begin_fstest auto stress trim # Override the default cleanup function. _cleanup() { + [ -n "${create_pids}" ] && kill ${create_pids[@]} + [ -n "${fallocate_pids}" ] && kill ${fallocate_pids[@]} + [ -n "${trim_pids}" ] && kill ${trim_pids[@]} + waitFollowing the pattern of recently fixed generic/019, Please redirect stderr of kill to
/dev/null
No. Redirecting errors to /dev/null to hide them is poor behaviour
- g/019 does not test if the pids variables are still valid even though they get unset. Hence the normal exit trap
runs an empty kill command which outputs a help message. The redirect to /dev/null hides this broken behaviour - it's poor, buggy code, and an example how buggy and broken a lot of the cleanup code actually is.
The code above will not run kill with an empty pid list, hence it should not fail when it is run. If it does fail then we've got a problem that needs to be captured and analysed and so redirecting that error to /dev/null is exactly the wrong thing to be doing.
Quoted 2 lines
and I think we would rather not wait in cleanup callbacks which could potentially block forever?
We do that in many, many tests - that's how we stop the test leaving background processes running after the test exits. And if it hangs here waiting on a hung process, then as a developer using this to find bugs in my code, I really do want the test to hang hard so I notice it and can capture the failure and analyse it.
Leaving a warm corpse to post-morten is the desired behaviour of a failed test.
Quoted 4 lines
tests/generic/038 _begin_fstest auto stress trim · line 43
Quoted 1 line
tests/generic/038 +0
-0rm -fr $tmpI suppose another patch is going to replace that with the proper
_cleanup()? Patches from vger have been VERY slowly trickling into my mailbox.
Not in this patch series. When I tackle the generic tests I'll address these bugs. This patch is just fixing broken ctrl-c behaviour.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Amir Goldstein
Reviewed-byRe: [PATCH 1/8] generic/038: kill background threads on interrupt
Quoted 46 lines · Dave Chinner
Quoted 15 lines · Amir Goldstein
Quoted 14 lines · Dave Chinner
From: Dave Chinner <[email protected]>
When I ctrl-c g/038, it either does nothing or it leaves processes running in the background. It is not cleaning up it's background processes correctly, so add kill vectors into the cleanup. Make sure we only kill in the cleanup trap if the background processes are running.
Signed-off-by Dave Chinner <[email protected]>--- tests/generic/038 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)Quoted 15 lines
tests/generic/038 _begin_fstest auto stress trim · line 42
Quoted 12 lines
tests/generic/038 +4
-0@@ -36,6 +36,10 @@ _begin_fstest auto stress trim # Override the default cleanup function. _cleanup() { + [ -n "${create_pids}" ] && kill ${create_pids[@]} + [ -n "${fallocate_pids}" ] && kill ${fallocate_pids[@]} + [ -n "${trim_pids}" ] && kill ${trim_pids[@]} + waitFollowing the pattern of recently fixed generic/019, Please redirect stderr of kill to
/dev/nullNo. Redirecting errors to
/dev/nullto hide them is poor behaviour
- g/019 does not test if the pids variables are still valid even though they get unset. Hence the normal exit trap
runs an emptykillcommand which outputs a help message. The redirect to/dev/nullhides this broken behaviour - it's poor, buggy code, and an example how buggy and broken a lot of the cleanup code actually is.The code above will not run kill with an empty pid list, hence it should not fail when it is run. If it does fail then we've got a problem that needs to be captured and analysed and so redirecting that error to
/dev/nullis exactly the wrong thing to be doing.
Quoted 4 lines
Quoted 2 lines
and I think we would rather not wait in cleanup callbacks which could potentially block forever?
We do that in many, many tests - that's how we stop the test leaving
Yes, I've seen that.
Quoted 4 lines
background processes running after the test exits. And if it hangs here waiting on a hung process, then as a developer using this to find bugs in my code, I really do want the test to hang hard so I notice it and can capture the failure and analyse it.
Makes sense to me, but I think the practice for cleanup should be (like in fsstress_cleanup) to send SIGKILL and wait in case the processes are ignoring or already handling SIGTERM.
Quoted 4 lines
Leaving a warm corpse to post-morten is the desired behaviour of a failed test.
Quoted 9 lines
Quoted 4 lines
tests/generic/038 _begin_fstest auto stress trim · line 43
Quoted 1 line
tests/generic/038 +0
-0rm -fr $tmpI suppose another patch is going to replace that with the proper
_cleanup()? Patches from vger have been VERY slowly trickling into my mailbox.Not in this patch series. When I tackle the generic tests I'll address these bugs. This patch is just fixing broken ctrl-c behaviour.
Great.
So w.r.t this patch there are only minor comments of kill -9 and move unset of create_pids.
Take it or leave it, either way you may add:
Thanks,
Amir.
PATCH 2/8 fstests: _cleanup overrides are messy
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Most _cleanup() function overrides look like:
_cleanup()
{
# do something test specific
cd /
rm -rf $tmp.*
}But they often get the last two lines either wrong or omit them. These are the lines the common/preamble::_cleanup() define.
The problem here is that we are just overriding the generic _cleanup function by redeclaring it after calling _begin_fstest. What we should be doing is registering a new local cleanup function that calls the generic cleanup function when we have finished the local cleanup. i.e.:
_local_cleanup()
{
# do something test specific
_cleanup
}
Make _register_cleanup() function to cancel the existing cleanup trap and register the new trap function so that local cleanups can be done cleanly.
--- common/preamble | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
common/preamble +6 -1
@@ -4,7 +4,9 @@ # Boilerplate fstests functionality -# Standard cleanup function. Individual tests can override this. +# Standard cleanup function. If individual tests register their own cleanup +# function, they need to call this from within their own cleanup function once +# the test has finished cleaning up it's own state. _cleanup() { cd /
@@ -19,6 +21,9 @@ _register_cleanup() local cleanup="$1" shift + # clear out existing traps first + trap - EXIT HUP INT QUIT TERM $* + test -n "$cleanup" && cleanup="${cleanup}; " trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* }
Signature · 1 line
2.35.1
Re: [PATCH 2/8] fstests: _cleanup overrides are messy
Quoted 25 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Most
_cleanup()function overrides look like:
_cleanup()
{# do something test specific cd / rm -rf $tmp.* }But they often get the last two lines either wrong or omit them. These are the lines the common/preamble::_cleanup() define.
The problem here is that we are just overriding the generic
_cleanupfunction by redeclaring it after calling_begin_fstest. What we should be doing is registering a new local cleanup function that calls the generic cleanup function when we have finished the local cleanup. i.e.:
_local_cleanup()
{# do something test specific
Quoted 8 lines
_cleanup
}Make
_register_cleanup()function to cancel the existing cleanup trap and register the new trap function so that local cleanups can be done cleanly.Signed-off-by Dave Chinner <[email protected]>
Thanks,
Amir.
PATCH 3/8 xfs/*: clean up _cleanup override
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Use a local cleanup function and _register_cleanup properly.
Remove local cleanups that just do what the standard _cleanup and test exist does.
Remove local cleanups that just remove test files and then do standard _cleanup functionality.
--- tests/xfs/004 | 7 ------- tests/xfs/006 | 7 ++++--- tests/xfs/008 | 9 ++------- tests/xfs/009 | 7 ------- tests/xfs/009.out | 1 - tests/xfs/010 | 8 -------- tests/xfs/011 | 12 +++--------- tests/xfs/012 | 10 ++-------- tests/xfs/013 | 8 +++----- tests/xfs/014 | 8 +++----- tests/xfs/016 | 9 --------- tests/xfs/016.out | 1 - tests/xfs/017 | 7 ------- tests/xfs/019 | 8 -------- tests/xfs/019.out | 1 - tests/xfs/020 | 9 ++++----- tests/xfs/021 | 8 -------- tests/xfs/021.out | 1 - tests/xfs/022 | 7 +++---- tests/xfs/023 | 7 +++---- tests/xfs/024 | 7 +++---- tests/xfs/025 | 7 +++---- tests/xfs/026 | 7 +++---- tests/xfs/027 | 7 +++---- tests/xfs/028 | 7 +++---- tests/xfs/030 | 8 -------- tests/xfs/033 | 8 -------- tests/xfs/034 | 9 --------- tests/xfs/034.out | 1 - tests/xfs/035 | 6 +++--- tests/xfs/036 | 7 +++---- tests/xfs/037 | 7 +++---- tests/xfs/038 | 7 +++---- tests/xfs/039 | 7 +++---- tests/xfs/041 | 8 -------- tests/xfs/042 | 7 ------- tests/xfs/043 | 7 +++---- tests/xfs/046 | 7 +++---- tests/xfs/047 | 7 +++---- tests/xfs/049 | 21 +++++++++------------ tests/xfs/050 | 8 -------- tests/xfs/051 | 9 ++++----- tests/xfs/052 | 8 -------- tests/xfs/055 | 7 +++---- tests/xfs/056 | 7 +++---- tests/xfs/057 | 16 ++++++++++------ tests/xfs/059 | 7 +++---- tests/xfs/060 | 7 +++---- tests/xfs/061 | 7 +++---- tests/xfs/063 | 7 +++---- tests/xfs/064 | 7 +++---- tests/xfs/065 | 7 +++---- tests/xfs/066 | 9 ++++----- tests/xfs/068 | 7 +++---- tests/xfs/070 | 7 +++---- tests/xfs/071 | 8 -------- tests/xfs/072 | 8 -------- tests/xfs/073 | 11 +++++------ tests/xfs/074 | 8 ++++---- tests/xfs/076 | 8 -------- tests/xfs/078 | 9 +++------ tests/xfs/079 | 11 +++++------ tests/xfs/080 | 7 ------- tests/xfs/083 | 7 +++---- tests/xfs/085 | 7 +++---- tests/xfs/086 | 7 +++---- tests/xfs/087 | 7 +++---- tests/xfs/088 | 7 +++---- tests/xfs/089 | 7 +++---- tests/xfs/091 | 7 +++---- tests/xfs/093 | 7 +++---- tests/xfs/097 | 7 +++---- tests/xfs/098 | 7 +++---- tests/xfs/099 | 7 +++---- tests/xfs/100 | 7 +++---- tests/xfs/101 | 7 +++---- tests/xfs/102 | 7 +++---- tests/xfs/105 | 7 +++---- tests/xfs/112 | 7 +++---- tests/xfs/113 | 7 +++---- tests/xfs/117 | 7 +++---- tests/xfs/120 | 7 +++---- tests/xfs/123 | 7 +++---- tests/xfs/124 | 7 +++---- tests/xfs/125 | 7 +++---- tests/xfs/126 | 7 +++---- tests/xfs/129 | 9 ++++----- tests/xfs/130 | 7 +++---- tests/xfs/131 | 8 -------- tests/xfs/139 | 7 ------- tests/xfs/140 | 7 ------- tests/xfs/141 | 11 +++++------ tests/xfs/148 | 7 +++---- tests/xfs/149 | 15 ++++++++------- tests/xfs/152 | 21 +++++++++------------ tests/xfs/153 | 8 -------- tests/xfs/157 | 8 ++++---- tests/xfs/159 | 8 -------- tests/xfs/167 | 9 +++++---- tests/xfs/169 | 8 -------- tests/xfs/177 | 6 +++--- tests/xfs/181 | 10 ++++------ tests/xfs/185 | 10 +++++----- tests/xfs/188 | 8 -------- tests/xfs/189 | 8 +++----- tests/xfs/194 | 12 ------------ tests/xfs/195 | 8 +------- tests/xfs/197 | 7 +------ tests/xfs/199 | 7 ------- tests/xfs/201 | 6 ------ tests/xfs/206 | 12 ++++++------ tests/xfs/220 | 7 ------- tests/xfs/229 | 7 +------ tests/xfs/231 | 7 +++---- tests/xfs/232 | 7 +++---- tests/xfs/234 | 9 ++++----- tests/xfs/236 | 8 -------- tests/xfs/237 | 10 +++++----- tests/xfs/239 | 8 ++++---- tests/xfs/240 | 10 +++++----- tests/xfs/241 | 8 ++++---- tests/xfs/244 | 8 -------- tests/xfs/250 | 6 +++--- tests/xfs/253 | 9 --------- tests/xfs/259 | 8 +++++--- tests/xfs/260 | 11 +---------- tests/xfs/261 | 7 ------- tests/xfs/264 | 7 +++---- tests/xfs/265 | 8 -------- tests/xfs/266 | 7 +++---- tests/xfs/267 | 7 +++---- tests/xfs/268 | 8 +++----- tests/xfs/269 | 7 ------- tests/xfs/271 | 8 ++++---- tests/xfs/272 | 8 ++++---- tests/xfs/273 | 8 ++++---- tests/xfs/274 | 8 ++++---- tests/xfs/275 | 8 ++++---- tests/xfs/276 | 8 ++++---- tests/xfs/277 | 9 +++++---- tests/xfs/279 | 9 ++++----- tests/xfs/281 | 7 +++---- tests/xfs/282 | 7 +++---- tests/xfs/283 | 7 +++---- tests/xfs/284 | 10 ++++------ tests/xfs/287 | 7 +++---- tests/xfs/289 | 17 +++++++++-------- tests/xfs/296 | 9 ++++----- tests/xfs/299 | 8 -------- tests/xfs/301 | 9 ++++----- tests/xfs/302 | 9 ++++----- tests/xfs/309 | 8 -------- tests/xfs/310 | 8 +++----- tests/xfs/311 | 10 ++++------ tests/xfs/312 | 8 -------- tests/xfs/313 | 8 -------- tests/xfs/314 | 8 -------- tests/xfs/315 | 8 -------- tests/xfs/316 | 8 -------- tests/xfs/317 | 8 -------- tests/xfs/318 | 8 -------- tests/xfs/319 | 8 -------- tests/xfs/320 | 8 -------- tests/xfs/321 | 8 -------- tests/xfs/322 | 8 -------- tests/xfs/323 | 8 -------- tests/xfs/324 | 8 -------- tests/xfs/325 | 8 -------- tests/xfs/326 | 8 -------- tests/xfs/327 | 8 -------- tests/xfs/336 | 7 ------- tests/xfs/432 | 8 ++++---- tests/xfs/438 | 16 ++++++++++------ tests/xfs/442 | 10 +++++----- tests/xfs/447 | 7 +++---- tests/xfs/501 | 7 +++---- tests/xfs/503 | 10 ++++------ tests/xfs/507 | 13 +++++-------- tests/xfs/511 | 8 -------- tests/xfs/512 | 8 +------- tests/xfs/513 | 15 +++++---------- tests/xfs/514 | 10 ++++------ tests/xfs/515 | 10 ++++------ tests/xfs/516 | 7 ------- tests/xfs/517 | 9 +++------ tests/xfs/520 | 8 -------- tests/xfs/521 | 8 ++++---- tests/xfs/522 | 7 ------- tests/xfs/523 | 7 ------- tests/xfs/524 | 8 ++++---- tests/xfs/525 | 7 ------- tests/xfs/526 | 7 ------- tests/xfs/528 | 6 +++--- tests/xfs/530 | 6 +++--- tests/xfs/542 | 7 ++++--- tests/xfs/543 | 7 ------- tests/xfs/544 | 11 ++++++++--- 197 files changed, 477 insertions(+), 1106 deletions(-)
tests/xfs/004 +0 -7
@@ -11,13 +11,6 @@ _begin_fstest db auto quick status=0 -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount - rm -f $tmp.* -} - _populate_scratch() { echo "=== mkfs output ===" >>$seqres.full
tests/xfs/006 +4 -3
@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eio # Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanup + _cleanup } # Import common functions.
@@ -28,6 +27,8 @@ _require_scratch _require_dm_target error _require_fs_sysfs error/fail_at_unmount +_register_cleanup _dmerror_cleanup + _scratch_mkfs > $seqres.full 2>&1 _dmerror_init _dmerror_mount
tests/xfs/008 +2 -7
@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.* -} - _filter() { sed -e "s/-b $pgsize/-b PGSIZE/g" \
@@ -68,6 +61,8 @@ _do_test() _supported_fs xfs _require_test +rm -rf $TEST_DIR/randholes.$$.* + # Note on special numbers here. # # We are trying to create roughly 50 or 100 holes in a file
tests/xfs/009 +0 -7
@@ -9,13 +9,6 @@ . ./common/preamble _begin_fstest rw ioctl auto prealloc quick -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount -} - _init() { echo "*** mkfs"
tests/xfs/009.out +0 -1
@@ -111,4 +111,3 @@ filesize = 500 [ofs,count]: start..end [0,1000]: BLOCKRANGE filesize = 500 -*** unmount
tests/xfs/010 +0 -8
@@ -15,14 +15,6 @@ _begin_fstest auto quick repair . ./common/filter . ./common/repair -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - _sparse_inode_populate() { dir=$1
tests/xfs/011 +3 -9
@@ -11,17 +11,13 @@ . ./common/preamble _begin_fstest auto freeze log metadata quick -# Import common functions. - -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { $KILLALL_PROG -9 fsstress 2>/dev/null wait - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* + _cleanup } +_register_cleanup _fsstress_cleanup # Use the information exported by XFS to sysfs to determine whether the log has # active reservations after a filesystem freeze.
@@ -85,7 +81,5 @@ done $KILLALL_PROG $FSSTRESS_PROG wait -_scratch_unmount - status=0 exit
tests/xfs/012 +2 -8
@@ -11,14 +11,6 @@ _begin_fstest rw auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - rm -rf $TEST_DIR/holes.$$.* -} - _filesize() { ls -l $1 | $AWK_PROG '{print " filesize = " $5}'
@@ -85,6 +77,8 @@ _do_test() _supported_fs xfs _require_test +rm -rf $TEST_DIR/holes.$$.* + # small & fairly dense _do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100
tests/xfs/013 +3 -5
@@ -16,15 +16,13 @@ _begin_fstest auto metadata stress # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { $KILLALL_PROG -9 fsstress 2>/dev/null wait - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* + _cleanup } +_register_cleanup _fsstress_cleanup filter_enospc() { sed -e '/^.*No space left on device.*/d'
tests/xfs/014 +3 -5
@@ -18,14 +18,12 @@ _begin_fstest auto enospc quick quota . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / umount $LOOP_MNT 2>/dev/null - _scratch_unmount 2>/dev/null - rm -f $tmp.* + _cleanup } +_register_cleanup _loop_cleanup # Create a file using a repeated open, extending write and close pattern. This # causes the preallocation to persist after the file is closed. Preallocation
tests/xfs/016 +0 -9
@@ -22,15 +22,6 @@ . ./common/preamble _begin_fstest rw auto quick -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - echo "*** unmount" - _scratch_unmount 2>/dev/null -} - _block_filter() { sed -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g'
tests/xfs/016.out +0 -1
@@ -117,4 +117,3 @@ Wrote 51200.00Kb (value 0xc6) *** fiddle *** unmount *** check for corruption -*** unmount
tests/xfs/017 +0 -7
@@ -11,13 +11,6 @@ _begin_fstest mount auto quick stress _register_cleanup "_cleanup; rm -f $tmp.*" -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter
tests/xfs/019 +0 -8
@@ -14,14 +14,6 @@ rm -f $seqfull # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - _full() { echo "" >>$seqfull
tests/xfs/019.out +0 -1
@@ -90,4 +90,3 @@ Device: <DEVICE> Inode: <INODE> Links: 1 Device: <DEVICE> Inode: <INODE> Links: 1 *** unmount FS *** done -*** unmount
tests/xfs/020 +4 -5
@@ -12,13 +12,12 @@ . ./common/preamble _begin_fstest auto repair -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* - rm -f $fsfile + rm -f $fsfile + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/021 +0 -8
@@ -14,14 +14,6 @@ status=0 # success is the default! . ./common/filter . ./common/attr -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - _attr() { ${ATTR_PROG} $* 2>$tmp.err >$tmp.out
tests/xfs/021.out +0 -1
@@ -54,4 +54,3 @@ nvlist[2].namelen = 7 nvlist[2].name = "a2-----" nvlist[2].value = "value_2\d" *** done -*** unmount
tests/xfs/022 +3 -4
@@ -15,13 +15,12 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup . ./common/dump
tests/xfs/023 +3 -4
@@ -13,13 +13,12 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/024 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/025 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/026 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/027 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/028 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/030 +0 -8
@@ -10,14 +10,6 @@ seqfull=$0 . ./common/preamble _begin_fstest repair auto quick -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # Import common functions. . ./common/filter . ./common/repair
tests/xfs/033 +0 -8
@@ -10,14 +10,6 @@ seqfull=$0 . ./common/preamble _begin_fstest repair auto quick -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # Import common functions. . ./common/filter . ./common/repair
tests/xfs/034 +0 -9
@@ -9,15 +9,6 @@ . ./common/preamble _begin_fstest other auto quick -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - echo "*** unmount" - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter
tests/xfs/034.out +0 -1
@@ -2,4 +2,3 @@ QA output created by 034 *** init FS *** test *** done -*** unmount
tests/xfs/035 +3 -3
@@ -11,12 +11,12 @@ seqfull=$0 _begin_fstest dump ioctl tape auto # Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/036 +3 -4
@@ -10,13 +10,12 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/037 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump ioctl remote tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/038 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump ioctl remote tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/039 +3 -4
@@ -10,13 +10,12 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/041 +0 -8
@@ -12,14 +12,6 @@ set +x . ./common/preamble _begin_fstest growfs ioctl auto -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount - rm -f $tmp.* -} - # Import common functions. . ./common/filter
tests/xfs/042 +0 -7
@@ -13,13 +13,6 @@ set +x . ./common/preamble _begin_fstest fsr ioctl auto -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount - rm -f $tmp.* -} - # Import common functions. . ./common/filter
tests/xfs/043 +3 -4
@@ -12,13 +12,12 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/046 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/047 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump ioctl auto -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/049 +9 -12
@@ -9,20 +9,17 @@ . ./common/preamble _begin_fstest rw auto quick -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - umount $SCRATCH_MNT/test2 > /dev/null 2>&1 - umount $SCRATCH_MNT/test > /dev/null 2>&1 - rm -f $tmp.* - - if [ -w $seqres.full ] - then - echo "--- mounts at end (after cleanup)" >> $seqres.full - mount >> $seqres.full - fi + umount $SCRATCH_MNT/test2 > /dev/null 2>&1 + umount $SCRATCH_MNT/test > /dev/null 2>&1 + if [ -w $seqres.full ]; then + echo "--- mounts at end (after cleanup)" >> $seqres.full + mount >> $seqres.full + fi + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/050 +0 -8
@@ -14,14 +14,6 @@ _begin_fstest quota auto quick . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs
tests/xfs/051 +4 -5
@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadata -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + wait + _cleanup } +_register_cleanup fsstress_cleanup # Import common functions. . ./common/dmflakey
tests/xfs/052 +0 -8
@@ -16,14 +16,6 @@ _begin_fstest quota db auto quick . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs
tests/xfs/055 +3 -4
@@ -10,13 +10,12 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/056 +3 -4
@@ -12,13 +12,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/057 +10 -6
@@ -23,16 +23,20 @@ . ./common/preamble _begin_fstest auto log recoveryloop -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() +{ + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup +} + +local_cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 [ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] && echo 0 > /sys/fs/xfs/$sdev/errortag/log_item_pin - wait > /dev/null 2>&1 + _fsstress_cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/inject
tests/xfs/059 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/060 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/061 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/063 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump attr auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/064 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump auto -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/065 +3 -4
@@ -12,13 +12,12 @@ . ./common/preamble _begin_fstest dump auto -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/066 +4 -5
@@ -13,13 +13,12 @@ _begin_fstest dump ioctl auto quick . ./common/filter . ./common/dump -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { - _cleanup_dump - cd / - rm -f $tmp.* + _cleanup_dump + _cleanup } +_register_cleanup _dump_cleanup # real QA test starts here _supported_fs xfs
tests/xfs/068 +3 -4
@@ -16,13 +16,12 @@ _begin_fstest auto stress dump status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup . ./common/dump
tests/xfs/070 +3 -4
@@ -21,14 +21,13 @@ . ./common/preamble _begin_fstest auto quick repair -# Override the default cleanup function. -_cleanup() +_xfs_repair_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $XFS_REPAIR_PROG > /dev/null 2>&1 wait > /dev/null 2>&1 + _cleanup } +_register_cleanup _xfs_repair_cleanup # Start and monitor an xfs_repair of the scratch device. This test can induce a # time consuming brute force superblock scan. Since a brute force scan means
tests/xfs/071 +0 -8
@@ -9,14 +9,6 @@ seqfull=$0 . ./common/preamble _begin_fstest rw auto -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter
tests/xfs/072 +0 -8
@@ -9,14 +9,6 @@ . ./common/preamble _begin_fstest rw auto prealloc quick -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter
tests/xfs/073 +5 -6
@@ -16,17 +16,16 @@ _begin_fstest copy auto # don't put fs images in /tmp imgs=$TEST_DIR/$$ -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / _scratch_unmount 2>/dev/null umount $imgs.loop 2>/dev/null - [ -d $imgs.loop ] && rmdir $imgs.loop umount $imgs.source_dir 2>/dev/null - [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir - rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.* + rm -rf $imgs.* /var/tmp/xfs_copy.log.* + + _cleanup } +_register_cleanup local_cleanup _filter_copy() {
tests/xfs/074 +4 -4
@@ -22,13 +22,13 @@ . ./common/preamble _begin_fstest quick auto prealloc rw -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / _destroy_loop_device $LOOP_DEV - rm -f $tmp.* $LOOP_FILE + rm -f $LOOP_FILE + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/076 +0 -8
@@ -23,14 +23,6 @@ _begin_fstest auto enospc punch # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - _consume_freesp() { file=$1
tests/xfs/078 +3 -6
@@ -9,19 +9,16 @@ . ./common/preamble _begin_fstest growfs auto quick -_register_cleanup "_cleanup; rm -f $tmp.*" - -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / - rm -f $tmp.* $UMOUNT_PROG $LOOP_MNT 2>/dev/null [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null # try to keep the image file if test fails [ $status -eq 0 ] && rm -f $LOOP_IMG rmdir $LOOP_MNT + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/079 +5 -6
@@ -17,14 +17,13 @@ . ./common/preamble _begin_fstest shutdown auto log quick -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup } +_register_cleanup fsstress_cleanup # Import common functions. . ./common/log
tests/xfs/080 +0 -7
@@ -12,13 +12,6 @@ _begin_fstest rw ioctl # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* -} - _supported_fs xfs _require_test
tests/xfs/083 +3 -4
@@ -11,12 +11,11 @@ . ./common/preamble _begin_fstest dangerous_fuzzers punch -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/085 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/086 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/087 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/088 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/089 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/091 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/093 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/097 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/098 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/099 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/100 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/101 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/102 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/105 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/112 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/113 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/117 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/120 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/123 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/124 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/125 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/126 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/129 +4 -5
@@ -11,13 +11,12 @@ . ./common/preamble _begin_fstest auto quick clone metadump -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* $testdir $metadump_file $TEST_DIR/image + rm -rf $testdir $metadump_file $TEST_DIR/image + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/130 +3 -4
@@ -10,12 +10,11 @@ . ./common/preamble _begin_fstest fuzzers clone -# Override the default cleanup function. -_cleanup() +_no_cleanup() { - cd / - #rm -f $tmp.* + cd / } +_register_cleanup _no_cleanup # Import common functions. . ./common/filter
tests/xfs/131 +0 -8
@@ -9,14 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone realtime -# Override the default cleanup function. -_cleanup() -{ - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 - rm -rf $tmp.* $testdir $metadump_file -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/139 +0 -7
@@ -10,13 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf $tmp.* $testdir -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/140 +0 -7
@@ -10,13 +10,6 @@ . ./common/preamble _begin_fstest auto clone -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf $tmp.* $testdir -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/141 +5 -6
@@ -14,14 +14,13 @@ . ./common/preamble _begin_fstest auto log metadata -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup } +_register_cleanup fsstress_cleanup # Import common functions. . ./common/inject
tests/xfs/148 +3 -4
@@ -10,14 +10,13 @@ . ./common/preamble _begin_fstest auto quick fuzzers -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / $UMOUNT_PROG $mntpt > /dev/null 2>&1 _destroy_loop_device $loopdev > /dev/null 2>&1 - rm -r -f $tmp.* + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/149 +8 -7
@@ -19,15 +19,16 @@ loopfile=$TEST_DIR/fsfile mntdir=$TEST_DIR/mntdir loop_symlink=$TEST_DIR/loop_symlink.$$ -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - $UMOUNT_PROG $mntdir - [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev - rmdir $mntdir - rm -f $loop_symlink - rm -f $loopfile + $UMOUNT_PROG $mntdir + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev + rmdir $mntdir + rm -f $loop_symlink + rm -f $loopfile + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/152 +9 -12
@@ -13,19 +13,12 @@ . ./common/preamble _begin_fstest auto quick quota idmapped -wipe_mounts() +_idmapped_cleanup() { umount "${SCRATCH_MNT}/idmapped" >/dev/null 2>&1 - _scratch_unmount >/dev/null 2>&1 -} - -# Override the default cleanup function. -_cleanup() -{ - cd / - wipe_mounts - rm -f $tmp.* + _cleanup } +_register_cleanup _idmapped_cleanup # Import common functions. . ./common/filter
@@ -232,6 +225,12 @@ test_restore() $SCRATCH_MNT | _filter_scratch } +wipe_mounts() +{ + umount "${SCRATCH_MNT}/idmapped" >/dev/null 2>&1 + _scratch_unmount >/dev/null 2>&1 +} + wipe_scratch() { wipe_mounts
@@ -367,8 +366,6 @@ idmapped=1 qmount_idmapped test_xfs_quota "gquota,sync" -wipe_mounts - # success, all done status=0 exit
tests/xfs/153 +0 -8
@@ -16,14 +16,6 @@ _begin_fstest auto quick quota idmapped . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs
tests/xfs/157 +4 -4
@@ -20,12 +20,12 @@ . ./common/preamble _begin_fstest auto quick admin -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* $fake_logfile $fake_rtfile $fake_datafile + rm -f $fake_logfile $fake_rtfile $fake_datafile + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/159 +0 -8
@@ -11,14 +11,6 @@ . ./common/preamble _begin_fstest auto quick bigtime -# Override the default cleanup function. -_cleanup() -{ - cd / -} - -# Import common functions. - # real QA test starts here _supported_fs xfs _require_scratch
tests/xfs/167 +5 -4
@@ -9,12 +9,13 @@ . ./common/preamble _begin_fstest rw metadata auto stress -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null - wait # ensures all fsstress processes died + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup } +_register_cleanup fsstress_cleanup workout() {
tests/xfs/169 +0 -8
@@ -11,14 +11,6 @@ . ./common/preamble _begin_fstest auto clone -# Override the default cleanup function. -_cleanup() -{ - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/177 +3 -3
@@ -25,12 +25,12 @@ . ./common/preamble _begin_fstest auto ioctl -_cleanup() +local_cleanup() { - cd / - rm -r -f $tmp.* test -n "$old_centisecs" && echo "$old_centisecs" > "$xfs_centisecs_file" + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/181 +4 -6
@@ -13,12 +13,12 @@ . ./common/preamble _begin_fstest shutdown log auto quick -# Override the default cleanup function. -_cleanup() +local_cleanup() { - rm -f $tmp.* - [ -n "$pid" ] && kill $pid + [ -n "$pid" ] && kill $pid + _cleanup } +_register_cleanup local_cleanup pid=""
@@ -29,8 +29,6 @@ pid="" # real QA test starts here _supported_fs xfs -rm -f $tmp.log - _require_scratch echo "mkfs"
tests/xfs/185 +5 -5
@@ -18,17 +18,17 @@ . ./common/preamble _begin_fstest auto fsmap -_cleanup() +_loop_cleanup() { - cd / - rm -r -f $tmp.* _scratch_unmount test -n "$ddloop" && _destroy_loop_device "$ddloop" test -n "$rtloop" && _destroy_loop_device "$rtloop" - test -n "$ddfile" && rm -f "$ddfile" - test -n "$rtfile" && rm -f "$rtfile" + rm -f "$ddfile" + rm -f "$rtfile" test -n "$old_use_external" && USE_EXTERNAL="$old_use_external" + _cleanup } +_register_cleanup _loop_cleanup # real QA test starts here _supported_fs xfs
tests/xfs/188 +0 -8
@@ -18,14 +18,6 @@ _begin_fstest ci dir auto status=0 # success is the default! -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - rm -rf $SCRATCH_MNT/$seq -} - # Import common functions. . ./common/filter
tests/xfs/189 +3 -5
@@ -38,14 +38,12 @@ _begin_fstest mount auto quick tag="added by qa $seq" -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - _scratch_unmount 2>/dev/null _putback_scratch_fstab - rm -f $tmp.* + _cleanup } +_register_cleanup local_cleanup _scratch_filter() {
tests/xfs/194 +0 -12
@@ -9,18 +9,6 @@ . ./common/preamble _begin_fstest rw auto -# Override the default cleanup function. -_cleanup() -{ - cd / - # Unmount the V4 filesystem we forcibly created to run this test so that - # the post-test wrapup checks won't try to remount the filesystem with - # different MOUNT_OPTIONS (specifically, the ones that get screened out by - # _force_xfsv4_mount_options) and fail. - _scratch_unmount - rm -f $tmp.* -} - # Import common functions. . ./common/filter
tests/xfs/195 +1 -7
@@ -11,13 +11,6 @@ . ./common/preamble _begin_fstest ioctl dump auto quick -# Override the default cleanup function. -_cleanup() -{ - rm -rf $TEST_DIR/d - rm -f $TEST_DIR/dumpfile -} - # # Perform a level 0 dump that respects the chattr dump exclude flag, # and grep the output for the inode number we expect / do not expect
@@ -46,6 +39,7 @@ _require_user _require_command "$XFSDUMP_PROG" xfsdump echo "Preparing subtree" +rm -rf $TEST_DIR/d mkdir $TEST_DIR/d touch $TEST_DIR/d/t inum=`stat -c "%i" $TEST_DIR/d/t`
tests/xfs/197 +1 -6
@@ -15,12 +15,6 @@ . ./common/preamble _begin_fstest dir auto quick -# Override the default cleanup function. -_cleanup() -{ - rm -rf $TEST_DIR/ttt -} - # Import common functions. . ./common/filter
@@ -33,6 +27,7 @@ if [ "$bitsperlong" -ne 32 ]; then _notrun "This test is only valid on 32 bit machines" fi +rm -rf $TEST_DIR/ttt mkdir $TEST_DIR/ttt for n in {1..168}; do touch $TEST_DIR/ttt/$n;
tests/xfs/199 +0 -7
@@ -12,13 +12,6 @@ . ./common/preamble _begin_fstest mount auto quick -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount >/dev/null 2>&1 -} - # Import common functions. . ./common/filter
tests/xfs/201 +0 -6
@@ -12,12 +12,6 @@ . ./common/preamble _begin_fstest metadata auto quick -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount -} - # Import common functions. . ./common/filter
tests/xfs/206 +6 -6
@@ -15,14 +15,14 @@ . ./common/preamble _begin_fstest growfs auto quick -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - umount $tmpdir - rmdir $tmpdir - rm -f $tmp - rm -f $tmpfile + umount $tmpdir + rm -f $tmpfile + rmdir $tmpdir + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/220 +0 -7
@@ -12,13 +12,6 @@ . ./common/preamble _begin_fstest auto quota quick -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount >/dev/null 2>&1 -} - # Import common functions. . ./common/filter . ./common/quota
tests/xfs/229 +1 -6
@@ -15,12 +15,6 @@ . ./common/preamble _begin_fstest auto rw -# Override the default cleanup function. -_cleanup() -{ - rm -rf ${TDIR} -} - # Import common functions. # real QA test starts here
@@ -34,6 +28,7 @@ EXTSIZE="256k" _xfs_force_bdev data $TEST_DIR # Create the test directory +rm -rf ${TDIR} mkdir ${TDIR} # Set the test directory extsize
tests/xfs/231 +3 -4
@@ -14,14 +14,13 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / test -n "$old_cowgc_interval" && \ _xfs_set_cowgc_interval $old_cowgc_interval - rm -rf $tmp.* + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/232 +3 -4
@@ -15,14 +15,13 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / test -n "$old_cowgc_interval" && \ _xfs_set_cowgc_interval $old_cowgc_interval - rm -rf $tmp.* + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/234 +4 -5
@@ -11,13 +11,12 @@ . ./common/preamble _begin_fstest auto quick rmap punch metadump -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* $metadump_file $TEST_DIR/image + rm -f $metadump_file $TEST_DIR/image + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/236 +0 -8
@@ -11,14 +11,6 @@ . ./common/preamble _begin_fstest auto rmap punch -# Override the default cleanup function. -_cleanup() -{ - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter
tests/xfs/237 +5 -5
@@ -9,13 +9,13 @@ . ./common/preamble _begin_fstest auto quick clone eio -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf $tmp.* $TEST_DIR/moo - _dmerror_cleanup + rm -rf $TEST_DIR/moo + _dmerror_cleanup + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/239 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf $tmp.* $TEST_DIR/moo + rm -rf $TEST_DIR/moo + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/240 +5 -5
@@ -9,13 +9,13 @@ . ./common/preamble _begin_fstest auto quick clone eio -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf $tmp.* $TEST_DIR/moo - _dmerror_cleanup + rm -rf $TEST_DIR/moo + _dmerror_cleanup + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/241 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf $tmp.* $TEST_DIR/moo + rm -rf $TEST_DIR/moo + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/244 +0 -8
@@ -13,14 +13,6 @@ _begin_fstest auto quota quick . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs _require_xfs_quota
tests/xfs/250 +3 -3
@@ -9,14 +9,14 @@ . ./common/preamble _begin_fstest auto quick rw prealloc metadata -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / umount $LOOP_MNT 2>/dev/null rm -f $LOOP_DEV rmdir $LOOP_MNT + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/253 +0 -9
@@ -20,15 +20,6 @@ . ./common/preamble _begin_fstest auto quick metadump -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - rm -rf "${OUTPUT_DIR}" - rm -f "${METADUMP_FILE}" -} - # Import common functions. . ./common/filter
tests/xfs/259 +5 -3
@@ -9,11 +9,13 @@ . ./common/preamble _begin_fstest auto quick -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - rm -f "$testfile" + losetup -d $lofile 2> /dev/null + rm -f "$testfile" + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/260 +1 -10
@@ -14,22 +14,13 @@ . ./common/preamble _begin_fstest auto quick mkfs -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - rm -f $localfile -} - -# Import common functions. - echo 'Silence is golden' _supported_fs xfs _require_test localfile=$TEST_DIR/$seq.$$ +rm -f $localfile $XFS_IO_PROG -f -c "truncate 10444800" $localfile
tests/xfs/261 +0 -7
@@ -17,13 +17,6 @@ my_mtab=${tmp}.mtab mtab=/proc/self/mounts -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f ${tmp}.* -} - # Import common functions. . ./common/filter . ./common/quota
tests/xfs/264 +3 -4
@@ -10,13 +10,12 @@ . ./common/preamble _begin_fstest auto quick mount eio -# Override the default cleanup function. -_cleanup() +_dm_error_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanup + _cleanup } +_register_cleanup _dm_error_cleanup # Import common functions. . ./common/filter
tests/xfs/265 +0 -8
@@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto clone -# Override the default cleanup function. -_cleanup() -{ - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/266 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl auto quick status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # # Add a new file and append a subset of the fill'ed files
tests/xfs/267 +3 -4
@@ -11,13 +11,12 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # # create a 40 MiB file with an extended attr.
tests/xfs/268 +3 -5
@@ -13,15 +13,13 @@ _begin_fstest dump ioctl tape status=0 # success is the default! -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup -# # create two 12 MiB files with extended attrs. # xfsdump writes file data in "extent groups", currently 16 MiB in size. After # writing an extent group or finishing a file, xfsdump will start a new media
tests/xfs/269 +0 -7
@@ -9,13 +9,6 @@ . ./common/preamble _begin_fstest auto quick ioctl -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout -} - # Import common functions. . ./common/filter . ./common/attr
tests/xfs/271 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout + rm -f $TEST_DIR/fsmap $TEST_DIR/testout + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/272 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap + rm -f $TEST_DIR/fsmap $TEST_DIR/bmap + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/273 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/a $TEST_DIR/b + rm -f $TEST_DIR/a $TEST_DIR/b + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/274 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap + rm -f $TEST_DIR/fsmap $TEST_DIR/bmap + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/275 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout + rm -f $TEST_DIR/fsmap $TEST_DIR/testout + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/276 +4 -4
@@ -9,12 +9,12 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap realtime -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap + rm -f $TEST_DIR/fsmap $TEST_DIR/bmap + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/277 +5 -4
@@ -9,12 +9,13 @@ . ./common/preamble _begin_fstest auto quick rmap fsmap -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout + rm -f $TEST_DIR/fsmap $TEST_DIR/testout + _cleanup } +_register_cleanup local_cleanup + # Import common functions. . ./common/filter
tests/xfs/279 +4 -5
@@ -10,13 +10,12 @@ . ./common/preamble _begin_fstest auto mkfs -# Override the default cleanup function. -_cleanup() +_scsi_debug_cleanup() { - cd / - rm -f $tmp.* - _put_scsi_debug_dev + _put_scsi_debug_dev + _cleanup } +_register_cleanup _scsi_debug_cleanup # Import common functions. . ./common/filter
tests/xfs/281 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/282 +3 -4
@@ -11,13 +11,12 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/283 +3 -4
@@ -11,13 +11,12 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -f $tmp.* + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/dump
tests/xfs/284 +4 -6
@@ -10,14 +10,12 @@ . ./common/preamble _begin_fstest auto quick dump copy db mkfs repair metadump -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* - rm -f $METADUMP_FILE 2>/dev/null - rm -f $COPY_FILE 2>/dev/null + rm -f $METADUMP_FILE $COPY_FILE + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/287 +3 -4
@@ -14,13 +14,12 @@ _begin_fstest auto dump quota quick . ./common/quota . ./common/dump -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { _cleanup_dump - cd / - rm -rf $tmp.* + _cleanup } +_register_cleanup _dump_cleanup _print_projid() {
tests/xfs/289 +9 -8
@@ -10,16 +10,17 @@ . ./common/preamble _begin_fstest growfs auto quick -# Override the default cleanup function. -_cleanup() +local_cleanup() { - $UMOUNT_PROG $tmpdir - $UMOUNT_PROG $tmpbind - rmdir $tmpdir - rm -f $tmpsymlink - rmdir $tmpbind - rm -f $tmpfile + $UMOUNT_PROG $tmpdir + $UMOUNT_PROG $tmpbind + rmdir $tmpdir + rm -f $tmpsymlink + rmdir $tmpbind + rm -f $tmpfile + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/296 +4 -5
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest dump auto quick -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { - _cleanup_dump - cd / - rm -f $tmp.* + _cleanup_dump + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/299 +0 -8
@@ -15,14 +15,6 @@ _begin_fstest auto quota . ./common/filter . ./common/quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs
tests/xfs/301 +4 -5
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest auto dump -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { - _cleanup_dump - cd / - rm -f $tmp.* + _cleanup_dump + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/302 +4 -5
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest auto dump -# Override the default cleanup function. -_cleanup() +_dump_cleanup() { - _cleanup_dump - cd / - rm -f $tmp.* + _cleanup_dump + _cleanup } +_register_cleanup _dump_cleanup # Import common functions. . ./common/filter
tests/xfs/309 +0 -8
@@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/310 +3 -5
@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmap -# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanup # Import common functions. . ./common/filter
tests/xfs/311 +4 -6
@@ -13,14 +13,12 @@ . ./common/preamble _begin_fstest auto quick -# Override the default cleanup function. -_cleanup() +_dmdelay_cleanup() { - cd / - rm -f $tmp.* - _scratch_unmount > /dev/null 2>&1 - _cleanup_delay > /dev/null 2>&1 + _cleanup_delay + _cleanup } +_register_cleanup _dmdelay_cleanup # Import common functions. . ./common/dmdelay
tests/xfs/312 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/313 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/314 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/315 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/316 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/317 +0 -8
@@ -9,14 +9,6 @@ . ./common/preamble _begin_fstest auto quick rmap -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/inject
tests/xfs/318 +0 -8
@@ -9,14 +9,6 @@ . ./common/preamble _begin_fstest auto quick rw -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/inject
tests/xfs/319 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/320 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/321 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/322 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/323 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/324 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/325 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/326 +0 -8
@@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/327 +0 -8
@@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount > /dev/null 2>&1 - rm -rf $tmp.* -} - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/336 +0 -7
@@ -9,13 +9,6 @@ . ./common/preamble _begin_fstest auto rmap realtime metadump -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf "$tmp".* $metadump_file -} - # Import common functions. . ./common/filter
tests/xfs/432 +4 -4
@@ -16,12 +16,12 @@ . ./common/preamble _begin_fstest auto quick dir metadata metadump -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f "$tmp".* $metadump_file $metadump_img + rm -f $metadump_file $metadump_img + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/438 +10 -6
@@ -23,17 +23,21 @@ . ./common/preamble _begin_fstest auto quick quota -# Override the default cleanup function. -_cleanup() +_dmflakey_cleanup() +{ + _unmount_flakey + _cleanup_flakey + cleanup +} +local_cleanup() { [ -z "${interval}" ] || \ sysctl -w fs.xfs.xfssyncd_centisecs=${interval} >/dev/null 2>&1 - cd / - rm -f $tmp.* - _unmount_flakey >/dev/null 2>&1 - _cleanup_flakey > /dev/null 2>&1 + _dmflakey_cleanup } +_register_cleanup local_cleanup + # inject IO write error for the XFS filesystem except its log section make_xfs_scratch_flakey_table() {
tests/xfs/442 +5 -5
@@ -12,13 +12,13 @@ . ./common/preamble _begin_fstest auto stress clone quota -# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup } +_register_cleanup fsstress_cleanup # Import common functions. . ./common/quota
tests/xfs/447 +3 -4
@@ -9,13 +9,12 @@ . ./common/preamble _begin_fstest auto mount -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* echo 0 > /sys/fs/xfs/debug/mount_delay + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/501 +3 -4
@@ -17,13 +17,12 @@ testfile=$TEST_DIR/$seq.txt delay_knob="/sys/fs/xfs/debug/log_recovery_delay" -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / test -e "$delay_knob" && echo 0 > "$delay_knob" - rm -f $tmp.* + _cleanup } +_register_cleanup local_cleanup # Import common functions. . ./common/inject
tests/xfs/503 +4 -6
@@ -10,14 +10,12 @@ . ./common/preamble _begin_fstest auto copy metadump -_register_cleanup "_cleanup" BUS - -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -rf $tmp.* $testdir + rm -rf $testdir + _cleanup } +_register_cleanup local_cleanup BUS # Import common functions. . ./common/filter
tests/xfs/507 +5 -8
@@ -16,16 +16,13 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / - test -n "$loop_mount" && $UMOUNT_PROG $loop_mount > /dev/null 2>&1 - test -n "$loop_dev" && _destroy_loop_device $loop_dev - rm -rf $tmp.* + UMOUNT_PROG $loop_mount > /dev/null 2>&1 + test -n "$loop_dev" &&_destroy_loop_device $loop_dev + _cleanup } +_register_cleanup _loop_cleanup BUS # Import common functions. . ./common/reflink
tests/xfs/511 +0 -8
@@ -10,14 +10,6 @@ . ./common/preamble _begin_fstest auto quick quota -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount - rm -f $tmp.* -} - # Import common functions. . ./common/filter . ./common/quota
tests/xfs/512 +1 -7
@@ -10,13 +10,6 @@ . ./common/preamble _begin_fstest auto quick acl attr -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $FILE -} - # Import common functions. . ./common/filter . ./common/attr
@@ -31,6 +24,7 @@ _require_attrs _require_user FILE=$TEST_DIR/foo +rm -f $FILE echo "This is a test" > ${FILE} chmod g-r $FILE
tests/xfs/513 +5 -10
@@ -9,22 +9,17 @@ . ./common/preamble _begin_fstest auto mount -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / - rm -f $tmp.* $UMOUNT_PROG $LOOP_MNT 2>/dev/null - if [ -n "$LOOP_DEV" ];then - _destroy_loop_device $LOOP_DEV 2>/dev/null - fi - if [ -n "$LOOP_SPARE_DEV" ];then - _destroy_loop_device $LOOP_SPARE_DEV 2>/dev/null - fi + [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV + [ -n "$LOOP_SPARE_DEV" ] && _destroy_loop_device $LOOP_SPARE_DEV rm -f $LOOP_IMG rm -f $LOOP_SPARE_IMG rmdir $LOOP_MNT + _cleanup } +_register_cleanup _loop_cleanup # Import common functions. . ./common/filter
tests/xfs/514 +4 -6
@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto quick db -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* $file + rm -f $file + _cleanup } - -# Import common functions. +_register_cleanup local_cleanup # real QA test starts here _supported_fs xfs
tests/xfs/515 +4 -6
@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto quick quota -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / - rm -f $tmp.* $file + rm -f $file + _cleanup } - -# Import common functions. +_register_cleanup local_cleanup # real QA test starts here _supported_fs xfs
tests/xfs/516 +0 -7
@@ -10,13 +10,6 @@ . ./common/preamble _begin_fstest auto quick -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - cd / -} - # Import common functions. . ./common/fuzzy
tests/xfs/517 +3 -6
@@ -9,15 +9,12 @@ . ./common/preamble _begin_fstest auto quick fsmap freeze -_register_cleanup "_cleanup" BUS - -# Override the default cleanup function. -_cleanup() +local_cleanup() { - cd / $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT > /dev/null 2>&1 - rm -rf $tmp.* + _cleanup } +_register_cleanup local_cleanup BUS # Import common functions. . ./common/filter
tests/xfs/520 +0 -8
@@ -14,14 +14,6 @@ . ./common/preamble _begin_fstest auto quick clone -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - _scratch_unmount > /dev/null 2>&1 -} - # Import common functions. . ./common/filter
tests/xfs/521 +4 -4
@@ -16,14 +16,14 @@ . ./common/preamble _begin_fstest auto quick realtime growfs -# Override the default cleanup function. -_cleanup() +_loop_cleanup() { - cd / _scratch_unmount >> $seqres.full 2>&1 test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 - rm -f $tmp.* $TEST_DIR/$seq.rtvol + rm -f $TEST_DIR/$seq.rtvol + _cleanup
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.35.1
Part of the diff is not shown here. View the raw message.
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 10 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Use a local cleanup function and
_register_cleanupproperly.Remove local cleanups that just do what the standard
_cleanupand test exist does.Remove local cleanups that just remove test files and then do standard
_cleanupfunctionality.
As I mentioned in response to the cover letter, the call to _cleanup() can and I think should be chained implicitly, but I am still waiting for your response regarding the tests where generic _cleanup is not desired.
Quoted 193 lines
Signed-off-by Dave Chinner <[email protected]>--- tests/xfs/004 | 7 ------- tests/xfs/006 | 7 ++++--- tests/xfs/008 | 9 ++------- tests/xfs/009 | 7 ------- tests/xfs/009.out | 1 - tests/xfs/010 | 8 -------- tests/xfs/011 | 12 +++--------- tests/xfs/012 | 10 ++-------- tests/xfs/013 | 8 +++----- tests/xfs/014 | 8 +++----- tests/xfs/016 | 9 --------- tests/xfs/016.out | 1 - tests/xfs/017 | 7 ------- tests/xfs/019 | 8 -------- tests/xfs/019.out | 1 - tests/xfs/020 | 9 ++++----- tests/xfs/021 | 8 -------- tests/xfs/021.out | 1 - tests/xfs/022 | 7 +++---- tests/xfs/023 | 7 +++---- tests/xfs/024 | 7 +++---- tests/xfs/025 | 7 +++---- tests/xfs/026 | 7 +++---- tests/xfs/027 | 7 +++---- tests/xfs/028 | 7 +++---- tests/xfs/030 | 8 -------- tests/xfs/033 | 8 -------- tests/xfs/034 | 9 --------- tests/xfs/034.out | 1 - tests/xfs/035 | 6 +++--- tests/xfs/036 | 7 +++---- tests/xfs/037 | 7 +++---- tests/xfs/038 | 7 +++---- tests/xfs/039 | 7 +++---- tests/xfs/041 | 8 -------- tests/xfs/042 | 7 ------- tests/xfs/043 | 7 +++---- tests/xfs/046 | 7 +++---- tests/xfs/047 | 7 +++---- tests/xfs/049 | 21 +++++++++------------ tests/xfs/050 | 8 -------- tests/xfs/051 | 9 ++++----- tests/xfs/052 | 8 -------- tests/xfs/055 | 7 +++---- tests/xfs/056 | 7 +++---- tests/xfs/057 | 16 ++++++++++------ tests/xfs/059 | 7 +++---- tests/xfs/060 | 7 +++---- tests/xfs/061 | 7 +++---- tests/xfs/063 | 7 +++---- tests/xfs/064 | 7 +++---- tests/xfs/065 | 7 +++---- tests/xfs/066 | 9 ++++----- tests/xfs/068 | 7 +++---- tests/xfs/070 | 7 +++---- tests/xfs/071 | 8 -------- tests/xfs/072 | 8 -------- tests/xfs/073 | 11 +++++------ tests/xfs/074 | 8 ++++---- tests/xfs/076 | 8 -------- tests/xfs/078 | 9 +++------ tests/xfs/079 | 11 +++++------ tests/xfs/080 | 7 ------- tests/xfs/083 | 7 +++---- tests/xfs/085 | 7 +++---- tests/xfs/086 | 7 +++---- tests/xfs/087 | 7 +++---- tests/xfs/088 | 7 +++---- tests/xfs/089 | 7 +++---- tests/xfs/091 | 7 +++---- tests/xfs/093 | 7 +++---- tests/xfs/097 | 7 +++---- tests/xfs/098 | 7 +++---- tests/xfs/099 | 7 +++---- tests/xfs/100 | 7 +++---- tests/xfs/101 | 7 +++---- tests/xfs/102 | 7 +++---- tests/xfs/105 | 7 +++---- tests/xfs/112 | 7 +++---- tests/xfs/113 | 7 +++---- tests/xfs/117 | 7 +++---- tests/xfs/120 | 7 +++---- tests/xfs/123 | 7 +++---- tests/xfs/124 | 7 +++---- tests/xfs/125 | 7 +++---- tests/xfs/126 | 7 +++---- tests/xfs/129 | 9 ++++----- tests/xfs/130 | 7 +++---- tests/xfs/131 | 8 -------- tests/xfs/139 | 7 ------- tests/xfs/140 | 7 ------- tests/xfs/141 | 11 +++++------ tests/xfs/148 | 7 +++---- tests/xfs/149 | 15 ++++++++------- tests/xfs/152 | 21 +++++++++------------ tests/xfs/153 | 8 -------- tests/xfs/157 | 8 ++++---- tests/xfs/159 | 8 -------- tests/xfs/167 | 9 +++++---- tests/xfs/169 | 8 -------- tests/xfs/177 | 6 +++--- tests/xfs/181 | 10 ++++------ tests/xfs/185 | 10 +++++----- tests/xfs/188 | 8 -------- tests/xfs/189 | 8 +++----- tests/xfs/194 | 12 ------------ tests/xfs/195 | 8 +------- tests/xfs/197 | 7 +------ tests/xfs/199 | 7 ------- tests/xfs/201 | 6 ------ tests/xfs/206 | 12 ++++++------ tests/xfs/220 | 7 ------- tests/xfs/229 | 7 +------ tests/xfs/231 | 7 +++---- tests/xfs/232 | 7 +++---- tests/xfs/234 | 9 ++++----- tests/xfs/236 | 8 -------- tests/xfs/237 | 10 +++++----- tests/xfs/239 | 8 ++++---- tests/xfs/240 | 10 +++++----- tests/xfs/241 | 8 ++++---- tests/xfs/244 | 8 -------- tests/xfs/250 | 6 +++--- tests/xfs/253 | 9 --------- tests/xfs/259 | 8 +++++--- tests/xfs/260 | 11 +---------- tests/xfs/261 | 7 ------- tests/xfs/264 | 7 +++---- tests/xfs/265 | 8 -------- tests/xfs/266 | 7 +++---- tests/xfs/267 | 7 +++---- tests/xfs/268 | 8 +++----- tests/xfs/269 | 7 ------- tests/xfs/271 | 8 ++++---- tests/xfs/272 | 8 ++++---- tests/xfs/273 | 8 ++++---- tests/xfs/274 | 8 ++++---- tests/xfs/275 | 8 ++++---- tests/xfs/276 | 8 ++++---- tests/xfs/277 | 9 +++++---- tests/xfs/279 | 9 ++++----- tests/xfs/281 | 7 +++---- tests/xfs/282 | 7 +++---- tests/xfs/283 | 7 +++---- tests/xfs/284 | 10 ++++------ tests/xfs/287 | 7 +++---- tests/xfs/289 | 17 +++++++++-------- tests/xfs/296 | 9 ++++----- tests/xfs/299 | 8 -------- tests/xfs/301 | 9 ++++----- tests/xfs/302 | 9 ++++----- tests/xfs/309 | 8 -------- tests/xfs/310 | 8 +++----- tests/xfs/311 | 10 ++++------ tests/xfs/312 | 8 -------- tests/xfs/313 | 8 -------- tests/xfs/314 | 8 -------- tests/xfs/315 | 8 -------- tests/xfs/316 | 8 -------- tests/xfs/317 | 8 -------- tests/xfs/318 | 8 -------- tests/xfs/319 | 8 -------- tests/xfs/320 | 8 -------- tests/xfs/321 | 8 -------- tests/xfs/322 | 8 -------- tests/xfs/323 | 8 -------- tests/xfs/324 | 8 -------- tests/xfs/325 | 8 -------- tests/xfs/326 | 8 -------- tests/xfs/327 | 8 -------- tests/xfs/336 | 7 ------- tests/xfs/432 | 8 ++++---- tests/xfs/438 | 16 ++++++++++------ tests/xfs/442 | 10 +++++----- tests/xfs/447 | 7 +++---- tests/xfs/501 | 7 +++---- tests/xfs/503 | 10 ++++------ tests/xfs/507 | 13 +++++-------- tests/xfs/511 | 8 -------- tests/xfs/512 | 8 +------- tests/xfs/513 | 15 +++++---------- tests/xfs/514 | 10 ++++------ tests/xfs/515 | 10 ++++------ tests/xfs/516 | 7 ------- tests/xfs/517 | 9 +++------ tests/xfs/520 | 8 -------- tests/xfs/521 | 8 ++++---- tests/xfs/522 | 7 ------- tests/xfs/523 | 7 ------- tests/xfs/524 | 8 ++++----
Quoted 9 lines
tests/xfs/525 | 7 ------- tests/xfs/526 | 7 ------- tests/xfs/528 | 6 +++--- tests/xfs/530 | 6 +++--- tests/xfs/542 | 7 ++++--- tests/xfs/543 | 7 ------- tests/xfs/544 | 11 ++++++++--- 197 files changed, 477 insertions(+), 1106 deletions(-)
Wow! that cleanup is awesome and huge and was very hard to review!
Quoted 23 lines
tests/xfs/004 +0
-7@@ -11,13 +11,6 @@ _begin_fstest db auto quick status=0 -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount - rm -f $tmp.* -} - _populate_scratch() { echo "=== mkfs output ===" >>$seqres.fulltests/xfs/006 +0
-0
tests/xfs/006 line 16
Quoted 9 lines
tests/xfs/006 +1
-3@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eio # Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanup
That looks recursive.
Again, if the call to _cleanup is implicitly chained then the local function is not needed and trap can call the global _dmerror_cleanup().
Quoted 18 lines
tests/xfs/006 +3
-0+ _cleanup } # Import common functions.@@ -28,6 +27,8 @@ _require_scratch _require_dm_target error _require_fs_sysfs error/fail_at_unmount +_register_cleanup _dmerror_cleanup + _scratch_mkfs > $seqres.full 2>&1 _dmerror_init _dmerror_mounttests/xfs/008 +0
-0
tests/xfs/008 _begin_fstest rw ioctl auto quick · line 19
Quoted 8 lines
tests/xfs/008 +0
-5@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.*
It's fine to keep the test files behind, but maybe make that change more clear in commit message because it was not clear to me that there was a change of behavior when I read the commit message.
Sorry to drop this extra burden on you, but this seems important to me and I cannot add this information after the fact.
Also, it was very hard to see in this review if the test files that are not cleaned in cleanup() are cleaned in the beginning of the test or if it is not important to clean them because they are overwritten.
I did my best to try and I think there is a missing cleanup of ${OUTPUT_DIR} in the beginning of xfs/253.
Although that may already be considered a test bug, removing the cleanup of ${OUTPUT_DIR} from cleanup() will expose this bug.
[...]
Quoted 7 lines
tests/xfs/051 +0
-0@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadata
tests/xfs/051 line 17
Quoted 10 lines
tests/xfs/051 +2
-5-# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + wait
All right. I see that cleanup helpers are not consistent in calling wait after kill and in using SIGKILL. I guess we could go either way. So be it.
[...]
Quoted 10 lines
tests/xfs/310 +0
-2@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmap -# Override the default cleanup function. -_cleanup()
tests/xfs/310 line 18
Quoted 10 lines
tests/xfs/310 +3
-3+_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanup
Maybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name _dmhugedisk_cleanup() is confusing.
I'd rather keep the local function name local_cleanup in unclear cases like this one.
Thanks,
Amir.
Quoted 8 lines
tests/xfs/310 +1
-1} +_register_cleanup local_cleanup # Import common functions. . ./common/filter --2.35.1
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Use a local cleanup function and
_register_cleanupproperly.Remove local cleanups that just do what the standard
_cleanupand test exist does.
Quoted 7 lines
Quoted 2 lines
Remove local cleanups that just remove test files and then do standard
_cleanupfunctionality.As I mentioned in response to the cover letter, the call to
_cleanup()can and I think should be chained implicitly, but I am still waiting for your response regarding the tests where generic_cleanupis not desired.
Please go an look at the lore archive if vger is having problems delivering to you - the whole thread is there, as are all my responses.
[PATCH 6/8] fstests: consolidate no cleanup test setup
https://lore.kernel.org/fstests/[email protected]/T/#u
Quoted 7 lines
Quoted 7 lines
tests/xfs/006 +0
-0@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eio
Quoted 12 lines
tests/xfs/006 line 16
Quoted 7 lines
tests/xfs/006 +1
-3# Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanupThat looks recursive.
Again, if the call to_cleanupis implicitly chained then the local function is not needed and trap can call the global_dmerror_cleanup().
Yes, the local name should have been _dm_error_cleanup(), like I used elsewhere.
Quoted 19 lines
tests/xfs/008 _begin_fstest rw ioctl auto quick · line 19
Quoted 13 lines
tests/xfs/008 +0
-5@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.*It's fine to keep the test files behind, but maybe make that change more clear in commit message because it was not clear to me that there was a change of behavior when I read the commit message.
Quoted 2 lines
Sorry to drop this extra burden on you, but this seems important to me and I cannot add this information after the fact.
The point of TEST_DIR is it gathers cruft from tests so exercises filesystem aging. If the file is tiny, there's no point in removing it - all we have to do is ensure it is removed in the test setup so we have known initial state. So If that's the case, I removed the cleanup of it altogether.
Like I said, I have time to do a single classification pass across all these tests, but if I have to document every single little change I make in doing these cleanups, I'm not going to bother trying because it's too hard and takes too long.
Do you want perfect commits or do you want better infrastructure?
Quoted 4 lines
Also, it was very hard to see in this review if the test files that are not cleaned in
cleanup()are cleaned in the beginning of the test or if it is not important to clean them because they are overwritten.
All tests are required to control their initial state on the test device as many tests use the same file names and locations and there is no guarantee that the test device is clean. Hence tests must clean up during startup to ensure they have a known initial state to begin the test from.
Quoted 4 lines
I did my best to try and I think there is a missing cleanup of ${OUTPUT_DIR} in the beginning of xfs/253.
Although that may already be considered a test bug, removing the cleanup of ${OUTPUT_DIR} fromcleanup()will expose this bug.
OUTPUT_DIR="${SCRATCH_MNT}/test_${seq}"
No cleanup is needed for tests that use the scratch device.
Quoted 8 lines
Quoted 8 lines
tests/xfs/051 +0
-0@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadata
Quoted 13 lines
tests/xfs/051 line 17
Quoted 9 lines
tests/xfs/051 +2
-5-# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + waitAll right. I see that cleanup helpers are not consistent in calling wait after kill and in using SIGKILL. I guess we could go either way. So be it.
That's the whole point of these cleanups - they will be collapsed down to a single helper and then we can apply the same behaviour consistently across them all.
Quoted 8 lines
Quoted 8 lines
tests/xfs/310 +0
-0@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmap
Quoted 15 lines
tests/xfs/310 line 17
Quoted 11 lines
tests/xfs/310 +3
-5-# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.
The names I used here are for classification, so I can grep over the _register_cleanup line and easily determine all the tests use loop devices, dmflakey, dmerror, etc and then consolidate them all into a single cleanup function that works for them all. This is just the first step in that process.
Quoted 2 lines
I'd rather keep the local function name
local_cleanupin unclear cases like this one.
And that defeats the entire purpose of giving them a descriptive name at this point in time.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 28 lines
Quoted 19 lines
tests/xfs/008 _begin_fstest rw ioctl auto quick · line 19
Quoted 13 lines
tests/xfs/008 +0
-5@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.*It's fine to keep the test files behind, but maybe make that change more clear in commit message because it was not clear to me that there was a change of behavior when I read the commit message.
Quoted 2 lines
Sorry to drop this extra burden on you, but this seems important to me and I cannot add this information after the fact.
The point of
TEST_DIRis it gathers cruft from tests so exercises filesystem aging. If the file is tiny, there's no point in removing it - all we have to do is ensure it is removed in the test setup so we have known initial state. So If that's the case, I removed the cleanup of it altogether.
Quoted 6 lines
Like I said, I have time to do a single classification pass across all these tests, but if I have to document every single little change I make in doing these cleanups, I'm not going to bother trying because it's too hard and takes too long.
Do you want perfect commits or do you want better infrastructure?
I want better infrastructure.
Quoted 12 lines
Quoted 5 lines
Also, it was very hard to see in this review if the test files that are not cleaned in
cleanup()are cleaned in the beginning of the test or if it is not important to clean them because they are overwritten.All tests are required to control their initial state on the test device as many tests use the same file names and locations and there is no guarantee that the test device is clean. Hence tests must clean up during startup to ensure they have a known initial state to begin the test from.
Quoted 9 lines
Quoted 4 lines
I did my best to try and I think there is a missing cleanup of ${OUTPUT_DIR} in the beginning of xfs/253.
Although that may already be considered a test bug, removing the cleanup of ${OUTPUT_DIR} fromcleanup()will expose this bug.OUTPUT_DIR="${SCRATCH_MNT}/test_${seq}"
No cleanup is needed for tests that use the scratch device.
Ah, I missed that.
Quoted 22 lines
Quoted 8 lines
Quoted 8 lines
tests/xfs/051 +0
-0@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadataQuoted 13 lines
tests/xfs/051 line 17
Quoted 9 lines
tests/xfs/051 +2
-5-# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + waitAll right. I see that cleanup helpers are not consistent in calling wait after kill and in using SIGKILL. I guess we could go either way. So be it.
Quoted 3 lines
That's the whole point of these cleanups - they will be collapsed down to a single helper and then we can apply the same behaviour consistently across them all.
Excellent.
Quoted 31 lines
Quoted 9 lines
Quoted 9 lines
tests/xfs/310 +0
-0@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmapQuoted 15 lines
tests/xfs/310 line 17
Quoted 11 lines
tests/xfs/310 +3
-5-# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.The names I used here are for classification, so I can grep over the
_register_cleanupline and easily determine all the tests use loop devices, dmflakey, dmerror, etc and then consolidate them all into a single cleanup function that works for them all. This is just the first step in that process.
Quoted 5 lines
Quoted 2 lines
I'd rather keep the local function name
local_cleanupin unclear cases like this one.And that defeats the entire purpose of giving them a descriptive name at this point in time.
I understand. It makes a lot of sense to do that.
It is still VERY confusing that there is a helper _dmhugedisk_cleanup that SHOULD NOT be used as a trap and a helper _dmhuge_cleanup that SHOULD be used as a trap, so a better convention is needed.
I suggest that all consolidated helpers for trap will be called either _cleanup_* (like cleanup_dump) or _*_cleanup (like _fsstress_cleanup)
The problem is that there is no convetion in the common/* helpers. there are _dmhugedisk_cleanup() _dmerror_cleanup() and there are _cleanup_dump() _cleanup_delay().
Since you already converted _cleanup_dump() to be a trap trigger itself it looks like the easier way to go is to have _cleanup_* as the convention to trap callbacks, which seems like the more clear choice to me.
Hence in this patch that would be _cleanup_dmhugedisk.
Thanks,
Amir.
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 33 lines · Amir Goldstein
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
tests/xfs/310 +0
-0@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmapQuoted 15 lines
tests/xfs/310 line 17
Quoted 11 lines
tests/xfs/310 +3
-5-# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.The names I used here are for classification, so I can grep over the
_register_cleanupline and easily determine all the tests use loop devices, dmflakey, dmerror, etc and then consolidate them all into a single cleanup function that works for them all. This is just the first step in that process.Quoted 2 lines
I'd rather keep the local function name
local_cleanupin unclear cases like this one.
Quoted 7 lines
Quoted 2 lines
And that defeats the entire purpose of giving them a descriptive name at this point in time.
I understand. It makes a lot of sense to do that.
It is still VERY confusing that there is a helper_dmhugedisk_cleanupthat SHOULD NOT be used as a trap and a helper_dmhuge_cleanupthat SHOULD be used as a trap, so a better convention is needed.
I think you missed my point.
_dmhuge_cleanup() is a *temporary name*.
It will *go away* once I've processed the other 1000 tests which will also classify anything using dmhugedisk with a _dmhuge_cleanup function. It's a temporary token I can use for further classification and deduplication, nothing more, nothing less.
Quoted 6 lines
I suggest that all consolidated helpers for trap will be called either _cleanup_* (like
cleanup_dump) or _*_cleanup (like_fsstress_cleanup)The problem is that there is no convetion in the common/* helpers. there are
_dmhugedisk_cleanup()_dmerror_cleanup()and there are_cleanup_dump()_cleanup_delay().
Exactly the reason why I've used simple names and the only consistency I care about is that I use the same name for the same subsystem cleanup functions. I can't give them globally consistent names at this point and because they are temporary tokens I simply have not tried. I give it a name, copy the function into a register buffer, and then paste it into any other test that uses the same subsystem and has the same cleanup requirements.
Once I have all the tests that use dmhugedisk converted to use a local _dmhuge_cleanup function, I'll derive the commonality from them, move it into the existing cleanup function for that subsystem, and register the subsystem cleanup in those tests. _dmhuge_cleanup() then goes away forever.
Once everythign is deduplicated and common, changing names will be simple and straight forward. That's when you can argue all you want over the names of functions and I won't care one bit.
-Dave.
Signature · 2 lines
Dave Chinner [email protected]
Amir Goldstein
Reviewed-byRe: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 43 lines · Dave Chinner
Quoted 33 lines · Amir Goldstein
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
tests/xfs/310 +0
-0@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmapQuoted 15 lines
tests/xfs/310 line 17
Quoted 11 lines
tests/xfs/310 +3
-5-# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.The names I used here are for classification, so I can grep over the
_register_cleanupline and easily determine all the tests use loop devices, dmflakey, dmerror, etc and then consolidate them all into a single cleanup function that works for them all. This is just the first step in that process.Quoted 2 lines
I'd rather keep the local function name
local_cleanupin unclear cases like this one.Quoted 7 lines
Quoted 2 lines
And that defeats the entire purpose of giving them a descriptive name at this point in time.
I understand. It makes a lot of sense to do that.
It is still VERY confusing that there is a helper_dmhugedisk_cleanupthat SHOULD NOT be used as a trap and a helper_dmhuge_cleanupthat SHOULD be used as a trap, so a better convention is needed.
Quoted 9 lines
I think you missed my point.
_dmhuge_cleanup()is a *temporary name*.It will *go away* once I've processed the other 1000 tests which will also classify anything using dmhugedisk with a
_dmhuge_cleanupfunction. It's a temporary token I can use for further classification and deduplication, nothing more, nothing less.
Ok if the two confusing names are not going to co-exists I'm fine with either name.
Quoted 21 lines
Quoted 6 lines
I suggest that all consolidated helpers for trap will be called either _cleanup_* (like
cleanup_dump) or _*_cleanup (like_fsstress_cleanup)The problem is that there is no convetion in the common/* helpers. there are
_dmhugedisk_cleanup()_dmerror_cleanup()and there are_cleanup_dump()_cleanup_delay().Exactly the reason why I've used simple names and the only consistency I care about is that I use the same name for the same subsystem cleanup functions. I can't give them globally consistent names at this point and because they are temporary tokens I simply have not tried. I give it a name, copy the function into a register buffer, and then paste it into any other test that uses the same subsystem and has the same cleanup requirements.
Once I have all the tests that use dmhugedisk converted to use a local
_dmhuge_cleanupfunction, I'll derive the commonality from them, move it into the existing cleanup function for that subsystem, and register the subsystem cleanup in those tests._dmhuge_cleanup()then goes away forever.
Quoted 4 lines
Once everythign is deduplicated and common, changing names will be simple and straight forward. That's when you can argue all you want over the names of functions and I won't care one bit.
All right, please bear in mind that I try to do this review with as little nit picking as I can while still doing a professional review, so some questions need to be raised.
The work you did is huge and impressive and the review is not easy.
Anyway, after fixing the recursive _dmerror_cleanup typo, you may add:
Thanks,
Amir.
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 83 lines · Amir Goldstein
Quoted 43 lines · Dave Chinner
Quoted 33 lines · Amir Goldstein
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
tests/xfs/310 +0
-0@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmapQuoted 15 lines
tests/xfs/310 line 17
Quoted 11 lines
tests/xfs/310 +3
-5-# Override the default cleanup function. -_cleanup() +_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.The names I used here are for classification, so I can grep over the
_register_cleanupline and easily determine all the tests use loop devices, dmflakey, dmerror, etc and then consolidate them all into a single cleanup function that works for them all. This is just the first step in that process.Quoted 2 lines
I'd rather keep the local function name
local_cleanupin unclear cases like this one.Quoted 7 lines
Quoted 2 lines
And that defeats the entire purpose of giving them a descriptive name at this point in time.
I understand. It makes a lot of sense to do that.
It is still VERY confusing that there is a helper_dmhugedisk_cleanupthat SHOULD NOT be used as a trap and a helper_dmhuge_cleanupthat SHOULD be used as a trap, so a better convention is needed.Quoted 9 lines
I think you missed my point.
_dmhuge_cleanup()is a *temporary name*.It will *go away* once I've processed the other 1000 tests which will also classify anything using dmhugedisk with a
_dmhuge_cleanupfunction. It's a temporary token I can use for further classification and deduplication, nothing more, nothing less.Ok if the two confusing names are not going to co-exists I'm fine with either name.
Quoted 21 lines
Quoted 6 lines
I suggest that all consolidated helpers for trap will be called either _cleanup_* (like
cleanup_dump) or _*_cleanup (like_fsstress_cleanup)The problem is that there is no convetion in the common/* helpers. there are
_dmhugedisk_cleanup()_dmerror_cleanup()and there are_cleanup_dump()_cleanup_delay().Exactly the reason why I've used simple names and the only consistency I care about is that I use the same name for the same subsystem cleanup functions. I can't give them globally consistent names at this point and because they are temporary tokens I simply have not tried. I give it a name, copy the function into a register buffer, and then paste it into any other test that uses the same subsystem and has the same cleanup requirements.
Once I have all the tests that use dmhugedisk converted to use a local
_dmhuge_cleanupfunction, I'll derive the commonality from them, move it into the existing cleanup function for that subsystem, and register the subsystem cleanup in those tests._dmhuge_cleanup()then goes away forever.Quoted 4 lines
Once everythign is deduplicated and common, changing names will be simple and straight forward. That's when you can argue all you want over the names of functions and I won't care one bit.
Quoted 4 lines
All right, please bear in mind that I try to do this review with as little nit picking as I can while still doing a professional review, so some questions need to be raised.
The work you did is huge and impressive and the review is not easy.
Thanks Dave and Amir!
Dave did a huge and impressive change again:) The purpose of this change makes sense to me, so there's not objections from me. But it really changed too many cases, and are going to change more. So if anyone has any concern, please show your review points as early as better. Thanks.
Really appreciate Amir's help, I was bothered by COVID-19 issues during the day, just got time to read emails. You did give it a careful review line by line, and asked lots of questions (than I thought) :) That helps a lot! Compare with "it's fine but not perfect", I care about "it won't break any cases" more. So if Dave can force on his main work, keep the code stable, we can do later improvement bit by bit. As you can see, this patchset nearly affect the whole fstests, more time we take to change it, more patch conflicts might happen. Then Dave might need to do more 'rebase' jobs.
I'll give it lots of testing (although I'm sure Dave did test) before merging. I'll try to help it catch the fstests release of this week. But that depends on when we have the lastest version, and how stable this patchset is :)
Thanks,
Zorro
Quoted 8 lines
Anyway, after fixing the recursive
_dmerror_cleanuptypo, you may add:Reviewed-by Amir Goldstein <[email protected]>Thanks,
Amir.
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
In reply to Amir GoldsteinQuoted 3 lines · Amir Goldstein
Quoted 1 line · Dave Chinner
On Tue, May 24, 2022 at 03:55:47PM +0300, Amir Goldstein wrote:
The work you did is huge and impressive and the review is not easy.
I disagree - it's not huge or impressive, it's just 4 hours of *basic grunt work*. It's not difficult, it's not complex, it's just time consuming. *Anyone* can do this.
The problem fstests has is *nobody* is doing these sorts of maintenance tasks. We keep adding more tests and with them mountains of technical debt, yet nobody wants to take any responsibility for addressing the technical debt.
I'm doing this because over the past year auto group runtimes on my test machines have increased by about 40%. What took a little over 2 hours is now taking 3.5 hours on the same machines running on the same hardware with the same VM configs. That's not sustainable - we have to address the problems that ever increasing number of tests is causing, otherwise fstests slowly loses it's utility for filesysetm developers. Iteration speed is everything when developing new code, and fstests runtime is now my biggest impediment to ongoing productivity.
Everyone should be looking to improve fstests infrastructure and address tests that take too long on their systems. I've haven't got to that yet, but about a dozen tests are now responsible for 30% of the total auto group runtime. Those tests need to be refined so they don't take 5-10 minutes to run each - they need to be adjusted to work with TIME_FACTOR and/or LOAD_FACTOR so that they run in a minute on normal tests and can then run for long times/under high load when asked to do so with TIME_FACTOR/LOAD_FACTOR.
This is the day-to-day maintenance stuff that just isn't getting done. Creating new tests is all well and good, but they don't come for free. As the test count goes up, everyone needs to do their little bit to streamline the way tests run. Otherwise we just end up where we are now with ongoing runtime creep and no easy way to address it.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 6 lines · Dave Chinner
Quoted 3 lines · Amir Goldstein
Quoted 1 line · Dave Chinner
On Tue, May 24, 2022 at 03:55:47PM +0300, Amir Goldstein wrote:
The work you did is huge and impressive and the review is not easy.
Quoted 9 lines
I disagree - it's not huge or impressive, it's just 4 hours of *basic grunt work*. It's not difficult, it's not complex, it's just time consuming. *Anyone* can do this.
The problem fstests has is *nobody* is doing these sorts of maintenance tasks. We keep adding more tests and with them mountains of technical debt, yet nobody wants to take any responsibility for addressing the technical debt.
Well said.
And it is a sad reality that xfs maintainers are the ones having to clean up the mess. I'd imagine the xfs maintainer's pile is large enough as it is...
It doesn't have to be this way.
I have said it in LSFMM in "Maintainers don't scale" session lead by Josef (who stood in for Darrick) - Tech companies have many filesystem developers on the payroll. They also contribute resources to KernelCI and LTP. I think it is a matter of communicating to our managers that full/part time fstests developers on the payroll are a good way to meet their goals.
Coming from fstests, when I first started working with LTP (for fanotify tests) I was amazed by the different experience:
- Several LTP developers constantly working to improve the infrastructure
- LTP developers reviewing merging and later improving the tests that you post
- At some point, I saw a statement encouraging kernel developers to post reproducer in any form they see fit and the LTP developers will make it into an LTP test
Good will of developers and weekend projects can only get us so far. If we want fstests to scale as a project, we need to nudge our managers to allocate headcount for dedicated fstests work.
For that matter, I also consider the work on "fstests runners'' (i.e. fstests-bld
and kdevops) as "fstests work", because making fstest more accessible to a wide audience will encourage more people to improve fstests itself.
Thanks,
Amir.
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
In reply to Amir GoldsteinQuoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Use a local cleanup function and
_register_cleanupproperly.Remove local cleanups that just do what the standard
_cleanupand test exist does.
Quoted 13 lines
Quoted 2 lines
Remove local cleanups that just remove test files and then do standard
_cleanupfunctionality.As I mentioned in response to the cover letter, the call to
_cleanup()can and I think should be chained implicitly, but I am still waiting for your response regarding the tests where generic_cleanupis not desired.Quoted 5 lines
Signed-off-by Dave Chinner <[email protected]>--- tests/xfs/004 | 7 ------- tests/xfs/006 | 7 ++++---
[snap]
Quoted 7 lines
Quoted 7 lines
tests/xfs/006 +0
-0@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eio
Quoted 9 lines
tests/xfs/006 line 16
Quoted 7 lines
tests/xfs/006 +1
-3# Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanupThat looks recursive.
Yes, but this _dmerror_cleanup() won't be run. This function will be covered by the _dmerror_cleanup() in common/dmerror, when this case ". ./common/dmerror" several lines later. So the later _cleanup won't be run. So this place and other places similar with this need to change.
Thanks,
Zorro
Quoted 116 lines
Again, if the call to
_cleanupis implicitly chained then the local function is not needed and trap can call the global_dmerror_cleanup().Quoted 18 lines
tests/xfs/006 +3
-0+ _cleanup } # Import common functions.@@ -28,6 +27,8 @@ _require_scratch _require_dm_target error _require_fs_sysfs error/fail_at_unmount +_register_cleanup _dmerror_cleanup + _scratch_mkfs > $seqres.full 2>&1 _dmerror_init _dmerror_mounttests/xfs/008 +0
-0tests/xfs/008 _begin_fstest rw ioctl auto quick · line 19
Quoted 8 lines
tests/xfs/008 +0
-5@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.*It's fine to keep the test files behind, but maybe make that change more clear in commit message because it was not clear to me that there was a change of behavior when I read the commit message.
Sorry to drop this extra burden on you, but this seems important to me and I cannot add this information after the fact.
Also, it was very hard to see in this review if the test files that are not cleaned in
cleanup()are cleaned in the beginning of the test or if it is not important to clean them because they are overwritten.I did my best to try and I think there is a missing cleanup of ${OUTPUT_DIR} in the beginning of xfs/253.
Although that may already be considered a test bug, removing the cleanup of ${OUTPUT_DIR} fromcleanup()will expose this bug.[...]
Quoted 7 lines
tests/xfs/051 +0
-0@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadatatests/xfs/051 line 17
Quoted 10 lines
tests/xfs/051 +2
-5-# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + waitAll right. I see that cleanup helpers are not consistent in calling wait after kill and in using SIGKILL. I guess we could go either way. So be it.
[...]
Quoted 10 lines
tests/xfs/310 +0
-2@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmap -# Override the default cleanup function. -_cleanup()tests/xfs/310 line 18
Quoted 10 lines
tests/xfs/310 +3
-3+_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.I'd rather keep the local function name
local_cleanupin unclear cases like this one.Thanks,
Amir.Quoted 8 lines
tests/xfs/310 +1
-1} +_register_cleanup local_cleanup # Import common functions. . ./common/filter --2.35.1
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 43 lines · Zorro Lang
Quoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Use a local cleanup function and
_register_cleanupproperly.Remove local cleanups that just do what the standard
_cleanupand test exist does.Quoted 13 lines
Quoted 2 lines
Remove local cleanups that just remove test files and then do standard
_cleanupfunctionality.As I mentioned in response to the cover letter, the call to
_cleanup()can and I think should be chained implicitly, but I am still waiting for your response regarding the tests where generic_cleanupis not desired.Quoted 5 lines
Signed-off-by Dave Chinner <[email protected]>--- tests/xfs/004 | 7 ------- tests/xfs/006 | 7 ++++---[snap]
Quoted 7 lines
Quoted 7 lines
tests/xfs/006 +0
-0@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eioQuoted 9 lines
tests/xfs/006 line 16
Quoted 7 lines
tests/xfs/006 +1
-3# Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanupThat looks recursive.
Quoted 4 lines
Yes, but this
_dmerror_cleanup()won't be run. This function will be covered by the_dmerror_cleanup()in common/dmerror, when this case ". ./common/dmerror" several lines later. So the later_cleanupwon't be run. So this place and other places similar with this need to change.
Hi Dave,
Are you going to fix this issue or making more changes on this patchset? If not, I'll merge this patchset tomorrow (Friday) by changing above _dmerror_cleanup to _dm_error_cleanup. Then give merged patches a regression on Saturday. What do you think?
Thanks,
Zorro
Quoted 120 lines
Thanks,
ZorroQuoted 116 lines
Again, if the call to
_cleanupis implicitly chained then the local function is not needed and trap can call the global_dmerror_cleanup().Quoted 18 lines
tests/xfs/006 +3
-0+ _cleanup } # Import common functions.@@ -28,6 +27,8 @@ _require_scratch _require_dm_target error _require_fs_sysfs error/fail_at_unmount +_register_cleanup _dmerror_cleanup + _scratch_mkfs > $seqres.full 2>&1 _dmerror_init _dmerror_mounttests/xfs/008 +0
-0tests/xfs/008 _begin_fstest rw ioctl auto quick · line 19
Quoted 8 lines
tests/xfs/008 +0
-5@@ -12,13 +12,6 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - rm -rf $TEST_DIR/randholes.$$.*It's fine to keep the test files behind, but maybe make that change more clear in commit message because it was not clear to me that there was a change of behavior when I read the commit message.
Sorry to drop this extra burden on you, but this seems important to me and I cannot add this information after the fact.
Also, it was very hard to see in this review if the test files that are not cleaned in
cleanup()are cleaned in the beginning of the test or if it is not important to clean them because they are overwritten.I did my best to try and I think there is a missing cleanup of ${OUTPUT_DIR} in the beginning of xfs/253.
Although that may already be considered a test bug, removing the cleanup of ${OUTPUT_DIR} fromcleanup()will expose this bug.[...]
Quoted 7 lines
tests/xfs/051 +0
-0@@ -11,14 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadatatests/xfs/051 line 17
Quoted 10 lines
tests/xfs/051 +2
-5-# Override the default cleanup function. -_cleanup() +_fsstress_cleanup() { - cd / - rm -f $tmp.* $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 + waitAll right. I see that cleanup helpers are not consistent in calling wait after kill and in using SIGKILL. I guess we could go either way. So be it.
[...]
Quoted 10 lines
tests/xfs/310 +0
-2@@ -9,14 +9,12 @@ . ./common/preamble _begin_fstest auto clone rmap -# Override the default cleanup function. -_cleanup()tests/xfs/310 line 18
Quoted 10 lines
tests/xfs/310 +3
-3+_dmhuge_cleanup() { - cd / - umount $SCRATCH_MNT > /dev/null 2>&1 _dmhugedisk_cleanup - rm -rf $tmp.* + _cleanup } +_register_cleanup _dmhuge_cleanupMaybe it's just me, but if the intention is to maybe make this function global someday then the difference with the name
_dmhugedisk_cleanup()is confusing.I'd rather keep the local function name
local_cleanupin unclear cases like this one.Thanks,
Amir.Quoted 8 lines
tests/xfs/310 +1
-1} +_register_cleanup local_cleanup # Import common functions. . ./common/filter --2.35.1
Re: [PATCH 3/8] xfs/*: clean up _cleanup override
Quoted 49 lines · Zorro Lang
Quoted 43 lines · Zorro Lang
Quoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Use a local cleanup function and
_register_cleanupproperly.Remove local cleanups that just do what the standard
_cleanupand test exist does.Quoted 13 lines
Quoted 2 lines
Remove local cleanups that just remove test files and then do standard
_cleanupfunctionality.As I mentioned in response to the cover letter, the call to
_cleanup()can and I think should be chained implicitly, but I am still waiting for your response regarding the tests where generic_cleanupis not desired.Quoted 5 lines
Signed-off-by Dave Chinner <[email protected]>--- tests/xfs/004 | 7 ------- tests/xfs/006 | 7 ++++---[snap]
Quoted 7 lines
Quoted 7 lines
tests/xfs/006 +0
-0@@ -11,11 +11,10 @@ _begin_fstest auto quick mount eioQuoted 9 lines
tests/xfs/006 line 16
Quoted 7 lines
tests/xfs/006 +1
-3# Override the default cleanup function. -_cleanup() +_dmerror_cleanup() { - cd / - rm -f $tmp.* _dmerror_cleanupThat looks recursive.
Quoted 4 lines
Yes, but this
_dmerror_cleanup()won't be run. This function will be covered by the_dmerror_cleanup()in common/dmerror, when this case ". ./common/dmerror" several lines later. So the later_cleanupwon't be run. So this place and other places similar with this need to change.
Quoted 6 lines
Hi Dave,
Are you going to fix this issue or making more changes on this patchset? If not, I'll merge this patchset tomorrow (Friday) by changing above
_dmerror_cleanupto_dm_error_cleanup. Then give merged patches a regression on Saturday. What do you think?
I posted this patchset as an RFC, not as a candidate for merging. It's not ready for merging yet.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH 4/8 fstests: define a common _dump_cleanup function
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Almost all xfsdump tests now use the same cleanup function. Deduplicate them.
--- common/dump | 53 ++++++++++++++++++++++++++------------------------- tests/xfs/022 | 12 ++---------- tests/xfs/023 | 13 ++----------- tests/xfs/024 | 12 ++---------- tests/xfs/025 | 12 ++---------- tests/xfs/026 | 12 ++---------- tests/xfs/027 | 12 ++---------- tests/xfs/028 | 12 ++---------- tests/xfs/035 | 10 +--------- tests/xfs/036 | 9 +-------- tests/xfs/037 | 10 +--------- tests/xfs/038 | 9 +-------- tests/xfs/039 | 9 +-------- tests/xfs/043 | 9 +-------- tests/xfs/046 | 9 +-------- tests/xfs/047 | 9 +-------- tests/xfs/055 | 9 +-------- tests/xfs/056 | 11 +---------- tests/xfs/059 | 12 ++---------- tests/xfs/060 | 12 ++---------- tests/xfs/061 | 12 ++---------- tests/xfs/063 | 9 ++------- tests/xfs/064 | 9 ++------- tests/xfs/065 | 9 ++------- tests/xfs/066 | 11 +++-------- tests/xfs/068 | 12 ++---------- tests/xfs/266 | 14 +++----------- tests/xfs/267 | 13 +++---------- tests/xfs/268 | 12 +++--------- tests/xfs/281 | 9 +-------- tests/xfs/282 | 9 +-------- tests/xfs/283 | 9 +-------- tests/xfs/287 | 11 +++-------- tests/xfs/296 | 11 ++--------- tests/xfs/301 | 11 ++--------- tests/xfs/302 | 11 ++--------- tests/xfs/544 | 10 ++-------- 37 files changed, 91 insertions(+), 347 deletions(-)
common/dump +27 -26
@@ -219,41 +219,42 @@ _require_tape() # # Cleanup created dirs and files -# Called by trap -# +# Called by trap, needs to call generic cleanup when done. _cleanup_dump() { - # Some tests include this before checking _supported_fs xfs - # and the sleeps & checks here get annoying - if [ "$FSTYP" != "xfs" ]; then - return - fi + # Some tests include this before checking _supported_fs xfs + # and the sleeps & checks here get annoying + if [ "$FSTYP" != "xfs" ]; then + return + fi - cd $here + cd $here + + if [ -n "$DEBUGDUMP" ]; then + # save it for inspection + for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do + [ -d $dir ] || continue + tar -cvf $seqres.inventory.tar $dir + ls -nR $dir >$seqres.inventory.ls + done + fi - if [ -n "$DEBUGDUMP" ]; then - # save it for inspection + # put inventory dir back for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do - [ -d $dir ] || continue - tar -cvf $seqres.inventory.tar $dir - ls -nR $dir >$seqres.inventory.ls + [ -d $dir.$seq ] || continue + rm -rf $dir # get rid of new one + mv $dir.$seq $dir done - fi - # put inventory dir back - for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do - [ -d $dir.$seq ] || continue - rm -rf $dir # get rid of new one - mv $dir.$seq $dir - done + if [ -f ${RESULT_DIR}/require_scratch ] && [ $status -ne $NOTRUNSTS ]; then + # Sleep added to stop _check_scratch_fs from complaining that + # the scratch_dev is still busy + sleep 10 - if [ -f ${RESULT_DIR}/require_scratch ] && [ $status -ne $NOTRUNSTS ]; then - # Sleep added to stop _check_scratch_fs from complaining that the - # scratch_dev is still busy - sleep 10 + _check_scratch_fs + fi - _check_scratch_fs - fi + _cleanup } #
tests/xfs/022 +2 -10
@@ -9,20 +9,11 @@ # # Use fsstress to create a directory structure with a mix of files # -seqfull=$0 . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -42,4 +33,5 @@ _do_restore | sed -e "/entries processed$/s/[0-9][0-9]*/NUM/g" _ls_compare_sub # success, all done +status=0 exit
tests/xfs/023 +2 -11
@@ -7,21 +7,11 @@ # To test xfsdump/restore to tape using a directory with # files with data created by src/fill. # -seqfull=$0 . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -38,4 +28,5 @@ _diff_compare_sub _ls_compare_sub # success, all done +status=0 exit
tests/xfs/024 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -42,4 +33,5 @@ _do_restore _diff_compare # success, all done +status=0 exit
tests/xfs/025 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -35,4 +26,5 @@ _do_restore_min _diff_compare # success, all done +status=0 exit
tests/xfs/026 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -33,4 +24,5 @@ _do_restore_file _diff_compare # success, all done +status=0 exit
tests/xfs/027 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -32,4 +23,5 @@ _do_dump_restore _diff_compare_sub # success, all done +status=0 exit
tests/xfs/028 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -56,4 +47,5 @@ _do_invutil -F _dump_inventory # success, all done +status=0 exit
tests/xfs/035 +1 -9
@@ -10,16 +10,8 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl tape auto -# Override the default cleanup function. -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/036 +1 -8
@@ -10,15 +10,8 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/037 +1 -9
@@ -9,16 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl remote tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump - +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/038 +1 -8
@@ -9,15 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl remote tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/039 +1 -8
@@ -10,15 +10,8 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/043 +1 -8
@@ -12,15 +12,8 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/046 +1 -8
@@ -9,15 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/047 +1 -8
@@ -9,15 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/055 +1 -8
@@ -10,15 +10,8 @@ seqfull=$0 . ./common/preamble _begin_fstest dump ioctl remote tape -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/056 +1 -10
@@ -10,17 +10,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/059 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -36,4 +27,5 @@ _ls_compare_sub _diff_compare # success, all done +status=0 exit
tests/xfs/060 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -42,4 +33,5 @@ _ls_compare_sub _diff_compare # success, all done +status=0 exit
tests/xfs/061 +2 -10
@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -40,4 +31,5 @@ _diff_compare_sub _ls_nodate_compare_sub # success, all done +status=0 exit
tests/xfs/063 +2 -7
@@ -9,16 +9,11 @@ . ./common/preamble _begin_fstest dump attr auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump . ./common/attr # real QA test starts here
tests/xfs/064 +2 -7
@@ -9,16 +9,11 @@ . ./common/preamble _begin_fstest dump auto -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump _ls_size_filter() {
tests/xfs/065 +2 -7
@@ -12,16 +12,11 @@ . ./common/preamble _begin_fstest dump auto -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump . ./common/quota #
tests/xfs/066 +3 -8
@@ -9,16 +9,11 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -# Import common functions. -. ./common/filter . ./common/dump +_register_cleanup _cleanup_dump -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs xfs
tests/xfs/068 +2 -10
@@ -10,20 +10,11 @@ # Test for regression caused by # c7cb51d xfs: fix error handling at xfs_inumbers # -seqfull=$0 . ./common/preamble _begin_fstest auto stress dump -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
@@ -44,4 +35,5 @@ _count_restoredir_files | tee $tmp.after >> $seqres.full diff -u $tmp.before $tmp.after # success, all done +status=0 exit
tests/xfs/266 +3 -11
@@ -9,14 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # # Add a new file and append a subset of the fill'ed files
@@ -44,9 +38,6 @@ filter_cumulative_quota_updates() { {print}' } -# Import common functions. -. ./common/dump - # real QA test starts here _supported_fs xfs _require_scratch
@@ -71,4 +62,5 @@ _ls_compare_sub _diff_compare # success, all done +status=0 exit
tests/xfs/267 +3 -10
@@ -9,16 +9,9 @@ . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump -# # create a 40 MiB file with an extended attr. # xfsdump writes file data in "extent groups", currently 16 MiB in size. After # writing an extent group or finishing a file, xfsdump will start a new media
@@ -38,7 +31,6 @@ End-of-File } # Import common functions. -. ./common/dump . ./common/attr # real QA test starts here
@@ -59,4 +51,5 @@ _diff_compare _diff_compare_eas # success, all done +status=0 exit
tests/xfs/268 +3 -9
@@ -11,14 +11,8 @@ . ./common/preamble _begin_fstest dump ioctl tape -status=0 # success is the default! - -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # create two 12 MiB files with extended attrs. # xfsdump writes file data in "extent groups", currently 16 MiB in size. After
@@ -40,7 +34,6 @@ End-of-File } # Import common functions. -. ./common/dump . ./common/attr # real QA test starts here
@@ -61,4 +54,5 @@ _diff_compare _diff_compare_eas # success, all done +status=0 exit
tests/xfs/281 +1 -8
@@ -9,15 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/282 +1 -8
@@ -11,15 +11,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/283 +1 -8
@@ -11,15 +11,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup - -# Import common functions. . ./common/dump +_register_cleanup _cleanup_dump # real QA test starts here _supported_fs xfs
tests/xfs/287 +3 -8
@@ -10,16 +10,11 @@ . ./common/preamble _begin_fstest auto dump quota quick -# Import common functions. -. ./common/quota . ./common/dump +_register_cleanup _cleanup_dump -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +# Import common functions. +. ./common/quota _print_projid() {
tests/xfs/296 +2 -9
@@ -9,20 +9,13 @@ . ./common/preamble _begin_fstest dump auto quick -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_scratch _require_command "$SETCAP_PROG" setcap
tests/xfs/301 +2 -9
@@ -9,21 +9,14 @@ . ./common/preamble _begin_fstest auto dump -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump . ./common/attr # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_scratch _scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
tests/xfs/302 +2 -9
@@ -9,20 +9,13 @@ . ./common/preamble _begin_fstest auto dump -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} -_register_cleanup _dump_cleanup +. ./common/dump +_register_cleanup _cleanup_dump # Import common functions. . ./common/filter -. ./common/dump # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_scratch _scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
tests/xfs/544 +2 -8
@@ -10,27 +10,21 @@ . ./common/preamble _begin_fstest auto quick dump -_dump_cleanup() -{ - _cleanup_dump - _cleanup -} +. ./common/dump local_cleanup() { $UMOUNT_PROG $TEST_DIR/dest.$seq 2> /dev/null rmdir $TEST_DIR/src.$seq 2> /dev/null rmdir $TEST_DIR/dest.$seq 2> /dev/null - _dump_cleanup + _cleanup_dump } _register_cleanup local_cleanup # Import common functions. . ./common/filter -. ./common/dump # real QA test starts here - _supported_fs xfs # Setup
Signature · 1 line
2.35.1
Re: [PATCH 4/8] fstests: define a common _dump_cleanup function
Quoted 38 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Almost all xfsdump tests now use the same cleanup function. Deduplicate them.
Signed-off-by Dave Chinner <[email protected]>--- common/dump | 53 ++++++++++++++++++++++++++------------------------- tests/xfs/022 | 12 ++---------- tests/xfs/023 | 13 ++----------- tests/xfs/024 | 12 ++---------- tests/xfs/025 | 12 ++---------- tests/xfs/026 | 12 ++---------- tests/xfs/027 | 12 ++---------- tests/xfs/028 | 12 ++---------- tests/xfs/035 | 10 +--------- tests/xfs/036 | 9 +-------- tests/xfs/037 | 10 +--------- tests/xfs/038 | 9 +-------- tests/xfs/039 | 9 +-------- tests/xfs/043 | 9 +-------- tests/xfs/046 | 9 +-------- tests/xfs/047 | 9 +-------- tests/xfs/055 | 9 +-------- tests/xfs/056 | 11 +---------- tests/xfs/059 | 12 ++---------- tests/xfs/060 | 12 ++---------- tests/xfs/061 | 12 ++---------- tests/xfs/063 | 9 ++------- tests/xfs/064 | 9 ++------- tests/xfs/065 | 9 ++------- tests/xfs/066 | 11 +++-------- tests/xfs/068 | 12 ++---------- tests/xfs/266 | 14 +++----------- tests/xfs/267 | 13 +++---------- tests/xfs/268 | 12 +++--------- tests/xfs/281 | 9 +--------
Quoted 9 lines
tests/xfs/282 | 9 +-------- tests/xfs/283 | 9 +-------- tests/xfs/287 | 11 +++-------- tests/xfs/296 | 11 ++--------- tests/xfs/301 | 11 ++--------- tests/xfs/302 | 11 ++--------- tests/xfs/544 | 10 ++-------- 37 files changed, 91 insertions(+), 347 deletions(-)
Nice cleanup!
See one question below...
[...]
tests/xfs/026 line 13
Quoted 10 lines
tests/xfs/026 +0
-2@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick -status=0 # success is the default! -
All those tests that you change from success is the default to failure is the default, that makes sense, but
1. Should be documented in the commit message?
2. Why were those tests written this way? Do you know?
Thanks,
Amir.
Re: [PATCH 4/8] fstests: define a common _dump_cleanup function
Quoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
tests/xfs/026 +0
-0@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quick
Quoted 6 lines
tests/xfs/026 line 13
Quoted 2 lines
tests/xfs/026 +0
-2-status=0 # success is the default! -All those tests that you change from success is the default to failure is the default, that makes sense, but
1. Should be documented in the commit message?
I cleaned up a bunch of random stuff like this as I went along. If I try to document every little change that gets done, I'll be spending more time on describing the changes than actually doing them. I don't have the time to rigourously document this stuff - I've got the time to modify the code, write an overview of the changes and that's about it.
What does the fstests community want: better test infrastructure or perfect commits?
Quoted 1 line
2. Why were those tests written this way? Do you know?
That's just the pattern that was used by the team that wrote these dump tests 20-odd years ago. At the time nobody cared that much about little inconsistencies like this as long as the test failed when something went wrong. i.e. test works, merge it, move on to the next thing.
Now that we have ~1700 tests to maintain, little inconsistencies are a big deal. That's why I cleaned up the simple ones as I saw them...
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 4/8] fstests: define a common _dump_cleanup function
Quoted 25 lines · Dave Chinner
Quoted 9 lines · Amir Goldstein
Quoted 8 lines · Dave Chinner
tests/xfs/026 +0
-0@@ -9,17 +9,8 @@ . ./common/preamble _begin_fstest dump ioctl auto quickQuoted 6 lines
tests/xfs/026 line 13
Quoted 2 lines
tests/xfs/026 +0
-2-status=0 # success is the default! -All those tests that you change from success is the default to failure is the default, that makes sense, but
1. Should be documented in the commit message?I cleaned up a bunch of random stuff like this as I went along. If I try to document every little change that gets done, I'll be spending more time on describing the changes than actually doing them. I don't have the time to rigourously document this stuff - I've got the time to modify the code, write an overview of the changes and that's about it.
Quoted 2 lines
What does the fstests community want: better test infrastructure or perfect commits?
The former :)
Quoted 12 lines
Quoted 2 lines
2. Why were those tests written this way? Do you know?
That's just the pattern that was used by the team that wrote these dump tests 20-odd years ago. At the time nobody cared that much about little inconsistencies like this as long as the test failed when something went wrong. i.e. test works, merge it, move on to the next thing.
Now that we have ~1700 tests to maintain, little inconsistencies are a big deal. That's why I cleaned up the simple ones as I saw them...
That's super.
Thank you for that.
The reason I am asking is that with kdevops, we observed some inconsistencies between xunit reported failures and overall run success/failure.
I was wondering if tests that initialize status=0 could be the source of these inconsistencies.
Thanks,
Amir.
PATCH 5/8 fstests: use a common fsstress cleanup function
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Lots of tests now have a common cleanup function for fsstress based tests. Define a common cleanup function in common/preamble and convert those tests to register it.
--- common/preamble | 11 +++++++++++ tests/xfs/011 | 7 ------- tests/xfs/013 | 9 +-------- tests/xfs/051 | 11 ++--------- tests/xfs/057 | 9 --------- tests/xfs/079 | 11 +---------- tests/xfs/141 | 11 +---------- tests/xfs/167 | 9 +-------- tests/xfs/442 | 11 ++--------- 9 files changed, 19 insertions(+), 70 deletions(-)
common/preamble +11 -0
@@ -13,6 +13,17 @@ _cleanup() rm -r -f $tmp.* } +# 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 +# own local cleanup functions. +_fsstress_cleanup() +{ + $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 + wait + _cleanup +} + # Install the supplied cleanup code as a signal handler for HUP, INT, QUIT, # TERM, or when the test exits. Extra signals can be specified as subsequent # parameters.
tests/xfs/011 +0 -7
@@ -10,13 +10,6 @@ # . ./common/preamble _begin_fstest auto freeze log metadata quick - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 fsstress 2>/dev/null - wait - _cleanup -} _register_cleanup _fsstress_cleanup # Use the information exported by XFS to sysfs to determine whether the log has
tests/xfs/013 +1 -8
@@ -12,18 +12,11 @@ # . ./common/preamble _begin_fstest auto metadata stress +_register_cleanup _fsstress_cleanup # Import common functions. . ./common/filter -_fsstress_cleanup() -{ - $KILLALL_PROG -9 fsstress 2>/dev/null - wait - _cleanup -} -_register_cleanup _fsstress_cleanup - filter_enospc() { sed -e '/^.*No space left on device.*/d' }
tests/xfs/051 +2 -9
@@ -10,19 +10,12 @@ # . ./common/preamble _begin_fstest shutdown auto log metadata - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} -_register_cleanup fsstress_cleanup +_register_cleanup _fsstress_cleanup # Import common functions. . ./common/dmflakey -# Modify as appropriate. +# real QA test starts here _supported_fs xfs _require_scratch
tests/xfs/057 +0 -9
@@ -23,13 +23,6 @@ . ./common/preamble _begin_fstest auto log recoveryloop -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} - local_cleanup() { [ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] &&
@@ -42,8 +35,6 @@ _register_cleanup local_cleanup . ./common/inject # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_xfs_io_error_injection log_item_pin _require_xfs_io_error_injection log_bad_crc
tests/xfs/079 +1 -10
@@ -16,21 +16,12 @@ # . ./common/preamble _begin_fstest shutdown auto log quick - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} -_register_cleanup fsstress_cleanup +_register_cleanup _fsstress_cleanup # Import common functions. . ./common/log # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_scratch _require_v2log
tests/xfs/141 +1 -10
@@ -13,21 +13,12 @@ # . ./common/preamble _begin_fstest auto log metadata - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} -_register_cleanup fsstress_cleanup +_register_cleanup _fsstress_cleanup # Import common functions. . ./common/inject # real QA test starts here - -# Modify as appropriate. _supported_fs xfs _require_xfs_io_error_injection "log_bad_crc" _require_scratch
tests/xfs/167 +1 -8
@@ -8,14 +8,7 @@ # . ./common/preamble _begin_fstest rw metadata auto stress - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} -_register_cleanup fsstress_cleanup +_register_cleanup _fsstress_cleanup workout() {
tests/xfs/442 +2 -9
@@ -11,21 +11,14 @@ # . ./common/preamble _begin_fstest auto stress clone quota - -_fsstress_cleanup() -{ - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - wait - _cleanup -} -_register_cleanup fsstress_cleanup +_register_cleanup _fsstress_cleanup # Import common functions. . ./common/quota . ./common/filter . ./common/reflink -# Modify as appropriate. +# real QA test starts here _supported_fs xfs _require_scratch_reflink
Signature · 1 line
2.35.1
Re: [PATCH 5/8] fstests: use a common fsstress cleanup function
Quoted 9 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Lots of tests now have a common cleanup function for fsstress based tests. Define a common cleanup function in common/preamble and convert those tests to register it.
Signed-off-by Dave Chinner <[email protected]>---
Makes sense.
Thanks,
Amir.
PATCH 6/8 fstests: consolidate no cleanup test setup
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
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.
--- 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(-)
common/preamble +9 -0
@@ -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
tests/xfs/083 +0 -5
@@ -10,11 +10,6 @@ # . ./common/preamble _begin_fstest dangerous_fuzzers punch - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/085 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/086 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/087 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/088 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/089 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/091 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/093 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/097 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/098 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/099 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/100 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/101 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/102 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/105 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/112 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/113 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/117 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/120 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/123 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/124 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/125 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/126 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
tests/xfs/130 +0 -5
@@ -9,11 +9,6 @@ # . ./common/preamble _begin_fstest fuzzers clone - -_no_cleanup() -{ - cd / -} _register_cleanup _no_cleanup # Import common functions.
Signature · 1 line
2.35.1
Re: [PATCH 6/8] fstests: consolidate no cleanup test setup
Quoted 27 lines · Dave Chinner
From: Dave Chinner <[email protected]>
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 <[email protected]>--- 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 -----
Quoted 9 lines
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(-)
I propose to use a dedicated helper _unregister_cleanup to opt out of _cleanup and still leave _cleanup implicit for all the rest of the tests, but I will not stop merging this cleanup on account of this suggestion. It could be done by a followup cleanup as well, so unless you want to take my suggestion
Thanks,
Amir.
Re: [PATCH 6/8] fstests: consolidate no cleanup test setup
Quoted 38 lines · Amir Goldstein
Quoted 27 lines · Dave Chinner
From: Dave Chinner <[email protected]>
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 <[email protected]>--- 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 -----Quoted 9 lines
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(-)
Quoted 5 lines
I propose to use a dedicated helper
_unregister_cleanupto opt out of_cleanupand still leave_cleanupimplicit for all the rest of the tests, but I will not stop merging this cleanup on account of this suggestion. It could be done by a followup cleanup as well, so unless you want to take my suggestion
Cart before the horse. There's another 1000 tests I haven't even looked at yet, and there's still a heap of work to derive commonality from the remaining 100 xfs tests that have a random assortment of loop, local, dm, etc cleanup functions.
I'm trying to focus on cleaning up and deduplicating the tests, not whether there's an exactly optimal API for a specific cleanup function. Once everything is deduplicated, changing the cleanup API is a much, much simpler proposition. So that's the first prioirty and trivialities like "_register_cleanup _no_cleanup" vs "_unregister_cleanup" aren't even on my radar.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH 7/8 fstests: Set up BUS trap for tests by default
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
About 160 individual tests re-register the cleanup trap just to have it run on a BUS error signal. Just add the BUS signal to the default set of traps initialised by _register_cleanup() and get rid of these extra registrations.
This was mostly done with this script:
$ for f in `git grep -l "register_cleanup.*BUS"` ; do
Quoted 2 lines
sed -i -e '/_register_cleanup "
_cleanup" BUS/,+1d' done
With a small number of non-matching conversions done by hand.
--- common/preamble | 4 ++-- tests/ext4/023 | 2 -- tests/generic/161 | 2 -- tests/generic/162 | 2 -- tests/generic/163 | 2 -- tests/generic/164 | 2 -- tests/generic/165 | 2 -- tests/generic/166 | 2 -- tests/generic/167 | 2 -- tests/generic/168 | 2 -- tests/generic/170 | 2 -- tests/generic/247 | 2 -- tests/generic/333 | 2 -- tests/generic/334 | 2 -- tests/generic/349 | 2 -- tests/generic/350 | 2 -- tests/generic/351 | 2 -- tests/generic/356 | 2 -- tests/generic/357 | 2 -- tests/generic/358 | 2 -- tests/generic/359 | 2 -- tests/generic/372 | 2 -- tests/generic/373 | 2 -- tests/generic/374 | 2 -- tests/generic/414 | 2 -- tests/generic/425 | 2 -- tests/generic/553 | 2 -- tests/generic/554 | 2 -- tests/generic/564 | 2 -- tests/generic/565 | 2 -- tests/generic/670 | 2 -- tests/generic/671 | 2 -- tests/generic/672 | 2 -- tests/xfs/017 | 2 -- tests/xfs/138 | 2 -- tests/xfs/162 | 2 -- tests/xfs/262 | 2 -- tests/xfs/280 | 2 -- tests/xfs/285 | 2 -- tests/xfs/286 | 2 -- tests/xfs/349 | 2 -- tests/xfs/350 | 2 -- tests/xfs/351 | 2 -- tests/xfs/352 | 2 -- tests/xfs/353 | 2 -- tests/xfs/354 | 2 -- tests/xfs/355 | 2 -- tests/xfs/356 | 2 -- tests/xfs/357 | 2 -- tests/xfs/358 | 2 -- tests/xfs/359 | 2 -- tests/xfs/360 | 2 -- tests/xfs/361 | 2 -- tests/xfs/362 | 2 -- tests/xfs/363 | 2 -- tests/xfs/364 | 2 -- tests/xfs/365 | 2 -- tests/xfs/366 | 2 -- tests/xfs/367 | 2 -- tests/xfs/368 | 2 -- tests/xfs/369 | 2 -- tests/xfs/370 | 2 -- tests/xfs/371 | 2 -- tests/xfs/372 | 2 -- tests/xfs/373 | 2 -- tests/xfs/374 | 2 -- tests/xfs/375 | 2 -- tests/xfs/376 | 2 -- tests/xfs/377 | 2 -- tests/xfs/378 | 2 -- tests/xfs/379 | 2 -- tests/xfs/380 | 2 -- tests/xfs/381 | 2 -- tests/xfs/382 | 2 -- tests/xfs/383 | 2 -- tests/xfs/384 | 2 -- tests/xfs/385 | 2 -- tests/xfs/386 | 2 -- tests/xfs/387 | 2 -- tests/xfs/388 | 2 -- tests/xfs/389 | 2 -- tests/xfs/390 | 2 -- tests/xfs/391 | 2 -- tests/xfs/392 | 2 -- tests/xfs/393 | 2 -- tests/xfs/394 | 2 -- tests/xfs/395 | 2 -- tests/xfs/396 | 2 -- tests/xfs/397 | 2 -- tests/xfs/398 | 2 -- tests/xfs/399 | 2 -- tests/xfs/400 | 2 -- tests/xfs/401 | 2 -- tests/xfs/402 | 2 -- tests/xfs/403 | 2 -- tests/xfs/404 | 2 -- tests/xfs/405 | 2 -- tests/xfs/406 | 2 -- tests/xfs/407 | 2 -- tests/xfs/408 | 2 -- tests/xfs/409 | 2 -- tests/xfs/410 | 2 -- tests/xfs/411 | 2 -- tests/xfs/412 | 2 -- tests/xfs/413 | 2 -- tests/xfs/414 | 2 -- tests/xfs/415 | 2 -- tests/xfs/416 | 2 -- tests/xfs/417 | 2 -- tests/xfs/418 | 2 -- tests/xfs/422 | 2 -- tests/xfs/423 | 2 -- tests/xfs/425 | 2 -- tests/xfs/426 | 2 -- tests/xfs/427 | 2 -- tests/xfs/428 | 2 -- tests/xfs/429 | 2 -- tests/xfs/430 | 2 -- tests/xfs/444 | 2 -- tests/xfs/453 | 2 -- tests/xfs/454 | 2 -- tests/xfs/455 | 2 -- tests/xfs/456 | 2 -- tests/xfs/457 | 2 -- tests/xfs/458 | 2 -- tests/xfs/459 | 2 -- tests/xfs/460 | 2 -- tests/xfs/461 | 2 -- tests/xfs/462 | 2 -- tests/xfs/463 | 2 -- tests/xfs/464 | 2 -- tests/xfs/465 | 2 -- tests/xfs/466 | 2 -- tests/xfs/467 | 2 -- tests/xfs/468 | 2 -- tests/xfs/469 | 2 -- tests/xfs/470 | 2 -- tests/xfs/471 | 2 -- tests/xfs/472 | 2 -- tests/xfs/473 | 2 -- tests/xfs/474 | 2 -- tests/xfs/475 | 2 -- tests/xfs/476 | 2 -- tests/xfs/477 | 2 -- tests/xfs/478 | 2 -- tests/xfs/479 | 2 -- tests/xfs/480 | 2 -- tests/xfs/481 | 2 -- tests/xfs/482 | 2 -- tests/xfs/483 | 2 -- tests/xfs/484 | 2 -- tests/xfs/485 | 2 -- tests/xfs/486 | 2 -- tests/xfs/487 | 2 -- tests/xfs/488 | 2 -- tests/xfs/489 | 2 -- tests/xfs/495 | 2 -- tests/xfs/496 | 2 -- tests/xfs/497 | 2 -- tests/xfs/498 | 2 -- tests/xfs/499 | 2 -- tests/xfs/503 | 2 +- tests/xfs/507 | 2 +- tests/xfs/517 | 2 +- 164 files changed, 5 insertions(+), 325 deletions(-)
common/preamble +2 -2
@@ -42,10 +42,10 @@ _register_cleanup() shift # clear out existing traps first - trap - EXIT HUP INT QUIT TERM $* + trap - EXIT HUP INT QUIT TERM BUS $* test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM BUS $* } # Prepare to run a fstest by initializing the required global variables to
tests/ext4/023 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest auto quick scrub -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/generic/161 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/162 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone dedupe -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/163 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone dedupe -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/164 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/165 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/166 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/167 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/168 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/170 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/247 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick rw -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/333 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/334 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/349 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest blockdev rw zero -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/scsi_debug
tests/generic/350 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest blockdev rw punch -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/scsi_debug
tests/generic/351 +0 -2
@@ -13,8 +13,6 @@ . ./common/preamble _begin_fstest blockdev rw punch collapse insert zero -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/scsi_debug
tests/generic/356 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone swap -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/357 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone swap -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/358 +0 -2
@@ -13,8 +13,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/359 +0 -2
@@ -15,8 +15,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/372 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/373 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/374 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone dedupe -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/414 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/425 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto quick attr -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/553 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest auto quick copy_range -_register_cleanup "_cleanup" BUS - workdir="$TEST_DIR/test-$seq" # Override the default cleanup function. _cleanup()
tests/generic/554 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest auto quick copy_range swap -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter
tests/generic/564 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest auto quick copy_range -_register_cleanup "_cleanup" BUS - # Override the default cleanup function. _cleanup() {
tests/generic/565 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest auto quick copy_range -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter
tests/generic/670 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/reflink
tests/generic/671 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/reflink
tests/generic/672 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto clone -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/017 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest mount auto quick stress -_register_cleanup "_cleanup; rm -f $tmp.*" - # Import common functions. . ./common/filter
tests/xfs/138 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick -_register_cleanup "_cleanup" BUS - # Import common functions. # real QA test starts here
tests/xfs/162 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest auto quick attr repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/262 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/fuzzy
tests/xfs/280 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest auto quick clone -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/reflink
tests/xfs/285 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/fuzzy
tests/xfs/286 +0 -2
@@ -9,8 +9,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/fuzzy
tests/xfs/349 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers scrub -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/350 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/351 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/352 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/353 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/354 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/355 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/356 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/357 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/358 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/359 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/360 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/361 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/362 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/363 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/364 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/365 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/366 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/367 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/368 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/369 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/370 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/371 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/372 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/373 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/374 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/375 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/376 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/377 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/378 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/379 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/380 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/381 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/382 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/383 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/384 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/385 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/386 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/387 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/388 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/389 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/390 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/391 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/392 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/393 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/394 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/395 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/396 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/397 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/398 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/399 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/400 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/401 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/402 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/403 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/404 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/405 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/406 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/407 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/408 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/409 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/410 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/411 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/412 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/413 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/414 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/415 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/416 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/417 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/418 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/422 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/fuzzy
tests/xfs/423 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest dangerous_scrub -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/fuzzy
tests/xfs/425 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/426 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/427 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/428 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/429 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/430 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/444 +0 -2
@@ -13,8 +13,6 @@ . ./common/preamble _begin_fstest auto quick -_register_cleanup "_cleanup; rm -f $tmp.*" - # Import common functions. . ./common/filter
tests/xfs/453 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/454 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/455 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/456 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/457 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/458 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/459 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/460 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/461 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/462 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/463 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/464 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/465 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/466 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/467 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/468 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/469 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/470 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/471 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/472 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/473 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/474 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/475 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/476 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/477 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/478 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/479 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/480 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/481 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/482 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair realtime -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/483 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/484 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/485 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/486 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/487 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/488 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/489 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/495 +0 -2
@@ -12,8 +12,6 @@ . ./common/preamble _begin_fstest auto quick repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/496 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/497 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/498 +0 -2
@@ -10,8 +10,6 @@ . ./common/preamble _begin_fstest dangerous_fuzzers dangerous_norepair -_register_cleanup "_cleanup" BUS - # Import common functions. . ./common/filter . ./common/populate
tests/xfs/499 +0 -2
@@ -11,8 +11,6 @@ . ./common/preamble _begin_fstest auto quick -_register_cleanup "_cleanup" BUS - # Import common functions. # real QA test starts here
tests/xfs/503 +1 -1
@@ -15,7 +15,7 @@ local_cleanup() rm -rf $testdir _cleanup } -_register_cleanup local_cleanup BUS +_register_cleanup local_cleanup # Import common functions. . ./common/filter
tests/xfs/507 +1 -1
@@ -22,7 +22,7 @@ _loop_cleanup() test -n "$loop_dev" &&_destroy_loop_device $loop_dev _cleanup } -_register_cleanup _loop_cleanup BUS +_register_cleanup _loop_cleanup # Import common functions. . ./common/reflink
tests/xfs/517 +1 -1
@@ -14,7 +14,7 @@ local_cleanup() $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT > /dev/null 2>&1 _cleanup } -_register_cleanup local_cleanup BUS +_register_cleanup local_cleanup # Import common functions. . ./common/filter
Signature · 1 line
2.35.1
Re: [PATCH 7/8] fstests: Set up BUS trap for tests by default
Quoted 175 lines · Dave Chinner
From: Dave Chinner <[email protected]>
About 160 individual tests re-register the cleanup trap just to have it run on a BUS error signal. Just add the BUS signal to the default set of traps initialised by
_register_cleanup()and get rid of these extra registrations.This was mostly done with this script:
$ for f in `git grep -l "register_cleanup.*BUS"` ; doQuoted 2 lines
sed -i -e '/_register_cleanup "
_cleanup" BUS/,+1d' doneWith a small number of non-matching conversions done by hand.
Signed-off-by Dave Chinner <[email protected]>--- common/preamble | 4 ++-- tests/ext4/023 | 2 -- tests/generic/161 | 2 -- tests/generic/162 | 2 -- tests/generic/163 | 2 -- tests/generic/164 | 2 -- tests/generic/165 | 2 -- tests/generic/166 | 2 -- tests/generic/167 | 2 -- tests/generic/168 | 2 -- tests/generic/170 | 2 -- tests/generic/247 | 2 -- tests/generic/333 | 2 -- tests/generic/334 | 2 -- tests/generic/349 | 2 -- tests/generic/350 | 2 -- tests/generic/351 | 2 -- tests/generic/356 | 2 -- tests/generic/357 | 2 -- tests/generic/358 | 2 -- tests/generic/359 | 2 -- tests/generic/372 | 2 -- tests/generic/373 | 2 -- tests/generic/374 | 2 -- tests/generic/414 | 2 -- tests/generic/425 | 2 -- tests/generic/553 | 2 -- tests/generic/554 | 2 -- tests/generic/564 | 2 -- tests/generic/565 | 2 -- tests/generic/670 | 2 -- tests/generic/671 | 2 -- tests/generic/672 | 2 -- tests/xfs/017 | 2 -- tests/xfs/138 | 2 -- tests/xfs/162 | 2 -- tests/xfs/262 | 2 -- tests/xfs/280 | 2 -- tests/xfs/285 | 2 -- tests/xfs/286 | 2 -- tests/xfs/349 | 2 -- tests/xfs/350 | 2 -- tests/xfs/351 | 2 -- tests/xfs/352 | 2 -- tests/xfs/353 | 2 -- tests/xfs/354 | 2 -- tests/xfs/355 | 2 -- tests/xfs/356 | 2 -- tests/xfs/357 | 2 -- tests/xfs/358 | 2 -- tests/xfs/359 | 2 -- tests/xfs/360 | 2 -- tests/xfs/361 | 2 -- tests/xfs/362 | 2 -- tests/xfs/363 | 2 -- tests/xfs/364 | 2 -- tests/xfs/365 | 2 -- tests/xfs/366 | 2 -- tests/xfs/367 | 2 -- tests/xfs/368 | 2 -- tests/xfs/369 | 2 -- tests/xfs/370 | 2 -- tests/xfs/371 | 2 -- tests/xfs/372 | 2 -- tests/xfs/373 | 2 -- tests/xfs/374 | 2 -- tests/xfs/375 | 2 -- tests/xfs/376 | 2 -- tests/xfs/377 | 2 -- tests/xfs/378 | 2 -- tests/xfs/379 | 2 -- tests/xfs/380 | 2 -- tests/xfs/381 | 2 -- tests/xfs/382 | 2 -- tests/xfs/383 | 2 -- tests/xfs/384 | 2 -- tests/xfs/385 | 2 -- tests/xfs/386 | 2 -- tests/xfs/387 | 2 -- tests/xfs/388 | 2 -- tests/xfs/389 | 2 -- tests/xfs/390 | 2 -- tests/xfs/391 | 2 -- tests/xfs/392 | 2 -- tests/xfs/393 | 2 -- tests/xfs/394 | 2 -- tests/xfs/395 | 2 -- tests/xfs/396 | 2 -- tests/xfs/397 | 2 -- tests/xfs/398 | 2 -- tests/xfs/399 | 2 -- tests/xfs/400 | 2 -- tests/xfs/401 | 2 -- tests/xfs/402 | 2 -- tests/xfs/403 | 2 -- tests/xfs/404 | 2 -- tests/xfs/405 | 2 -- tests/xfs/406 | 2 -- tests/xfs/407 | 2 -- tests/xfs/408 | 2 -- tests/xfs/409 | 2 -- tests/xfs/410 | 2 -- tests/xfs/411 | 2 -- tests/xfs/412 | 2 -- tests/xfs/413 | 2 -- tests/xfs/414 | 2 -- tests/xfs/415 | 2 -- tests/xfs/416 | 2 -- tests/xfs/417 | 2 -- tests/xfs/418 | 2 -- tests/xfs/422 | 2 -- tests/xfs/423 | 2 -- tests/xfs/425 | 2 -- tests/xfs/426 | 2 -- tests/xfs/427 | 2 -- tests/xfs/428 | 2 -- tests/xfs/429 | 2 -- tests/xfs/430 | 2 -- tests/xfs/444 | 2 -- tests/xfs/453 | 2 -- tests/xfs/454 | 2 -- tests/xfs/455 | 2 -- tests/xfs/456 | 2 -- tests/xfs/457 | 2 -- tests/xfs/458 | 2 -- tests/xfs/459 | 2 -- tests/xfs/460 | 2 -- tests/xfs/461 | 2 -- tests/xfs/462 | 2 -- tests/xfs/463 | 2 -- tests/xfs/464 | 2 -- tests/xfs/465 | 2 -- tests/xfs/466 | 2 -- tests/xfs/467 | 2 -- tests/xfs/468 | 2 -- tests/xfs/469 | 2 -- tests/xfs/470 | 2 -- tests/xfs/471 | 2 -- tests/xfs/472 | 2 -- tests/xfs/473 | 2 -- tests/xfs/474 | 2 -- tests/xfs/475 | 2 -- tests/xfs/476 | 2 -- tests/xfs/477 | 2 -- tests/xfs/478 | 2 -- tests/xfs/479 | 2 -- tests/xfs/480 | 2 -- tests/xfs/481 | 2 -- tests/xfs/482 | 2 -- tests/xfs/483 | 2 -- tests/xfs/484 | 2 -- tests/xfs/485 | 2 -- tests/xfs/486 | 2 -- tests/xfs/487 | 2 -- tests/xfs/488 | 2 -- tests/xfs/489 | 2 -- tests/xfs/495 | 2 --
Quoted 9 lines
tests/xfs/496 | 2 -- tests/xfs/497 | 2 -- tests/xfs/498 | 2 -- tests/xfs/499 | 2 -- tests/xfs/503 | 2 +- tests/xfs/507 | 2 +- tests/xfs/517 | 2 +- 164 files changed, 5 insertions(+), 325 deletions(-)
Nice cleanup!
Thanks,
Amir.
PATCH 8/8 fstests: cleanup _cleanup usage in shared
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
To match the cleanup of tests/xfs
--- tests/shared/002 | 7 ++++--- tests/shared/298 | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-)
tests/shared/002 +4 -3
@@ -15,12 +15,13 @@ . ./common/preamble _begin_fstest auto metadata quick log -# Override the default cleanup function. -_cleanup() +_dmflakey_cleanup() { + _unmount_flakey _cleanup_flakey - rm -f $tmp.* + _cleanup } +_register_cleanup _dmflakey_cleanup # Import common functions. . ./common/filter
tests/shared/298 +11 -11
@@ -9,6 +9,17 @@ . ./common/preamble _begin_fstest auto trim +_loop_cleanup() +{ + UMOUNT_PROG $loop_dev &> /dev/null + _destroy_loop_device $loop_dev + if [ $status -eq 0 ]; then + rm $img_file + fi + _cleanup +} +_register_cleanup _loop_cleanup + _supported_fs ext4 xfs btrfs _require_test _require_loop
@@ -27,17 +38,6 @@ fi [ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-super [ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-tree -# Override the default cleanup function. -_cleanup() -{ - $UMOUNT_PROG $loop_dev &> /dev/null - _destroy_loop_device $loop_dev - if [ $status -eq 0 ]; then - rm -rf $tmp - rm $img_file - fi -} - get_holes() { # It's not a good idea to be running tools against the image file
Signature · 1 line
2.35.1
Re: [PATCH 8/8] fstests: cleanup _cleanup usage in shared
Quoted 7 lines · Dave Chinner
From: Dave Chinner <[email protected]>
To match the cleanup of tests/xfs
Signed-off-by Dave Chinner <[email protected]>---
Makes sense.
Thanks,
Amir.
Re: [PATCH 8/8] fstests: cleanup _cleanup usage in shared
In reply to Dave ChinnerQuoted 16 lines · Dave Chinner
From: Dave Chinner <[email protected]>
To match the cleanup of tests/xfs
Signed-off-by Dave Chinner <[email protected]>--- tests/shared/002 | 7 ++++--- tests/shared/298 | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-)tests/shared/002 +0
-0
tests/shared/002 line 21
Quoted 9 lines
tests/shared/002 +2
-2@@ -15,12 +15,13 @@ . ./common/preamble _begin_fstest auto metadata quick log -# Override the default cleanup function. -_cleanup() +_dmflakey_cleanup() { + _unmount_flakey _cleanup_flakey
Wait a minute, why was _unmount_flakey() added here? I see that most dmflakey cleaners do not call unmount_flakey and it could be for a good reason._cleanup_flakey already doesn umount only after doing:
_cleanup_flakey()
{
# If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang
Thanks,
Amir.
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.
That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanup
While removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call _cleanup
if we always want _cleanup to be called we can always implicitly chain it in _register_cleanup():
common/preamble +2 -2
@@ -20,7 +20,7 @@ _register_cleanup() shift test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* } # Prepare to run a fstest by initializing the required global variables to
@@ -46,7 +46,7 @@ _begin_fstest() tmp=/tmp/$$ status=1 # failure is the default! - _register_cleanup _cleanup + _register_cleanup . ./common/rc
It could be a bit weird for tests that call_register_cleanup _cleanup
But you removed most of those in the SIGBUS patch and even if they do exists, _cleanup() is re-entrant.
Quoted 79 lines
While this looks more verbose, it means we can actually reuse the same cleanup function across lots of tests.
A large number of xfsdump tests were all using the same override cleanup function to call
_cleanup_dump. These are all changed to:. ./common/dump
_register_cleanup_cleanup_dumpand
_cleanup_dumpstacks like this:
_cleanup_dump()
{
#do xfsdump cleanup stuff
_cleanup
}and we don't need to do anything else. There is one xfsdump test that needs it's own cleanup. It stacks like this:
local_cleanup()
{
rm -f $testfile
_cleanup_dump
}_register_cleanuplocal_cleanupAll the tests that run fsstress in the background now have a common cleanup function that kills fsstress processes defined in common/preamble. They just do:
_register_cleanup_cleanup_fsstressAnd now every test that puts fsstress in the background behaves correctly and kills all the background fsstree processes when interrupted.
The conversion is by no means complete. I've named the local cleanup functions by what they do so we can go back and derive commonality between them. The number of different variations on tearing down loops devices is crazy, and half of them are buggy. I haven't worked through these yet, so you'll see lots of tests with:
_loop_cleanup(){ ...... _cleanup }
_register_cleanup_loop_cleanupThat have similar but different ways of cleaning up loop devices.
I also added a
_no_cleanup()function, as there are a large number of xfs fuzzer tests that want to leave a warm corpse behind so that debugging what just happened is easy.I also added BUS to the default signal trap set - well over a 100 tests in tests/xfs had a line like:
_register_cleanup"_cleanup" BUSjust to add BUS signals to the set that would cause the cleanup function to run. Just make it the default!
Overall, this significantly reduces the amount of boiler plate in tests, and sets us down the path of common cleanup functions that tests may not even need to define. e.g. just including ./common/dmflakey registers the
_cleanup_dmflakey()trap that will do all the necessary cleanup when the test exists. This makes the tests simpler, more robust and reduces the maintenance burden of over 1700 individual tests....I won't put the full diffstat in this mail, but the benefits should be clean from the summary:
360 files changed, 420 insertions(+), 1781 deletions(-)
Quoted 8 lines
I've lost count of the number of test bugs I killed in removing all this code, and that's largely just in the tests/xfs directory. So before I go spend another couple of days on converting the rest of fstests, I figured I better make sure everyone is OK with these changes.
Thoughts, comments?
Thank you for taking this on!
Amir.
Quoted 51 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():
common/preamble _register_cleanup() · line 24
Quoted 6 lines
common/preamble +1
-1@@ -20,7 +20,7 @@ _register_cleanup() shift test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }
I considered that, but then I found the _no_cleanup cases. IOWs, this doesn't work for the cases where we want to prevent the generic _cleanup function from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of _cleanup as per above.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 55 lines · Dave Chinner
Quoted 53 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():common/preamble +0
-0@@ -20,7 +20,7 @@ _register_cleanup() shift
Quoted 11 lines
common/preamble _register_cleanup() · line 24
Quoted 4 lines
common/preamble +1
-1test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }I considered that, but then I found the
_no_cleanupcases. IOWs, this doesn't work for the cases where we want to prevent the generic_cleanupfunction from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of_cleanupas per above.
I didn't know about those.
Since you went to all this trouble to find them, can you provide a reference. I wonder, what could ever be the reason not to want to rm $tmp.*?
Thanks,
Amir.
Quoted 68 lines · Amir Goldstein
Quoted 55 lines · Dave Chinner
Quoted 53 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():common/preamble +0
-0@@ -20,7 +20,7 @@ _register_cleanup() shiftQuoted 11 lines
common/preamble _register_cleanup() · line 24
Quoted 4 lines
common/preamble +1
-1test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }I considered that, but then I found the
_no_cleanupcases. IOWs, this doesn't work for the cases where we want to prevent the generic_cleanupfunction from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of_cleanupas per above.
Quoted 3 lines
I didn't know about those.
Since you went to all this trouble to find them, can you provide a reference. I wonder, what could ever be the reason not to want to rm $tmp.*?
[PATCH 6/8] fstests: consolidate no cleanup test setup
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 70 lines · Dave Chinner
Quoted 68 lines · Amir Goldstein
Quoted 66 lines · Dave Chinner
Quoted 51 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():common/preamble _register_cleanup() · line 24
Quoted 6 lines
common/preamble +1
-1@@ -20,7 +20,7 @@ _register_cleanup() shift test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }I considered that, but then I found the
_no_cleanupcases. IOWs, this doesn't work for the cases where we want to prevent the generic_cleanupfunction from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of_cleanupas per above.
Quoted 6 lines
Quoted 3 lines
I didn't know about those.
Since you went to all this trouble to find them, can you provide a reference. I wonder, what could ever be the reason not to want to rm $tmp.*?[PATCH 6/8] fstests: consolidate no cleanup test setup
Ah I see.
It might have been better to explicitly opt-out of cleanup only for those tests via _register_no_cleanup or _unregister_cleanup
similar to the common _require_scratch and the exceptions of _require_scratch_nocheck
But that could be done by followup cleanup and someone has an itch to scratch ;)
Thanks,
Amir.
Quoted 75 lines · Amir Goldstein
Quoted 74 lines · Dave Chinner
Quoted 71 lines · Amir Goldstein
Quoted 55 lines · Dave Chinner
Quoted 53 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():common/preamble +0
-0@@ -20,7 +20,7 @@ _register_cleanup() shiftQuoted 11 lines
common/preamble _register_cleanup() · line 24
Quoted 4 lines
common/preamble +1
-1test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }I considered that, but then I found the
_no_cleanupcases. IOWs, this doesn't work for the cases where we want to prevent the generic_cleanupfunction from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of_cleanupas per above.I didn't know about those.
Since you went to all this trouble to find them, can you provide a reference. I wonder, what could ever be the reason not to want to rm $tmp.*?
Quoted 6 lines
Quoted 2 lines
[PATCH 6/8] fstests: consolidate no cleanup test setup
Ah I see.
It might have been better to explicitly opt-out of cleanup only for those tests via_register_no_cleanupor_unregister_cleanup
Premature optimisation.
-Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 77 lines · Dave Chinner
Quoted 75 lines · Amir Goldstein
Quoted 74 lines · Dave Chinner
Quoted 71 lines · Amir Goldstein
Quoted 55 lines · Dave Chinner
Quoted 53 lines · Amir Goldstein
Quoted 13 lines · Dave Chinner
Hi folks,
I pulled on a string a couple of days ago, and it got out of control. It all started when I went to kill a test with ctrl-c and it, once again, left background processes running that I had to hunt down and kill manually.
I then started looking a why this keeps happening, and realised that the way we clean up on test completion is messy, inconsistent and frequently buggy. So I started cleaning it all up, starting with the tests/xfs directory because I saw a lot of low hanging fruit there.
Quoted 9 lines
Essentially, we use
_cleanup()functions as a way of overriding the default trap handler we install in_begin_fstest(). Rather than register a new handler, we just redefine the common cleanup function and re-implement it (poorly) in every test that does an override. Often these overrides are completely unnecessary - I think I reduced the total number of overrides in tests/xfs by ~30% (~190 -> ~125), and I reudced the number of *unique overrides by a lot more than that.That looks like an awesome improvement!
Quoted 10 lines
The method for overriding changes to be "stacked cleanups" rather than "duplicated cleanups". That is, tests no longer open code:
cd / rm -rf $tmp.*THis is what common/preamble::_cleanup() does. We should call that function to do this. Hence if we have a local cleanup that we need to do, it becomes:
Quoted 6 lines
local_cleanup()
{
rm -f $testfile
_cleanup
}_register_cleanuplocal_cleanupWhile removing boilerplate code, we had better not create another boilerplate. Instead of expecting test writers to always call
_cleanup
if we always want_cleanupto be called we can always implicitly chain it in_register_cleanup():common/preamble +0
-0@@ -20,7 +20,7 @@ _register_cleanup() shiftQuoted 11 lines
common/preamble _register_cleanup() · line 24
Quoted 4 lines
common/preamble +1
-1test -n "$cleanup" && cleanup="${cleanup}; " - trap "${cleanup}exit \$status" EXIT HUP INT QUIT TERM $* + trap "${cleanup}_cleanup; exit \$status" EXIT HUP INT QUIT TERM $* }I considered that, but then I found the
_no_cleanupcases. IOWs, this doesn't work for the cases where we want to prevent the generic_cleanupfunction from being run on failure/test exit. Hence the cleanup function stacking behaviour rather than unconditional calling of_cleanupas per above.I didn't know about those.
Since you went to all this trouble to find them, can you provide a reference. I wonder, what could ever be the reason not to want to rm $tmp.*?
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
[PATCH 6/8] fstests: consolidate no cleanup test setup
Ah I see.
It might have been better to explicitly opt-out of cleanup only for those tests via_register_no_cleanupor_unregister_cleanupPremature optimisation.
It's not an optimization at all.
The purpose of doing it this way would be to eliminate the human mistakes (from which you found so many in this work) and create a situation where _cleanup() is called for all tests, unless the test author really wants to avoid it.
But anyway, no need to fix everything at one go.
There will still be plenty of ways that a test author can write a test that does not clean after itself.
Thanks,
Amir.