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:
Thomas Preisner 2025-08-10 18:34:36 +02:00
parent 3994d0ccd2
commit 56e8ce00b9
2 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{...}: {
{lib, ...}: {
imports = [./../../mailsystem];
config = {
virtualisation.memorySize = 1024;
@ -6,5 +6,12 @@
enable = true;
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
'';
};
}

View file

@ -152,8 +152,11 @@ in
client.succeed("${test-mark-spam "normal2"} >&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")
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"):
client.succeed("${sendMail "normal2" "" accounts."normal".address ''