From 53959b8eaed9a40958983c31df18f0df8614f298 Mon Sep 17 00:00:00 2001 From: Chris54721 Date: Fri, 18 Mar 2016 20:12:18 +0100 Subject: [PATCH] Add tests for SASL_PASSWD --- Makefile | 11 ++++++----- test/tests.bats | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a64deb56..aed0b797 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ run: -e SA_TAG=1.0 \ -e SA_TAG2=2.0 \ -e SA_KILL=3.0 \ + -e SASL_PASSWD=testing \ -h mail.my-domain.com -t $(NAME) docker run -d --name mail_pop3 \ -v "`pwd`/postfix":/tmp/postfix \ @@ -37,11 +38,11 @@ run: fixtures: # Sending test mails - docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/amavis-spam.txt" - docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/amavis-virus.txt" - docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-alias-external.txt" - docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-alias-local.txt" - docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-user.txt" + docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/amavis-spam.txt" + docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/amavis-virus.txt" + docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-alias-external.txt" + docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-alias-local.txt" + docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/existing-user.txt" docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/test/email-templates/non-existing-user.txt" # Wait for mails to be analyzed sleep 10 diff --git a/test/tests.bats b/test/tests.bats index 89de473e..8cfe488e 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -105,6 +105,11 @@ [ "$status" -eq 0 ] } +@test "checking sasl: sasl_passwd.db exists" { + run docker exec mail [ -f /etc/postfix/sasl_passwd.db ] + [ "$status" -eq 0 ] +} + # # smtp #