From: Bernhard Voelker Date: Fri, 27 Jul 2012 08:35:01 +0000 (+0200) Subject: tests: search mount point in canonicalized form in /proc/mounts X-Git-Tag: v2.22-rc2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee9c04f48c142ca6b981a9061af25ebc9763903e;p=thirdparty%2Futil-linux.git 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 --- diff --git a/tests/functions.sh b/tests/functions.sh index 74cde97b3b..a3bb482d8f 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