From dcad03f3f030bba2e4082106c6543472b8f1efbb Mon Sep 17 00:00:00 2001 From: Thorsten von Eicken Date: Mon, 23 May 2016 21:30:22 -0700 Subject: [PATCH] add forgotten tests.bat --- test/tests.bats | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/tests.bats b/test/tests.bats index 4a6eaf51..2bab78ff 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -140,10 +140,16 @@ [ "$output" = 1 ] } -@test "checking smtp: user1 should have received 2 mails" { +@test "checking smtp: delivers mail to regexp alias" { + run docker exec mail /bin/sh -c "grep 'to=, orig_to=' /var/log/mail/mail.log | grep 'status=sent' | wc -l" + [ "$status" -eq 0 ] + [ "$output" = 1 ] +} + +@test "checking smtp: user1 should have received 3 mails" { run docker exec mail /bin/sh -c "ls -A /var/mail/localhost.localdomain/user1/new | wc -l" [ "$status" -eq 0 ] - [ "$output" = 2 ] + [ "$output" = 3 ] } @test "checking smtp: rejects mail to unknown user" { @@ -152,7 +158,7 @@ [ "$output" = 1 ] } -@test "checking smtp: redirects mail to external alias" { +@test "checking smtp: redirects mail to external aliases" { run docker exec mail /bin/sh -c "grep -- '-> ' /var/log/mail/mail.log | wc -l" [ "$status" -eq 0 ] [ "$output" = 1 ]