util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: [PATCH] tests: search mount point in canonicalized form in /proc/mounts
Date: Fri, 27 Jul 2012 10:36:24 +0200	[thread overview]
Message-ID: <50125308.2070003@bernhard-voelker.de> (raw)


>From 9fe90eaa1c1d425437eab705a29e7c7800ffa7fe Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Fri, 27 Jul 2012 10:35:01 +0200
Subject: [PATCH] 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>
---
 tests/functions.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/functions.sh b/tests/functions.sh
index 74cde97..a3bb482 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

-- 
1.7.7



             reply	other threads:[~2012-07-27  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27  8:36 Bernhard Voelker [this message]
2012-07-30 15:13 ` [PATCH] tests: search mount point in canonicalized form in /proc/mounts Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50125308.2070003@bernhard-voelker.de \
    --to=mail@bernhard-voelker.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).