[PATCH 4/5] Fix up two problems in run_kickstart_tests.sh.

Chris Lumens clumens at redhat.com
Thu Dec 18 16:55:40 UTC 2014


(1) Give all temp directories a common format so I can glob on them in jenkins.

(2) Actually store the return value of the validate function for testing, and
get rid of redundant error checking in the same place.
---
 tests/kickstart_tests/run_kickstart_tests.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/tests/kickstart_tests/run_kickstart_tests.sh b/tests/kickstart_tests/run_kickstart_tests.sh
index 39c9d34..e83bdab 100755
--- a/tests/kickstart_tests/run_kickstart_tests.sh
+++ b/tests/kickstart_tests/run_kickstart_tests.sh
@@ -45,11 +45,13 @@ runone() {
     ks=${t/.sh/.ks}
     . $t
 
+    name=$(basename ${t%.sh})
+
     echo ${ks}
     echo ==============================
 
     # qemu user needs to be able to read the directory.
-    tmpdir=$(mktemp -d --tmpdir=/var/tmp)
+    tmpdir=$(mktemp -d --tmpdir=/var/tmp kstest-${name}.XXXXXXXX)
     chmod 755 ${tmpdir}
 
     ksfile=$(prepare ${ks} ${tmpdir})
@@ -93,14 +95,10 @@ runone() {
             return 1
         fi
 
-        validate ${trimmed}
+        result=$(validate ${trimmed})
         if [[ $? != 0 ]]; then
-            echo FAILED
-            rm -rf ${tmpdir}
-            unset kernel_args prep validate
-            return 1
-        elif [[ "${result}" != "SUCCESS" ]]; then
             echo ${result}
+            echo FAILED
             rm -rf ${tmpdir}
             unset kernel_args prep validate
             return 1
-- 
1.9.3



More information about the anaconda-patches mailing list