]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add function ts_check_losetup
authorRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 12 May 2014 00:45:10 +0000 (02:45 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 13 May 2014 15:36:51 +0000 (17:36 +0200)
Unfortunately losetup -f does not return an error nowadays.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/functions.sh

index 5b7324cfbffccb3626b7a9124905cd2ebf4788a7..867cdaa2394c16609b770383371fdbe90b8475d5 100644 (file)
@@ -45,6 +45,18 @@ function ts_check_test_command {
        fi
 }
 
+function ts_check_losetup {
+       local tmp
+       ts_check_test_command "$TS_CMD_LOSETUP"
+
+       # assuming that losetup -f works ... to be checked somewhere else
+       tmp=$($TS_CMD_LOSETUP -f 2>/dev/null)
+       if test -b "$tmp"; then
+               return 0
+       fi
+       ts_skip "no loop device support"
+}
+
 function ts_skip_subtest {
        ts_report " IGNORE ($1)"
 }