btrfs/06[0-9]..07[0-4]: kill all background tasks when test is killed/interrupted
Test cases btrfs/06[0-9] and btrfs/07[0-4] exercise multiple concurrent
operations while fsstress is running in parallel, and all these are left
as child processes running in the background, which are correctly stopped
if the tests are not interrupted/killed. However if any of these tests is
interrupted/killed, it often leaves child processes still running in the
background, which prevent further running fstests again. For example:
our local _scratch_mkfs routine ...
btrfs-progs v6.6.2
See https://btrfs.readthedocs.io for more information.
ERROR: unable to open /dev/sdb: Device or resource busy
check: failed to mkfs $SCRATCH_DEV using specified options
Interrupted!
Passed all 0 tests
In this case there was still a process running _btrfs_stress_subvolume()
from common/btrfs.
This is a bit annoying because it requires manually finding out which
process is preventing unmounting the scratch device and then properly
stop/kill it.
So fix this by adding a _cleanup() function to all these tests and then
making sure it stops all the child processes it spawned and are running
in the background.
All these tests have the same structure as they were part of the same
patchset and from the same author.