Merge lp:~james-page/ubuntu-server-iso-testing/reboot-testing-fixes into lp:ubuntu-server-iso-testing

Proposed by James Page on 2012-03-15
Status: Merged
Merged at revision: 259
Proposed branch: lp:~james-page/ubuntu-server-iso-testing/reboot-testing-fixes
Merge into: lp:ubuntu-server-iso-testing
Diff against target: 35 lines (+6/-4)
1 file modified
run-test.py (+6/-4)
To merge this branch: bzr merge lp:~james-page/ubuntu-server-iso-testing/reboot-testing-fixes
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement 2012-03-15 Approve on 2012-03-19
Review via email: mp+97598@code.launchpad.net

Description of the Change

Fixup handling of errors on timeout of testing.

To post a comment you must log in.
Jean-Baptiste Lallement (jibel) wrote :

approved. 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 2012-03-14 10:12:08 +0000
3+++ run-test.py 2012-03-15 09:58:18 +0000
4@@ -700,7 +700,7 @@
5 if not os.path.exists(testresultsdir):
6 os.makedirs(testresultsdir)
7
8-if test['states'].has_key('tested'):
9+if test['states'].has_key('tested') and test.has_key('results'):
10 # Testing appears to have completed - VM ran and run_tests
11 # execute and wrote to CouchDB
12 # Retrieve log output an place in hudson workspace
13@@ -719,10 +719,10 @@
14 f.close()
15 test_completed = True
16 else:
17- logging.debug("VM for test case %s powered off but tests not completed" % test['_id'])
18+ logging.error("VM for test case %s powered off but tests not completed" % test['_id'])
19
20-if test['states'].has_key('rebooted'):
21- logging.debug("Test case %s rebooted." % test['_id'])
22+if test['states'].has_key('rebooted') and test.has_key('post-reboot-results'):
23+ logging.debug("Reboot tests completed for test case %s" % test['_id'])
24 post_reboot_results = test['post-reboot-results']
25 for test_result in post_reboot_results:
26 logging.debug("Storing results for test %s", test_result)
27@@ -734,6 +734,8 @@
28 f = open (test_results_file, 'w')
29 f.write(test['post-reboot-results'][test_result]['script_stdout'])
30 f.close()
31+elif test['states'].has_key('rebooted') and not test.has_key('post-reboot-results'):
32+ logging.error("VM for test case %s rebooted but reboot tests not completed", test['_id'])
33
34 # save D-I logs no matter what (if they exist, of course)
35 if os.path.isfile(syslog_path):

Subscribers

People subscribed via source and target branches