summaryrefslogtreecommitdiff
path: root/tests/init.cfg
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-11-20 16:02:23 +0100
committerJim Meyering <meyering@redhat.com>2010-11-20 17:24:33 +0100
commit4d021ba2c6c9f175e2ea56a55bb8d2b0d189a0ca (patch)
tree6a83de0d750fe03eaad603bb1385954e99474ffc /tests/init.cfg
parentefe0166c817f2c3665862042dd5ef181e88e37c0 (diff)
downloadparted-4d021ba2c6c9f175e2ea56a55bb8d2b0d189a0ca.tar.gz
tests: adjust cleanup_ handler to work with init.sh
* tests/init.cfg (cleanup_, cleanup_fn_, cleanup_final_): Define. * tests/t-local.sh (cleanup_final_): Use this to ensure that we always release the lock and run rmmod. Overriding the trap did not do the job. * libparted/tests/t2100-zerolen.sh: Use cleanup_fn_, not cleanup_. * tests/t1100-busy-label.sh: Likewise. * tests/t1101-busy-partition.sh: Likewise. * tests/t4100-dvh-partition-limits.sh: Likewise. * tests/t4100-msdos-partition-limits.sh: Likewise. * tests/t6000-dm.sh: Likewise. * tests/t8000-loop.sh: Likewise.
Diffstat (limited to 'tests/init.cfg')
-rw-r--r--tests/init.cfg7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/init.cfg b/tests/init.cfg
index a1e534c..f3682b1 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -25,6 +25,13 @@ require_512_byte_sector_size_()
test $sector_size_ = 512 || skip_ 'FS test with sector size != 512'
}
+# We need two cleanup functions. One, cleanup_final_, is sometimes
+# used (transparently) via t-local.sh's modprobe/rmmod code.
+# The other is used e.g., to unmount.
+cleanup_final_() { :; }
+cleanup_fn_() { :; }
+cleanup_() { cleanup_fn_; cleanup_final_; }
+
# Use this for a test that requires an actual hardware device, e.g., a real
# disk, a USB key, or a CD-RW. The envvars $DEVICE_TO_ERASE and
# $DEVICE_TO_ERASE_SIZE must be set properly. Otherwise, skip the test.