]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o
authorKoen De Wit <koen.de.wit@oracle.com>
Tue, 2 Jul 2013 21:44:57 +0000 (21:44 +0000)
committerRich Johnston <rjohnston@sgi.com>
Thu, 15 Aug 2013 16:27:54 +0000 (11:27 -0500)
If multiple mount options are given with multiple -o parameters,
_mount_ops_filter concatenates them by replacing all -o's with a comma
(except for the first -o).

If $TEST_DIR contains "-o" (e.g. /mnt/test-os/) you get errors like this:

   # ./check generic/002
     mount: mount point /mnt/test,s/ does not exist
     common/rc: retrying test device mount with external set
     mount: mount point /mnt/test,s/ does not exist
     common/rc: could not mount /dev/sdc3 on /mnt/test-os/

Fix it by only replacing -o's that are preceded by at least one space.

Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/rc

index fe02f7996b5f1920ffaddf83529d07d0f2bd7961..a761833caacaac84c5a03e75d65442ceda19499b 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -268,7 +268,7 @@ _mount_ops_filter()
     # the sed script replaces all -o's (except the first) with a comma
     # not required for linux, but won't hurt
     
-    echo $params | sed -e 's/[[:space:]]*-o[[:space:]]*/UnIqUe/1; s/[[:space:]]*-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
+    echo $params | sed -e 's/[[:space:]]\+-o[[:space:]]*/UnIqUe/1; s/[[:space:]]\+-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
         | sed -e 's/dmapi/dmi/' \
         | $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$FS_ESCAPED\1\2#; print;"