summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:13:22 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:52:55 +0200
commit9f8f85fac8f1681d3367b96734b9595584955570 (patch)
tree27f3c9b9e2546f7e3a18b792d78f6e5d147bac24 /tests
parenta85c1858548b8686d8dcba44b1f4f9ff82e1d234 (diff)
downloadalpine-conf-9f8f85fac8f1681d3367b96734b9595584955570.zip
tests: add test for setup-mta
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_mta_test20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/setup_mta_test b/tests/setup_mta_test
new file mode 100755
index 0000000..726713c
--- /dev/null
+++ b/tests/setup_mta_test
@@ -0,0 +1,20 @@
+#!/usr/bin/env atf-sh
+
+. $(atf_get_srcdir)/test_env.sh
+init_tests \
+ setup_mta_usage \
+ setup_mta
+
+setup_mta_usage_body() {
+ test_usage setup-mta
+}
+
+setup_mta_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o match:"apk add ssmtp" \
+ -e empty \
+ setup-mta smtp.example.com
+ grep -q 'mailhub=smtp.example.com' etc/ssmtp/ssmtp.conf || atf_fail "smtp.example.com not set in etc/ssmtp/ssmtp.conf"
+}
+