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