]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: use ts_is_mounted in mount/regfile
authorBernhard Voelker <mail@bernhard-voelker.de>
Fri, 27 Jul 2012 09:00:17 +0000 (11:00 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jul 2012 14:07:36 +0000 (16:07 +0200)
If the test directory is on a symlink, then mount/regfile failed because
it did not search for the mount point in /proc/mounts canonicalized.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
tests/ts/mount/regfile

index c47c7d7950e8d064e28edfaa9669f64b47d6b65f..8d786adbf3a824da56890bc9c0c17ccb6c004c20 100755 (executable)
@@ -21,7 +21,7 @@ $TS_CMD_MOUNT $IMAGE $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT
 
 DEVICE=$(awk '/regfile/ { print $1 }' /proc/mounts)
 
-grep -q "$TS_MOUNTPOINT" /proc/mounts || ts_die "Cannot find $TS_MOUNTPOINT in /proc/mounts"
+ts_is_mounted "$TS_MOUNTPOINT" || ts_die "Cannot find $TS_MOUNTPOINT in /proc/mounts"
 
 if [ -f "/sys/block/$(basename $DEVICE)/loop/backing_file" ]; then
        $TS_CMD_UMOUNT $IMAGE || ts_die "Cannot umount $IMAGE"
@@ -30,7 +30,7 @@ else
        ts_skip "too old kernel"
 fi
 
-grep -q "$TS_MOUNTPOINT" /proc/mounts && ts_die "$TS_MOUNTPOINT still in /proc/mounts"
+ts_is_mounted "$TS_MOUNTPOINT" && ts_die "$TS_MOUNTPOINT still in /proc/mounts"
 
 ts_log "Success"
 ts_finalize