summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-05-12 02:45:10 +0200
committerRuediger Meier2014-05-13 17:36:51 +0200
commit5ec15aefbbfc19f708aba9dbe0f15a217786a954 (patch)
treeeb196dda8311ef7963b6b20e18ae062ad601c1e9 /tests/functions.sh
parenttests: ts_device_init remove useless error handling (diff)
downloadkernel-qcow2-util-linux-5ec15aefbbfc19f708aba9dbe0f15a217786a954.tar.gz
kernel-qcow2-util-linux-5ec15aefbbfc19f708aba9dbe0f15a217786a954.tar.xz
kernel-qcow2-util-linux-5ec15aefbbfc19f708aba9dbe0f15a217786a954.zip
tests: add function ts_check_losetup
Unfortunately losetup -f does not return an error nowadays. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 5b7324cfb..867cdaa23 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)"
}