summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorBernhard Voelker2012-07-27 10:35:01 +0200
committerKarel Zak2012-07-30 15:58:23 +0200
commitee9c04f48c142ca6b981a9061af25ebc9763903e (patch)
tree9fec549730fdc44ee28da40b50f4399c969b835f /tests/functions.sh
parentdocs: add note about enabled kill(1) to v2.22-ReleaseNotes (diff)
downloadkernel-qcow2-util-linux-ee9c04f48c142ca6b981a9061af25ebc9763903e.tar.gz
kernel-qcow2-util-linux-ee9c04f48c142ca6b981a9061af25ebc9763903e.tar.xz
kernel-qcow2-util-linux-ee9c04f48c142ca6b981a9061af25ebc9763903e.zip
tests: search mount point in canonicalized form in /proc/mounts
* tests/functions.sh (ts_is_mounted): Enhance to resolve symlinks in given mount point before grep'ing in /proc/mount. If the test directory is on a symlink, then e.g. tests/ts/cramfs/doubles failed because the kernel keeps the mount entry in a canonicalized form in /proc/mounts while this function searched for it with the original path name. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 74cde97b3..a3bb482d8 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -377,7 +377,10 @@ function ts_device_has_uuid {
}
function ts_is_mounted {
- local DEV=$1
+ local DEV=$( readlink -f $1 )
+ if [ ".$DEV" = '.' ]; then
+ DEV=$1
+ fi
grep -q $DEV /proc/mounts && return 0