summaryrefslogtreecommitdiff
path: root/tests/setup_sshd_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-11 21:18:53 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-11 21:28:50 +0200
commit1adfe4072438b0f3954c6ef1fba87d7f37022409 (patch)
tree5bd94579fcd53a56864ef111f04bbc32c701d3a1 /tests/setup_sshd_test
parent87439a6ee0ac18ad5ed1b143299b6f0f9c11b6bb (diff)
downloadalpine-conf-1adfe4072438b0f3954c6ef1fba87d7f37022409.zip
tests: add testing with kyua
Use kyua to do testing.
Diffstat (limited to 'tests/setup_sshd_test')
-rwxr-xr-xtests/setup_sshd_test42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test
new file mode 100755
index 0000000..a373d8c
--- /dev/null
+++ b/tests/setup_sshd_test
@@ -0,0 +1,42 @@
+#!/usr/bin/env atf-sh
+
+PATH=$(atf_get_srcdir)/..:$PATH
+
+init_env() {
+ export ROOT=$PWD LIBDIR=$(atf_get_srcdir)/.. MOCK=echo
+}
+
+atf_test_case setup_sshd_help
+setup_sshd_help_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o match:'^usage:' \
+ -e empty \
+ setup-sshd -h
+}
+
+atf_test_case setup_sshd_empty
+setup_sshd_empty_body() {
+ init_env
+ atf_check -s exit:0 \
+ -e empty \
+ -o empty \
+ setup-sshd none
+}
+
+atf_test_case setup_sshd_dropbear
+setup_sshd_dropbear_body() {
+ init_env
+ atf_check -s exit:0 \
+ -e empty \
+ -o match:"^apk add .* dropbear" \
+ -o match:"^rc-update add dropbear" \
+ -o match:"^rc-service dropbear start" \
+ setup-sshd dropbear
+}
+
+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
+}