summaryrefslogtreecommitdiff
path: root/poky/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes/testimage.bbclass')
-rw-r--r--poky/meta/classes/testimage.bbclass11
1 files changed, 4 insertions, 7 deletions
diff --git a/poky/meta/classes/testimage.bbclass b/poky/meta/classes/testimage.bbclass
index a76e773853..9980b3f626 100644
--- a/poky/meta/classes/testimage.bbclass
+++ b/poky/meta/classes/testimage.bbclass
@@ -235,9 +235,10 @@ def testimage_main(d):
tdname = "%s.testdata.json" % image_name
try:
- td = json.load(open(tdname, "r"))
- except (FileNotFoundError) as err:
- bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname)
+ with open(tdname, "r") as f:
+ td = json.load(f)
+ except FileNotFoundError as err:
+ bb.fatal('File %s not found (%s).\nHave you built the image with INHERIT += "testimage" in the conf/local.conf?' % (tdname, err))
# Some variables need to be updates (mostly paths) with the
# ones of the current environment because some tests require them.
@@ -316,10 +317,6 @@ def testimage_main(d):
if d.getVar("TESTIMAGE_BOOT_PATTERNS"):
target_kwargs['boot_patterns'] = get_testimage_boot_patterns(d)
- # TODO: Currently BBPATH is needed for custom loading of targets.
- # It would be better to find these modules using instrospection.
- target_kwargs['target_modules_path'] = d.getVar('BBPATH')
-
# hardware controlled targets might need further access
target_kwargs['powercontrol_cmd'] = d.getVar("TEST_POWERCONTROL_CMD") or None
target_kwargs['powercontrol_extra_args'] = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or ""