1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-07 16:59:22 +00:00

oeqa/utils/commands.py: allow use of binaries from native sysroot

Tests may need to run a native tool that is not available on the host
filesystem, but can be built using one of the *-native recipes. In such case,
the tool will be available in native sysroot, and running in from that location
will require adjustments to PATH.

runCmd() can now take a path to native sysroot as one of its arguments and
setup PATH accordingly.

(From OE-Core rev: f2a04631949db72d4261d1c142c5044fad3741f9)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Maciej Borzecki
2016-12-19 12:20:57 +01:00
committed by Richard Purdie
parent ba4aeb33a2
commit 5903182484
+8 -1
View File
@@ -97,9 +97,16 @@ class Result(object):
pass
def runCmd(command, ignore_status=False, timeout=None, assert_error=True, **options):
def runCmd(command, ignore_status=False, timeout=None, assert_error=True, native_sysroot=None, **options):
result = Result()
if native_sysroot:
extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
(native_sysroot, native_sysroot, native_sysroot)
nenv = dict(options.get('env', os.environ))
nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '')
options['env'] = nenv
cmd = Command(command, timeout=timeout, **options)
cmd.run()