From 1add61af39a2209e5d68163a4c93c516c2c2b69f Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 19 Oct 2024 16:53:45 +0200 Subject: [PATCH] build: Fix ssh-agent testing --- container/devshell/test-ssh-agent | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/container/devshell/test-ssh-agent b/container/devshell/test-ssh-agent index 49913c8..790a9de 100755 --- a/container/devshell/test-ssh-agent +++ b/container/devshell/test-ssh-agent @@ -6,11 +6,11 @@ cd "$(dirname "$0")" # currently that is not what this tests: instead it's testing SSH from where this runs into a container, with an agent. # Test that the local SSH Agent works (on the laptop/build server, where this script runs; NOT in container) -if [ -z "$SSH_AUTH_SOCK" ]; then +SSH_AUTH_SOCK=${SSH_AUTH_SOCK:-default_value} +if [[ -z "$SSH_AUTH_SOCK" || "$SSH_AUTH_SOCK" == "default_value" ]]; then echo "Starting SSH Agent..." eval "$(ssh-agent -s)" fi -ssh-add -l # TODO instead of copy/paste from ../sshd/test, share common test harness structure.. @@ -21,6 +21,7 @@ sleep 2 rm -f /tmp/test-$$-id_rsa* ssh-keygen -f /tmp/test-$$-id_rsa -P "" -C test +ssh-add /tmp/test-$$-id_rsa docker exec test-"$1" /usr/local/sbin/add-uid-key tester /bin/bash "$(cat /tmp/test-$$-id_rsa.pub)" # NB -A for Agent Forwarding!