summaryrefslogtreecommitdiffstats
path: root/tests/ts/losetup
diff options
context:
space:
mode:
authorRuediger Meier2014-05-12 12:42:07 +0200
committerRuediger Meier2014-05-13 17:37:15 +0200
commit8fd00abd4a74b6e15d90b69007bd78c0658b7b03 (patch)
tree6e702b256cf948b9ae9f1313ae4bb2aea63ea117 /tests/ts/losetup
parenttests: add function ts_check_losetup (diff)
downloadkernel-qcow2-util-linux-8fd00abd4a74b6e15d90b69007bd78c0658b7b03.tar.gz
kernel-qcow2-util-linux-8fd00abd4a74b6e15d90b69007bd78c0658b7b03.tar.xz
kernel-qcow2-util-linux-8fd00abd4a74b6e15d90b69007bd78c0658b7b03.zip
tests: use ts_check_losetup in losetup test
In losetup test we have to handle the special case that ts_check_losetup requires a working losetup binary. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/losetup')
-rwxr-xr-xtests/ts/losetup/losetup9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ts/losetup/losetup b/tests/ts/losetup/losetup
index 234c58f6f..f27501bc4 100755
--- a/tests/ts/losetup/losetup
+++ b/tests/ts/losetup/losetup
@@ -24,7 +24,16 @@ ts_init "$*"
ts_check_test_command "$TS_CMD_LOSETUP"
+# Before checking for loop support we would need to test if losetup -f works at
+# all. At least we do a simple executable test for now.
+$TS_CMD_LOSETUP --version >/dev/null 2>$TS_OUTPUT || ts_failed
+$TS_CMD_LOSETUP --unknownopt >>$TS_OUTPUT 2>/dev/null && ts_failed
+test -s $TS_OUTPUT && ts_failed
+rm -f $TS_OUTPUT
+
ts_skip_nonroot
+ts_check_losetup
+
DEVICE=$(ts_scsi_debug_init dev_size_mb=11)
REFILE=$(ts_image_init 10)