mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-06-05 02:20:30 +00:00
arm/lib: pass the PATH to fvp runner
When running an FVP machine the model executable need to be found in the PATH environement. At the moment the script doesn't provide any PATH to the subprocess. Add PATH to the allowed environement variable to be forwaded. Signed-off-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -91,7 +91,7 @@ class FVPRunner:
|
||||
# Pass through environment variables needed for GUI applications, such
|
||||
# as xterm, to work.
|
||||
env = config['env']
|
||||
for name in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY'):
|
||||
for name in ('DISPLAY', 'PATH', 'WAYLAND_DISPLAY', 'XAUTHORITY'):
|
||||
if name in os.environ:
|
||||
env[name] = os.environ[name]
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ class RunnerTests(OESelftestTestCase):
|
||||
def create_mock(self):
|
||||
return unittest.mock.patch("subprocess.Popen")
|
||||
|
||||
@unittest.mock.patch.dict(os.environ, {"PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"})
|
||||
def test_start(self):
|
||||
from fvp import runner
|
||||
with self.create_mock() as m:
|
||||
@@ -106,9 +107,9 @@ class RunnerTests(OESelftestTestCase):
|
||||
stdin=unittest.mock.ANY,
|
||||
stdout=unittest.mock.ANY,
|
||||
stderr=unittest.mock.ANY,
|
||||
env={"FOO":"BAR"})
|
||||
env={"FOO":"BAR", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"})
|
||||
|
||||
@unittest.mock.patch.dict(os.environ, {"DISPLAY": ":42", "WAYLAND_DISPLAY": "wayland-42"})
|
||||
@unittest.mock.patch.dict(os.environ, {"DISPLAY": ":42", "WAYLAND_DISPLAY": "wayland-42", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"})
|
||||
def test_env_passthrough(self):
|
||||
from fvp import runner
|
||||
with self.create_mock() as m:
|
||||
@@ -128,4 +129,4 @@ class RunnerTests(OESelftestTestCase):
|
||||
stdin=unittest.mock.ANY,
|
||||
stdout=unittest.mock.ANY,
|
||||
stderr=unittest.mock.ANY,
|
||||
env={"DISPLAY":":42", "FOO": "BAR", "WAYLAND_DISPLAY": "wayland-42"})
|
||||
env={"DISPLAY":":42", "FOO": "BAR", "WAYLAND_DISPLAY": "wayland-42", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"})
|
||||
|
||||
Reference in New Issue
Block a user