aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-09-18 13:31:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:03 +0100
commitc8a7d76d36626deb23630a091c56e669e893de73 (patch)
tree303ff212b379a83a636a86552f91bb0183544242 /meta/classes/testimage.bbclass
parent7d166a6d0621e0b811d41cd3b1377850a88092f0 (diff)
downloadopenembedded-core-contrib-c8a7d76d36626deb23630a091c56e669e893de73.tar.gz
testimage.bbclass: Fix break introduced with SIGTERM handling
The SIGTERM introduced another break into runexported test, the handler is in the class TestContext while exporting it will try to convert the singnal handler to JSON, and this will throw an exception. The SIGTERM handler is not needed in the exported test, so this change will remove the handler before exporting the test. Also when a test is exported the target is not deployed/started anymore, it is not necessary. [YOCTO #8239] (From OE-Core rev: 94ab9892e87f159840432fdbfb3873d4496d4786) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r--meta/classes/testimage.bbclass20
1 files changed, 11 insertions, 9 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 70e28004fe..c62e391ec2 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -311,13 +311,15 @@ def testimage_main(d):
import traceback
bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
- target.deploy()
- try:
- target.start()
- if export:
- exportTests(d,tc)
- else:
+ if export:
+ signal.signal(signal.SIGTERM, tc.origsigtermhandler)
+ tc.origsigtermhandler = None
+ exportTests(d,tc)
+ else:
+ target.deploy()
+ try:
+ target.start()
starttime = time.time()
result = runTests(tc)
stoptime = time.time()
@@ -330,9 +332,9 @@ def testimage_main(d):
bb.plain(msg)
else:
raise bb.build.FuncFailed("%s - FAILED - check the task log and the ssh log" % pn )
- finally:
- signal.signal(signal.SIGTERM, tc.origsigtermhandler)
- target.stop()
+ finally:
+ signal.signal(signal.SIGTERM, tc.origsigtermhandler)
+ target.stop()
testimage_main[vardepsexclude] =+ "BB_ORIGENV"