From 3ff2557c92398a611e42ad6b428c78e9c5c120ed Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 4 Feb 2009 22:38:34 +0100 Subject: tests: check also for /dev/loop/X Signed-off-by: Karel Zak --- tests/functions.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/functions.sh') 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" -- cgit v1.2.3-55-g7522