diff options
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 10 | ||||
-rwxr-xr-x | debian/tests/socket-activation | 27 |
2 files changed, 37 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control index f7c0afb..0f5a493 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -25,3 +25,13 @@ Depends: krb5-admin-server, krb5-kdc, openssh-server, + +Tests: + socket-activation, +Restrictions: + allow-stderr, + isolation-container, + needs-root, +Depends: + openssh-server, + sudo, diff --git a/debian/tests/socket-activation b/debian/tests/socket-activation new file mode 100755 index 0000000..20a0d0b --- /dev/null +++ b/debian/tests/socket-activation @@ -0,0 +1,27 @@ +#! /bin/sh +set -e + +testuser="testuser$$" +adduser --quiet --disabled-password --gecos "" "$testuser" +sudo -u "$testuser" mkdir -m700 "/home/$testuser/.ssh" +sudo -u "$testuser" \ + ssh-keygen -t ed25519 -N '' -f "/home/$testuser/.ssh/id_ed25519" +sudo -u "$testuser" \ + cp "/home/$testuser/.ssh/id_ed25519.pub" \ + "/home/$testuser/.ssh/authorized_keys" + +cleanup () { + if [ $? -ne 0 ]; then + echo "## Something failed" + echo + echo "## ssh server log" + journalctl -b -u ssh.service --lines 100 + fi +} + +trap cleanup EXIT + +systemctl disable --now ssh.service +systemctl enable --now ssh.socket +sudo -u "$testuser" \ + ssh -oStrictHostKeyChecking=accept-new "$testuser@localhost" date |