Refactored.
This commit is contained in:
parent
21ed11b5b6
commit
ce4c2059bb
4
Makefile
4
Makefile
|
@ -59,6 +59,10 @@ ifdef ENABLE_POP3
|
||||||
@echo "ENABLE_POP3 => $(ENABLE_POP3)"
|
@echo "ENABLE_POP3 => $(ENABLE_POP3)"
|
||||||
./test/bats/bats test/ENABLE_POP3.bats
|
./test/bats/bats test/ENABLE_POP3.bats
|
||||||
endif
|
endif
|
||||||
|
ifdef SASL_PASSWD
|
||||||
|
@echo "SASL_PASSWD => $(SASL_PASSWD)"
|
||||||
|
./test/bats/bats test/SASL_PASSWD.bats
|
||||||
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
# Remove running test container
|
# Remove running test container
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
@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
|
||||||
|
}
|
|
@ -84,29 +84,6 @@ fi
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# sasl
|
|
||||||
#
|
|
||||||
|
|
||||||
if [ $SASL_PASSWD == "external-domain.com username:password" ]; then
|
|
||||||
|
|
||||||
@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'"
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@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'"
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "checking sasl: sasl_passwd.db exists" {
|
|
||||||
run docker exec mail [ -f /etc/postfix/sasl_passwd.db ]
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# logs
|
# logs
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue