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>
This commit is contained in:
Bernhard Voelker 2012-07-27 10:35:01 +02:00 committed by Karel Zak
parent 454996c495
commit ee9c04f48c
1 changed files with 4 additions and 1 deletions

View File

@ -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