]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: search mount point in canonicalized form in /proc/mounts
authorBernhard Voelker <mail@bernhard-voelker.de>
Fri, 27 Jul 2012 08:35:01 +0000 (10:35 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jul 2012 13:58:23 +0000 (15:58 +0200)
* 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>
tests/functions.sh

index 74cde97b3b33031d5974b022f285861c6212fa27..a3bb482d8f8274032f4a4b5c56868a0a68e3470d 100644 (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