[PATCH] Fix up quoting around passing args to anaconda in the gui test.

Chris Lumens clumens at redhat.com
Thu May 29 17:30:39 UTC 2014


We go through a lot of layers - command line to shell a couple different ways,
then through noseconfig-testconfig, and into a python template, and finally
written into a python file.  Along the way, the string that actually runs
liveinst ended up looking like so:

    "liveinst "--updates=http://wherever/updates.img""

Which clearly is never going to work.  The changes in this patch make that one
continuous string, plus handle what happens if you want to pass multiple
arguments or no arguments.
---
 tests/gui/outside/__init__.py |  2 +-
 tests/gui/runtest.sh          | 21 +++++++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/tests/gui/outside/__init__.py b/tests/gui/outside/__init__.py
index f3d804f..823b84e 100644
--- a/tests/gui/outside/__init__.py
+++ b/tests/gui/outside/__init__.py
@@ -164,7 +164,7 @@ class Creator(object):
 
                 f.write(self.template % {"imports": "\n".join(imports),
                                          "addtests": "\n".join(addtests),
-                                         "anacondaArgs": config.get("anacondaArgs", "")})
+                                         "anacondaArgs": config.get("anacondaArgs", "").strip('"')})
         finally:
             # pylint: disable=undefined-variable
             b.devicetree.teardownDiskImages()
diff --git a/tests/gui/runtest.sh b/tests/gui/runtest.sh
index 87f2ee7..86f8e52 100755
--- a/tests/gui/runtest.sh
+++ b/tests/gui/runtest.sh
@@ -19,12 +19,17 @@
 # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
 
 function doit() {
-    nosetests -s \
-              -v \
-              --nologcapture \
-              --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
-              --tc=liveImage:"$1" $2 \
-              outside
+    ARGS="-s \
+          -v \
+          --nologcapture \
+          --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \
+          --tc=liveImage:"$1""
+
+    if [ -z "$2" ]; then
+        nosetests ${ARGS} outside
+    else
+        nosetests ${ARGS} "${2}" outside
+    fi
 }
 
 # We require the test_config plugin for nose, which is not currently packaged
@@ -67,9 +72,9 @@ fi
 # If we're being called from "make check", we will be outside the gui test directory.
 # Unfortunately, everything is written assuming that's where we will be.  So cd there.
 if [ -d gui ]; then
-    ( cd gui && doit "${LIVECD}" ${EXTRA} )
+    ( cd gui && doit "${LIVECD}" "${EXTRA}" )
 elif [ -d outside ]; then
-    doit "${LIVECD}" ${EXTRA}
+    doit "${LIVECD}" "${EXTRA}"
 else
     echo "Could not find test contents"
     exit 3
-- 
1.9.0



More information about the anaconda-patches mailing list