tests: Properly set up ssh access

Allow the unprivileged `runtest` account to ssh to localhost as root.
This commit is contained in:
Martin Pitt 2020-06-14 22:49:33 +02:00
parent a6f0e0a3b0
commit ebd03582ec

View File

@ -26,6 +26,10 @@ fi
# create user account for running the test
if ! id runtest 2>/dev/null; then
useradd -c 'Test runner' runtest
# allow test to set up things on the machine
mkdir -p /root/.ssh
curl https://raw.githubusercontent.com/cockpit-project/bots/master/machine/identity.pub >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
chown -R runtest "$SOURCE"