From 88ad4d4a2f5fc17487b679ce23271508bca409a5 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 11 May 2022 23:20:54 +0200 Subject: tests: add test for setup-sshd openssh Also set timout to 1 second so we can catch unexpected interactive questions. --- tests/setup_sshd_test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/setup_sshd_test') diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test index a373d8c..e813343 100755 --- a/tests/setup_sshd_test +++ b/tests/setup_sshd_test @@ -35,8 +35,21 @@ setup_sshd_dropbear_body() { setup-sshd dropbear } +atf_test_case setup_sshd_openssh +setup_sshd_openssh_body() { + init_env + atf_check -s exit:0 \ + -e empty \ + -o match:"^apk add .* openssh" \ + -o match:"^rc-update add sshd" \ + -o match:"^rc-service sshd start" \ + setup-sshd -k 'https://example.com/user.keys' openssh + grep '^wget .*https://example.com/user.keys$' root/.ssh/authorized_keys || atf_fail "failed to wget ssh key" +} + 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 } -- cgit v1.2.3