diff options
author | André Draszik <git@andred.net> | 2019-10-16 10:18:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-19 23:18:33 +0100 |
commit | 8073884454ff08c74a1dfffa2c56cf9bd0fa3769 (patch) | |
tree | e00b400878b25747a4c603b5602a7bcdfc499a46 /meta/classes/testimage.bbclass | |
parent | c25a3336e283470b02a522f51df1c794043f3300 (diff) | |
download | poky-8073884454ff08c74a1dfffa2c56cf9bd0fa3769.tar.gz |
testimage.bbclass: enable ssh agent forwarding
Some targets might use ssh to do their power- or serial-
control. In that case, ssh might need access to the
ssh agent, or otherwise won't work.
So export it into the environment.
Note that the (old) oeqa/controllers/masterimage.py
tries to do that as well by exporting all of BB_ORIGENV
into the test environment. Here in testimage.bbclass we
are a bit more strict and only pass the ssh related
environment variables.
(From OE-Core rev: d99617b8f2a9354b7357524fcd2eee16af0677b7)
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r-- | meta/classes/testimage.bbclass | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index befda6b72c..844ed87944 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -268,6 +268,18 @@ def testimage_main(d): | |||
268 | target_kwargs['serialcontrol_cmd'] = d.getVar("TEST_SERIALCONTROL_CMD") or None | 268 | target_kwargs['serialcontrol_cmd'] = d.getVar("TEST_SERIALCONTROL_CMD") or None |
269 | target_kwargs['serialcontrol_extra_args'] = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or "" | 269 | target_kwargs['serialcontrol_extra_args'] = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or "" |
270 | 270 | ||
271 | def export_ssh_agent(d): | ||
272 | import os | ||
273 | |||
274 | variables = ['SSH_AGENT_PID', 'SSH_AUTH_SOCK'] | ||
275 | for v in variables: | ||
276 | if v not in os.environ.keys(): | ||
277 | val = d.getVar(v) | ||
278 | if val is not None: | ||
279 | os.environ[v] = val | ||
280 | |||
281 | export_ssh_agent(d) | ||
282 | |||
271 | # runtime use network for download projects for build | 283 | # runtime use network for download projects for build |
272 | export_proxies(d) | 284 | export_proxies(d) |
273 | 285 | ||