diff options
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r-- | meta/classes/testimage.bbclass | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 00f0c29836..c709384b91 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -364,6 +364,7 @@ def testimage_main(d): | |||
364 | package_extraction(d, tc.suites) | 364 | package_extraction(d, tc.suites) |
365 | 365 | ||
366 | results = None | 366 | results = None |
367 | complete = False | ||
367 | orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) | 368 | orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) |
368 | try: | 369 | try: |
369 | # We need to check if runqemu ends unexpectedly | 370 | # We need to check if runqemu ends unexpectedly |
@@ -375,6 +376,7 @@ def testimage_main(d): | |||
375 | except ValueError: | 376 | except ValueError: |
376 | pass | 377 | pass |
377 | results = tc.runTests() | 378 | results = tc.runTests() |
379 | complete = True | ||
378 | except (KeyboardInterrupt, BlockingIOError) as err: | 380 | except (KeyboardInterrupt, BlockingIOError) as err: |
379 | if isinstance(err, KeyboardInterrupt): | 381 | if isinstance(err, KeyboardInterrupt): |
380 | bb.error('testimage interrupted, shutting down...') | 382 | bb.error('testimage interrupted, shutting down...') |
@@ -382,20 +384,21 @@ def testimage_main(d): | |||
382 | bb.error('runqemu failed, shutting down...') | 384 | bb.error('runqemu failed, shutting down...') |
383 | if results: | 385 | if results: |
384 | results.stop() | 386 | results.stop() |
385 | results = None | 387 | results = tc.results |
386 | finally: | 388 | finally: |
387 | signal.signal(signal.SIGTERM, orig_sigterm_handler) | 389 | signal.signal(signal.SIGTERM, orig_sigterm_handler) |
388 | tc.target.stop() | 390 | tc.target.stop() |
389 | 391 | ||
390 | # Show results (if we have them) | 392 | # Show results (if we have them) |
391 | if not results: | 393 | if results: |
394 | configuration = get_testimage_configuration(d, 'runtime', machine) | ||
395 | results.logDetails(get_testimage_json_result_dir(d), | ||
396 | configuration, | ||
397 | get_testimage_result_id(configuration), | ||
398 | dump_streams=d.getVar('TESTREPORT_FULLLOGS')) | ||
399 | results.logSummary(pn) | ||
400 | if not results or not complete: | ||
392 | bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) | 401 | bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) |
393 | configuration = get_testimage_configuration(d, 'runtime', machine) | ||
394 | results.logDetails(get_testimage_json_result_dir(d), | ||
395 | configuration, | ||
396 | get_testimage_result_id(configuration), | ||
397 | dump_streams=d.getVar('TESTREPORT_FULLLOGS')) | ||
398 | results.logSummary(pn) | ||
399 | if not results.wasSuccessful(): | 402 | if not results.wasSuccessful(): |
400 | bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) | 403 | bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) |
401 | 404 | ||