]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: use ts_check_losetup in losetup test
authorRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 12 May 2014 10:42:07 +0000 (12:42 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 13 May 2014 15:37:15 +0000 (17:37 +0200)
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>
tests/ts/losetup/losetup

index 234c58f6f251505ea6bb115388b4aa2c8d85d5e7..f27501bc40a03c34dbc0f9dd8990e1e3c5372db8 100755 (executable)
@@ -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)