From 7c33cfa6f51d31dae4e2a2b0b02929059003a073 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Mon, 15 Aug 2016 21:58:31 +0200 Subject: [PATCH] Refactored. --- Makefile | 2 +- test/ENABLE_POP3.bats | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/ENABLE_POP3.bats diff --git a/Makefile b/Makefile index c157459c..422a653e 100644 --- a/Makefile +++ b/Makefile @@ -62,4 +62,4 @@ endif clean: # Remove running test container - docker rm -f mail \ No newline at end of file + docker rm -f mail diff --git a/test/ENABLE_POP3.bats b/test/ENABLE_POP3.bats new file mode 100644 index 00000000..838bc956 --- /dev/null +++ b/test/ENABLE_POP3.bats @@ -0,0 +1,15 @@ +@test "checking pop: server is ready" { + if [ $ENABLE_POP != 1 ]; then + skip + fi + run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 110 | grep '+OK'" + [ "$status" -eq 0 ] +} + +@test "checking pop: authentication works" { + if [ $ENABLE_POP != 1 ]; then + skip + fi + run docker exec mail /bin/sh -c "nc -w 1 0.0.0.0 110 < /tmp/docker-mailserver-test/auth/pop3-auth.txt" + [ "$status" -eq 0 ] +}