diff options
author | Karel Zak | 2009-02-04 22:38:34 +0100 |
---|---|---|
committer | Karel Zak | 2009-02-04 22:38:34 +0100 |
commit | 3ff2557c92398a611e42ad6b428c78e9c5c120ed (patch) | |
tree | aa2d39ae4e0d884b72957aa3a399a55a8c5256b3 /tests/functions.sh | |
parent | mkfs.cramfs: lower memory requirements for layouts with duplicate files (diff) | |
download | kernel-qcow2-util-linux-3ff2557c92398a611e42ad6b428c78e9c5c120ed.tar.gz kernel-qcow2-util-linux-3ff2557c92398a611e42ad6b428c78e9c5c120ed.tar.xz kernel-qcow2-util-linux-3ff2557c92398a611e42ad6b428c78e9c5c120ed.zip |
tests: check also for /dev/loop/X
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r-- | tests/functions.sh | 11 |
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" |