[PATCH] If a VM isn't going to finish in 60 minutes, it likely isn't going to finish.

Chris Lumens clumens at redhat.com
Tue Feb 3 21:53:45 UTC 2015


While I'm at it, make the logging output a little easier to read with some more
newlines, and add a TEST_JOBS environment variable that lets you specify how
many VMs to run at a time.
---
 tests/gui/make_livecd.sh                     |  3 ++-
 tests/kickstart_tests/run_kickstart_tests.sh | 21 ++++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/tests/gui/make_livecd.sh b/tests/gui/make_livecd.sh
index 2679021..045ca84 100755
--- a/tests/gui/make_livecd.sh
+++ b/tests/gui/make_livecd.sh
@@ -85,6 +85,7 @@ livemedia-creator --make-iso \
                   --lorax-templates ${TEMPLATES} \
                   --ram 2048 \
                   --vcpus 2 \
-                  --kernel-args nomodeset
+                  --kernel-args nomodeset \
+                  --timeout 30
 rm livecd.ks
 rm -r ${TEMPLATES}
diff --git a/tests/kickstart_tests/run_kickstart_tests.sh b/tests/kickstart_tests/run_kickstart_tests.sh
index c6880bb..8b076f3 100755
--- a/tests/kickstart_tests/run_kickstart_tests.sh
+++ b/tests/kickstart_tests/run_kickstart_tests.sh
@@ -67,8 +67,10 @@ runone() {
 
     name=$(basename ${t%.sh})
 
+    echo
+    echo ============================================================
     echo ${ks}
-    echo ==============================
+    echo ============================================================
 
     # qemu user needs to be able to read the directory.
     tmpdir=$(mktemp -d --tmpdir=/var/tmp kstest-${name}.XXXXXXXX)
@@ -98,7 +100,8 @@ runone() {
                       --releasever 22 \
                       --ram 2048 \
                       --vcpus 2 \
-                      --vnc vnc
+                      --vnc vnc \
+                      --timeout 60
     if [[ $? != 0 ]]; then
         echo $(grep CRIT ${tmpdir}/virt-install.log)
         cleanup ${tmpdir}
@@ -108,8 +111,13 @@ runone() {
         img=$(grep disk_img ${tmpdir}/livemedia.log | cut -d= -f2)
         trimmed=${img## }
 
-        if [[ ! -f ${trimmed} ]]; then
-            echo Disk image ${trimmed} does not exist.
+        if [[ $(grep "due to timeout" ${tmpdir}/livemedia.log) != "" ]]; then
+           echo FAILED - Test timed out.
+           cleanup ${tmpdir}
+           unset kernel_args prep validate
+           return 1
+        elif [[ ! -f ${trimmed} ]]; then
+            echo FAILED - Disk image ${trimmed} does not exist.
             cleanup ${tmpdir}
             unset kernel_args prep validate
             return 1
@@ -117,8 +125,7 @@ runone() {
 
         result=$(validate ${trimmed})
         if [[ $? != 0 ]]; then
-            echo "${result}"
-            echo FAILED
+            echo FAILED - "${result}"
             cleanup ${tmpdir}
             unset kernel_args prep validate
             return 1
@@ -136,4 +143,4 @@ export -f cleanup runone
 # Round up all the kickstart tests we want to run, skipping those that are not
 # executable as well as this file itself.
 find kickstart_tests -name '*sh' -a -perm -o+x -a \! -wholename 'kickstart_tests/run_kickstart_tests.sh' | \
-parallel --jobs 2 runone {}
+parallel --jobs ${TEST_JOBS:-2} runone {}
-- 
2.2.2



More information about the anaconda-patches mailing list