From ff8ca5b5b74952487a1ec11a488297aed7e768c6 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Tue, 16 Aug 2016 15:20:48 +0200 Subject: [PATCH] Refactored. --- test/ENABLE_POP3.bats | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/test/ENABLE_POP3.bats b/test/ENABLE_POP3.bats index 53aaf0d5..1cc08fb4 100644 --- a/test/ENABLE_POP3.bats +++ b/test/ENABLE_POP3.bats @@ -1,19 +1,18 @@ -@test "checking pop: server is ready" { - run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 110 | grep '+OK'" +@test "checking pop: ENABLE_POP3=1 => server is running" { + if [ "$ENABLE_POP3" != 1 ]; then + skip + fi - if [ "$ENABLE_POP" -eq 1 ]; then + run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 110 | grep '+OK'" [ "$status" -eq 0 ] - else - [ "$status" -eq 1 ] - fi -} + } -@test "checking pop: authentication works" { - run docker exec mail /bin/sh -c "nc -w 1 0.0.0.0 110 < /tmp/docker-mailserver-test/auth/pop3-auth.txt" - if [ "$ENABLE_POP" -eq 1 ]; then +@test "checking pop: ENABLE_POP3=1 => authentication works" { + if [ "$ENABLE_POP3" != 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 ] - else - [ "$status" -eq 1 ] - fi }