public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common:  Fixes for testing NFS over IPv6
@ 2014-10-29 19:32 Anna Schumaker
  2014-10-29 23:33 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Anna Schumaker @ 2014-10-29 19:32 UTC (permalink / raw)
  To: fstests, hch; +Cc: linux-nfs

When testing NFS over IPv6, the user will set a $TEST_DEV of the form
[fe80::42]:/export.  The use of square brackets surrounding the IPv6
address is an accepted convention, but grep and awk think that our IPv6
address is actually a regex and tries to evaluate it instead.  The
result is that xfstests reports our filesystem "is busy or already
mounted".

This patch fixes the IPv6 problem by telling awk and grep to treat
$TEST_DEV as a fixed string rather than a regex.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 common/rc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/rc b/common/rc
index 747cf72..5f24eb0 100644
--- a/common/rc
+++ b/common/rc
@@ -810,13 +810,13 @@ _df_device()
     fi
 
     $DF_PROG 2>/dev/null | $AWK_PROG -v what=$1 '
-        match($1,what) && NF==1 {
+        ($1==what) && (NF==1) {
             v=$1
             getline
             print v, $0
             exit
         }
-        match($1,what) {
+        ($1==what) {
             print
             exit
         }
@@ -1132,10 +1132,10 @@ _require_test()
     esac
 
     # mounted?
-    if _mount | grep -q $TEST_DEV
+    if _mount | grep -F -q $TEST_DEV
     then
         # if it's mounted, make sure its on $TEST_DIR
-        if ! _mount | grep $TEST_DEV | grep -q $TEST_DIR
+        if ! _mount | grep -F $TEST_DEV | grep -q $TEST_DIR
         then
             echo "\$TEST_DEV is mounted but not on \$TEST_DIR - aborting"
             exit 1
-- 
2.1.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-30 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 19:32 [PATCH] common: Fixes for testing NFS over IPv6 Anna Schumaker
2014-10-29 23:33 ` Dave Chinner
2014-10-30 12:42   ` Anna Schumaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox