summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index d57d19d86..371deb6af 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -244,6 +244,17 @@ function ts_device_has_uuid {
return $?
}
+function ts_is_mounted {
+ local DEV=$1
+
+ grep -q $DEV /proc/mounts && return 0
+
+ if [ "${DEV#/dev/loop/}" != "$DEV" ]; then
+ return grep -q "/dev/loop${DEV#/dev/loop/}" /proc/mounts
+ fi
+ return 1
+}
+
function ts_swapoff {
local DEV="$1"