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

Proposed by C de-Avillez
Status: Merged
Merged at revision: 241
Proposed branch: lp:~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked
Merge into: lp:ubuntu-server-iso-testing
Diff against target: 46 lines (+18/-4)
1 file modified
run-test.py (+18/-4)
To merge this branch: bzr merge lp:~hggdh2/ubuntu-server-iso-testing/d-i-question-will-be-asked
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+71717@code.launchpad.net

Description of the change

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. This change has been running on wazn for the last 4 days.

To post a comment you must log in.
240. By C de-Avillez

run-test.py: really. If I set a def with a variable being passed, I should use it. Sigh. Thanks to Jean-Baptiste for spotting the obvious

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

looks good. thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-test.py'
2--- run-test.py 2011-08-11 13:42:45 +0000
3+++ run-test.py 2011-08-16 15:53:23 +0000
4@@ -557,6 +557,19 @@
5 output = proc.communicate()[0].strip()
6 return output
7
8+def check_for_errors(di_syslog):
9+ if di_syslog is None:
10+ # nothing to check on
11+ return False
12+ if "question will be asked" in di_syslog:
13+ return True
14+
15+def end_VM(VM_id):
16+ logging.debug("Terminating test case %s" % (VM_id))
17+ cmd = [ "virsh", "destroy", VM_id]]
18+ logging.debug("Cmd: %s" % (cmd))
19+ subprocess.check_call(cmd)
20+
21 start_time = time.time()
22 while True:
23 if l_ipAddress is None:
24@@ -567,6 +580,10 @@
25 # if no different for a while, d-i stalled?
26 l_output = get_diSyslog(test['_id'], l_ipAddress)
27 logging.debug(l_output)
28+ if check_for_errors(l_output):
29+ logging.info("Test %s: debian-installer reports error" % test['_id'])
30+ end_VM(test['_id'])
31+ break
32
33 logging.debug("Checking VM state for test case %s" % test['_id'])
34 cmd = [ "virsh", "domstate", test['_id']]
35@@ -582,10 +599,7 @@
36 break
37 elif start_time + TEST_TIMEOUT < time.time():
38 logging.debug("Test %s failed to execute within %d minutes" % (test['_id'], TEST_TIMEOUT / 60))
39- logging.debug("Terminating test case %s" % (test['_id']))
40- cmd = [ "virsh", "destroy", test['_id']]
41- logging.debug("Cmd: %s" % (cmd))
42- subprocess.check_call(cmd)
43+ end_VM(test['_id'])
44 break
45 else:
46 # Have another look in SLEEP_TIME seconds

Subscribers

People subscribed via source and target branches