summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2019-10-16 10:18:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-19 18:13:38 +0100
commitd99617b8f2a9354b7357524fcd2eee16af0677b7 (patch)
treed3bc9a3b112e53d87072a860b205d2d46cb8bb70
parent0ab7e3b573a58cc3a869ef33fd8737ca7fe04550 (diff)
downloadopenembedded-core-d99617b8f2a9354b7357524fcd2eee16af0677b7.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. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass12
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):
target_kwargs['serialcontrol_cmd'] = d.getVar("TEST_SERIALCONTROL_CMD") or None
target_kwargs['serialcontrol_extra_args'] = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or ""
+ def export_ssh_agent(d):
+ import os
+
+ variables = ['SSH_AGENT_PID', 'SSH_AUTH_SOCK']
+ for v in variables:
+ if v not in os.environ.keys():
+ val = d.getVar(v)
+ if val is not None:
+ os.environ[v] = val
+
+ export_ssh_agent(d)
+
# runtime use network for download projects for build
export_proxies(d)