]> code.ossystems Code Review - openembedded-core.git/commit
QemuRunner: avoid tainting os.environ
authorPatrick Ohly <patrick.ohly@intel.com>
Wed, 3 May 2017 13:38:53 +0000 (15:38 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 May 2017 13:01:38 +0000 (14:01 +0100)
commitcab20f3b2fe668a63c58b44f2ad797fed74226fe
tree8b2171c9260481799144352569e391d9050e319e
parent35d2cb0c7945d5d115b8e5a320b6bd769cb61a27
QemuRunner: avoid tainting os.environ

That a utility function permanently changes the process environment is
bad style and leads to subtle, hard to debug problems.

For example, we had one oe-selftest which used runqemu() with an
override for DEPLOY_DIR_IMAGE. Another test then just called runCmd()
and ended up passing the wrong DEPLOY_DIR_IMAGE set earlier in
os.environ.

The approach used here is to pass the desired environment dict to the
launch() method as a new, optional parameter, which then gets passed
on to subproject.Popen(). The modified env variables do not get
logged, as before.

[YOCTO #11443]

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/utils/qemurunner.py