Refactored.

This commit is contained in:
Thomas VIAL 2016-08-16 19:15:28 +02:00
parent 7ab528c938
commit ad99e1126e
No known key found for this signature in database
GPG Key ID: 0394CEE552FAFEFC
1 changed files with 30 additions and 0 deletions

30
test/ENABLE_POP3.bats Normal file
View File

@ -0,0 +1,30 @@
if [ "$ENABLE_POP3" = 1 ]; then
@test "checking pop: process is running" {
run docker exec mail /bin/bash -c "ps aux | grep 'dovecot/pop'"
[ "$status" -eq 0 ]
}
@test "checking pop: server responds on port 110" {
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" {
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 ####################################################################################################
@test "checking process: process is not running" {
run docker exec mail /bin/bash -c "ps aux | grep 'dovecot/pop'"
[ "$status" -eq 1 ]
}
@test "checking pop: server does not respond on port 110" {
run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 110"
[ "$status" -eq 1 ]
}
fi