diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/setup_sshd_test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test index fc9118d..c7701b1 100755 --- a/tests/setup_sshd_test +++ b/tests/setup_sshd_test @@ -51,9 +51,25 @@ setup_sshd_openssh_body() { grep '^wget .*https://example.com/user.keys$' root/.ssh/authorized_keys || atf_fail "failed to wget ssh key" } +atf_test_case setup_sshd_interactive +setup_sshd_interactive_body() { + init_env + mkdir -p etc/ssh + echo "PermitRootLogin foobar" > etc/ssh/sshd_config + printf "%s\n%s\n" openssh no | atf_check -s exit:0 \ + -e empty \ + -o match:"Which SSH server" \ + -o match:"^apk add .* openssh" \ + -o match:"^rc-update add sshd" \ + -o match:"^rc-service sshd start" \ + setup-sshd + grep '^PermitRootLogin no$' etc/ssh/sshd_config || atf_fail "did not set PermitRootLogin" +} + atf_init_test_cases() { atf_add_test_case setup_sshd_help atf_add_test_case setup_sshd_empty atf_add_test_case setup_sshd_dropbear atf_add_test_case setup_sshd_openssh + atf_add_test_case setup_sshd_interactive } |