← Back to team overview

ubuntu-server-iso-testing-dev team mailing list archive

lp:~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked into lp:ubuntu-server-iso-testing

 

C de-Avillez has proposed merging lp:~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked into lp:ubuntu-server-iso-testing.

Requested reviews:
  Ubuntu Server Iso Testing Developers (ubuntu-server-iso-testing-dev)

For more details, see:
https://code.launchpad.net/~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked/+merge/71717

Added a check on run-test.py -- if debian-installer prints 'question will be asked' then end test run -- nothing will happen, anymore, since user input is required.
-- 
https://code.launchpad.net/~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked/+merge/71717
Your team Ubuntu Server Iso Testing Developers is requested to review the proposed merge of lp:~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked into lp:ubuntu-server-iso-testing.
=== modified file 'run-test.py'
--- run-test.py	2011-08-11 13:42:45 +0000
+++ run-test.py	2011-08-16 15:34:22 +0000
@@ -557,6 +557,19 @@
     output = proc.communicate()[0].strip()
     return output
 
+def check_for_errors(di_syslog):
+    if di_syslog is None:
+        # nothing to check on
+        return False
+    if "question will be asked" in di_syslog:
+        return True
+
+def end_VM(VM_id):
+    logging.debug("Terminating test case %s" % (test['_id']))
+    cmd = [ "virsh", "destroy", test['_id']]
+    logging.debug("Cmd: %s" % (cmd))
+    subprocess.check_call(cmd)
+
 start_time = time.time()
 while True:
     if l_ipAddress is None:
@@ -567,6 +580,10 @@
         # if no different for a while, d-i stalled?
         l_output = get_diSyslog(test['_id'], l_ipAddress)
         logging.debug(l_output)
+        if check_for_errors(l_output):
+            logging.info("Test %s: debian-installer reports error" % test['_id'])
+            end_VM(test['_id'])
+            break
 
     logging.debug("Checking VM state for test case %s" % test['_id'])
     cmd = [ "virsh", "domstate", test['_id']]
@@ -582,10 +599,7 @@
         break
     elif start_time + TEST_TIMEOUT < time.time():
         logging.debug("Test %s failed to execute within %d minutes" % (test['_id'], TEST_TIMEOUT / 60))
-        logging.debug("Terminating test case %s" % (test['_id']))
-        cmd = [ "virsh", "destroy", test['_id']]
-        logging.debug("Cmd: %s" % (cmd))
-        subprocess.check_call(cmd)
+        end_VM(test['_id'])
         break
     else:
         # Have another look in SLEEP_TIME seconds


Follow ups