Attempt to add tests

This commit is contained in:
Arne Kepp 2017-04-15 00:15:05 +02:00
parent 51b0542869
commit 5326a7087a
5 changed files with 25 additions and 0 deletions

View File

@ -156,6 +156,7 @@ fixtures:
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-regexp-alias-local.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-catchall-local.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/sieve-spam-folder.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/sieve-pipe.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/non-existing-user.txt"
docker exec mail_disabled_clamav_spamassassin /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-user.txt"
# postfix virtual transport lmtp

View File

@ -0,0 +1,2 @@
#!/bin/bash
cat - > /tmp/pipe-test.out

View File

@ -0,0 +1,4 @@
require ["copy", "envelope", "vnd.dovecot.pipe"];
if envelope :is "from" "sieve.pipe@test.localdomain" {
pipe :copy "pipe_to_tmp";
}

View File

@ -0,0 +1,12 @@
HELO mail.external.tld
MAIL FROM: user@external.tld
RCPT TO: user1@localhost.localdomain
DATA
From: Sieve-pipe-test <sieve.pipe@test.localdomain>
To: Existing Local User <alias2@localhost.localdomain>
Date: Sat, 22 May 2010 07:43:25 -0400
Subject: Sieve pipe test message
This is a test mail to sieve pipe.
.
QUIT

View File

@ -771,6 +771,12 @@ load 'test_helper/bats-assert/load'
assert_failure
}
@test "checking sieve: user1 should have pipe 1 email to /tmp/" {
run docker exec mail /bin/sh -c "ls -A /tmp/pipe-test.out | wc -l"
assert_success
assert_output 1
}
#
# accounts
#