diff options
author | Ruediger Meier | 2015-03-31 14:19:40 +0200 |
---|---|---|
committer | Ruediger Meier | 2015-04-14 13:18:42 +0200 |
commit | cbae7931c85d232269d45ec6766b293c40cbdb09 (patch) | |
tree | b87f66967928f66a9ab8787a5b13c526a5d53024 /tests/ts/minix | |
parent | tests: introduce ts_cleanup_on_exit() (diff) | |
download | kernel-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/minix')
-rwxr-xr-x | tests/ts/minix/fsck | 4 | ||||
-rwxr-xr-x | tests/ts/minix/mkfs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/ts/minix/fsck b/tests/ts/minix/fsck index cba7c311b..f64d83cfe 100755 --- a/tests/ts/minix/fsck +++ b/tests/ts/minix/fsck @@ -28,7 +28,8 @@ ts_check_losetup set -o pipefail IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" -DEVICE=$(ts_device_init) +ts_device_init +DEVICE=$TS_LODEV ts_log "create minix fs" $TS_CMD_MKMINIX $DEVICE 2>&1 >> $TS_OUTPUT @@ -36,6 +37,5 @@ $TS_CMD_MKMINIX $DEVICE 2>&1 >> $TS_OUTPUT ts_log "fsck minix fs" $TS_CMD_FSCKMINIX $DEVICE 2>&1 >> $TS_OUTPUT -ts_device_deinit $DEVICE ts_finalize diff --git a/tests/ts/minix/mkfs b/tests/ts/minix/mkfs index 86230f77c..897203741 100755 --- a/tests/ts/minix/mkfs +++ b/tests/ts/minix/mkfs @@ -28,7 +28,8 @@ ts_check_losetup set -o pipefail IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" -DEVICE=$(ts_device_init) +ts_device_init +DEVICE=$TS_LODEV ts_log "create minix fs" $TS_CMD_MKMINIX $DEVICE 2>&1 >> $TS_OUTPUT @@ -44,6 +45,5 @@ ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" $DEVICE ts_log "umount the image" $TS_CMD_UMOUNT $DEVICE -ts_device_deinit $DEVICE ts_finalize |