From: Ruediger Meier Date: Mon, 12 May 2014 00:45:10 +0000 (+0200) Subject: tests: add function ts_check_losetup X-Git-Tag: v2.25-rc1~154^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ec15aefbbfc19f708aba9dbe0f15a217786a954;p=thirdparty%2Futil-linux.git tests: add function ts_check_losetup Unfortunately losetup -f does not return an error nowadays. Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index 5b7324cfbf..867cdaa239 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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)" }