test: ensure ssh-agent is configured #778

Merged
iexos merged 1 commits from test/ssh-agent into main 2026-02-17 12:54:41 +00:00

View File

@ -20,4 +20,20 @@ _common_setup() {
export TEST_RECIPE="abra-test-recipe"
_ensure_swarm
_ensure_ssh_agent
}
_ensure_ssh_agent() {
if ! command -v ssh-agent >/dev/null 2>&1
then
echo "ssh-agent is missing, please install it"
exit 1
fi
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
}