Refactored.

This commit is contained in:
Thomas VIAL 2016-08-16 19:34:41 +02:00
parent efecf09ebf
commit be5feec1be
No known key found for this signature in database
GPG Key ID: 0394CEE552FAFEFC
1 changed files with 45 additions and 23 deletions

View File

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