diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-11 23:20:54 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-11 23:20:54 +0200 |
commit | 88ad4d4a2f5fc17487b679ce23271508bca409a5 (patch) | |
tree | 8c33fdb2ea6b41288847a885635dfa82c81f3763 /tests/setup_sshd_test | |
parent | d6ef68b85ab1cc932b98a28b82c392a01d20765d (diff) | |
download | alpine-conf-88ad4d4a2f5fc17487b679ce23271508bca409a5.zip |
tests: add test for setup-sshd openssh
Also set timout to 1 second so we can catch unexpected interactive
questions.
Diffstat (limited to 'tests/setup_sshd_test')
-rwxr-xr-x | tests/setup_sshd_test | 13 |
1 files changed, 13 insertions, 0 deletions
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 } |