Refactored.

This commit is contained in:
Thomas VIAL 2016-08-16 18:07:09 +02:00
parent ff8ca5b5b7
commit bec2b0ac1d
No known key found for this signature in database
GPG Key ID: 0394CEE552FAFEFC
3 changed files with 2 additions and 49 deletions

View File

@ -57,11 +57,11 @@ tests:
# Start tests
ifdef ENABLE_POP3
@echo "ENABLE_POP3 => $(ENABLE_POP3)"
./test/bats/bats test/ENABLE_POP3.bats
./test/bats/bats test/ENABLE_POP3_$(ENABLE_POP3).bats
endif
ifdef SASL_PASSWD
@echo "SASL_PASSWD => $(SASL_PASSWD)"
./test/bats/bats test/SASL_PASSWD.bats
./test/bats/bats test/SASL_PASSWD_$(SASL_PASSWD_).bats
endif
clean:

View File

@ -1,18 +0,0 @@
@test "checking pop: ENABLE_POP3=1 => server is running" {
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: 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 ]
}

View File

@ -1,29 +0,0 @@
@test "checking sasl: doveadm auth test works with good password" {
run docker exec mail /bin/sh -c "doveadm auth test -x service=smtp user2@otherdomain.tld mypassword | grep 'auth succeeded'"
if [ -n "$SASL_PASSWD" ]; then
[ "$status" -eq 0 ]
else
[ "$status" -eq 1 ]
fi
}
@test "checking sasl: doveadm auth test fails with bad password" {
run docker exec mail /bin/sh -c "doveadm auth test -x service=smtp user2@otherdomain.tld BADPASSWORD | grep 'auth failed'"
if [ -n "$SASL_PASSWD" ]; then
[ "$status" -eq 0 ]
else
[ "$status" -eq 1 ]
fi
}
@test "checking sasl: sasl_passwd.db exists" {
run docker exec mail [ -f /etc/postfix/sasl_passwd.db ]
if [ -n "$SASL_PASSWD" ]; then
[ "$status" -eq 0 ]
else
[ "$status" -eq 1 ]
fi
}