imagetest-qemu: Adapt to bitbake environment changes

Load environment variables like DISPLAY from BB_ORIGENV after recent
bitbake changes.

(From OE-Core rev: 8ad8b34b5ac36d805bb10c120f3388e7dce83b98)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2013-02-06 23:16:34 +00:00
parent fef84540e3
commit afd24faa00
1 changed files with 10 additions and 1 deletions

View File

@ -67,7 +67,6 @@ def qemuimagetest_main(d):
os.environ["DEPLOY_DIR"] = d.getVar("DEPLOY_DIR", True)
os.environ["QEMUARCH"] = machine
os.environ["QEMUTARGET"] = pname
os.environ["DISPLAY"] = d.getVar("DISPLAY", True)
os.environ["COREBASE"] = d.getVar("COREBASE", True)
os.environ["TOPDIR"] = d.getVar("TOPDIR", True)
os.environ["OE_TMPDIR"] = d.getVar("TMPDIR", True)
@ -76,6 +75,16 @@ def qemuimagetest_main(d):
os.environ["TEST_SERIALIZE"] = d.getVar("TEST_SERIALIZE", True)
os.environ["SDK_NAME"] = d.getVar("SDK_NAME", True)
# Add in all variables from the user's original environment which
# haven't subsequntly been set/changed
origbbenv = d.getVar("BB_ORIGENV", False) or {}
for key in origbbenv:
if key in os.environ:
continue
value = origbbenv.getVar(key, True)
if value is not None:
os.environ[key] = str(value)
"""run Test Case"""
bb.note("Run %s test in scenario %s" % (case, scen))
subprocess.call("%s" % fulltestpath, shell=True)