summaryrefslogtreecommitdiffstats
path: root/tests/ts/cramfs
diff options
context:
space:
mode:
authorRuediger Meier2015-03-31 14:19:40 +0200
committerRuediger Meier2015-04-14 13:18:42 +0200
commitcbae7931c85d232269d45ec6766b293c40cbdb09 (patch)
treeb87f66967928f66a9ab8787a5b13c526a5d53024 /tests/ts/cramfs
parenttests: introduce ts_cleanup_on_exit() (diff)
downloadkernel-qcow2-util-linux-cbae7931c85d232269d45ec6766b293c40cbdb09.tar.gz
kernel-qcow2-util-linux-cbae7931c85d232269d45ec6766b293c40cbdb09.tar.xz
kernel-qcow2-util-linux-cbae7931c85d232269d45ec6766b293c40cbdb09.zip
tests: introduce TS_LOOP_DEVS for cleanup
We are maintaining an array TS_LOOP_DEVS to de-initialize devices always on exit. Until now there was no cleanup in ts_skip(). The downside is that we can't execute ts_device_init() in a subshell anymore. The device is returned via global variable TS_LODEV, similar like we do already in ts_scsi_debug_init(). Tests which don't use ts_device_init() to create loop devices may use ts_register_loop_device() to get them cleaned up later. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/cramfs')
-rwxr-xr-xtests/ts/cramfs/mkfs3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs
index 7c7d690ef..a5a3bf565 100755
--- a/tests/ts/cramfs/mkfs
+++ b/tests/ts/cramfs/mkfs
@@ -86,6 +86,7 @@ echo >> $TS_OUTPUT
ts_log "create loop device from image"
DEVICE=$($TS_CMD_LOSETUP --show -f $IMAGE_PATH)
+ts_register_loop_device "$DEVICE"
ts_log "check the image"
ts_device_has "TYPE" "cramfs" $DEVICE
@@ -111,7 +112,5 @@ echo >> $TS_OUTPUT
ts_cd "$ORIGPWD"
ts_log "umount the image"
-$TS_CMD_UMOUNT $DEVICE
-$TS_CMD_LOSETUP -d $DEVICE 2>&1 >> $TS_OUTPUT
ts_finalize