summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2017-02-17 08:38:27 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2017-02-17 08:38:27 +0000
commita34987332d95c4cb8fe04de08ae4d32095220ee5 (patch)
treed6273b14725a99713808f40653e163bec126d14a
parent4c2b46f7e3dd1b92932ae04ba815405646ab9bb2 (diff)
start-container-docker.sh: Add ssh key to root user for test containers.
ABE's test-schroot.sh needs to connect to the 'test' container as 'root', so add the new temporary key to it too. Change-Id: Id018d26beeb93a7cd04b82a21fc31be6adbbd723
-rwxr-xr-xstart-container-docker.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/start-container-docker.sh b/start-container-docker.sh
index abebcd73..db81395e 100755
--- a/start-container-docker.sh
+++ b/start-container-docker.sh
@@ -146,6 +146,11 @@ session_port=$($DOCKER port $session_id 22 | cut -d: -f 2)
if [ "x`whoami`" = "xtcwg-buildslave" ]; then
$DOCKER cp $HOME/.ssh/authorized_keys ${session_id}:/home/tcwg-buildslave/.ssh/authorized_keys
+ # For 'test' containers, we also need to add the same keys to 'root'
+ if [ "${task}" = "test" ]; then
+ $DOCKER cp $HOME/.ssh/authorized_keys ${session_id}:/root/.ssh/authorized_keys
+ fi
+
# Start ssh-agent locally and add the right private key to it, but
# only if it is not already running. Indeed, even if we want to
# start several containers, we need only one ssh-agent.