tests: rspamd: Fix sieve tests
Currently, the sieve tests only check whether the sieve scripts were invoked. However, they could still fail due to wrong permissions, etc. This commit enables additional logging output for dovecot2 and refines the sieve tests to check for error messages.
This commit is contained in:
parent
3994d0ccd2
commit
56e8ce00b9
2 changed files with 11 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
{lib, ...}: {
|
||||||
imports = [./../../mailsystem];
|
imports = [./../../mailsystem];
|
||||||
config = {
|
config = {
|
||||||
virtualisation.memorySize = 1024;
|
virtualisation.memorySize = 1024;
|
||||||
|
|
@ -6,5 +6,12 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
certificateScheme = "selfsigned";
|
certificateScheme = "selfsigned";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable more verbose logging (required for, e.g., sieve testing)
|
||||||
|
services.dovecot2.extraConfig = lib.mkAfter ''
|
||||||
|
mail_debug = yes
|
||||||
|
auth_debug = yes
|
||||||
|
verbose_ssl = yes
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,11 @@ in
|
||||||
|
|
||||||
client.succeed("${test-mark-spam "normal2"} >&2")
|
client.succeed("${test-mark-spam "normal2"} >&2")
|
||||||
server.wait_until_succeeds("journalctl -u dovecot2 | grep -i learn-spam.sh >&2")
|
server.wait_until_succeeds("journalctl -u dovecot2 | grep -i learn-spam.sh >&2")
|
||||||
|
server.fail("journalctl -u dovecot2 | grep -i learn-spam.sh | grep -i error >&2")
|
||||||
|
|
||||||
client.succeed("${test-mark-ham "normal2"} >&2")
|
client.succeed("${test-mark-ham "normal2"} >&2")
|
||||||
server.wait_until_succeeds("journalctl -u dovecot2 | grep -i learn-ham.sh >&2")
|
server.wait_until_succeeds("journalctl -u dovecot2 | grep -i learn-ham.sh >&2")
|
||||||
|
server.fail("journalctl -u dovecot2 | grep -i learn-ham.sh | grep -i error >&2")
|
||||||
|
|
||||||
with subtest("dkim signing"):
|
with subtest("dkim signing"):
|
||||||
client.succeed("${sendMail "normal2" "" accounts."normal".address ''
|
client.succeed("${sendMail "normal2" "" accounts."normal".address ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue