tests: test for the expected maildir and index dir locations
These are not ideal yet, but we should make them a fixture, so that we are always aware what they are for the different supported setups.
This commit is contained in:
parent
f25495cabf
commit
3c1cff431c
2 changed files with 214 additions and 193 deletions
|
@ -100,12 +100,18 @@ in
|
|||
|
||||
vmailGroupName = "vmail";
|
||||
vmailUID = 5000;
|
||||
indexDir = "/var/lib/dovecot/indices";
|
||||
|
||||
enableImap = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
testScript = ''
|
||||
testScript =
|
||||
{
|
||||
nodes,
|
||||
...
|
||||
}:
|
||||
''
|
||||
machine.start()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
|
@ -191,6 +197,11 @@ in
|
|||
with subtest("vmail gid is set correctly"):
|
||||
machine.succeed("getent group vmail | grep 5000")
|
||||
|
||||
with subtest("Check dovecot maildir and index locations"):
|
||||
# If these paths change we need a migration
|
||||
machine.succeed("doveadm user -f home user1@example.com | grep ${nodes.machine.config.mailserver.mailDirectory}/example.com/user1")
|
||||
machine.succeed("doveadm user -f mail user1@example.com | grep 'maildir:~/mail:INDEX=${nodes.machine.config.mailserver.indexDir}/example.com/user1'")
|
||||
|
||||
with subtest("mail to send only accounts is rejected"):
|
||||
machine.wait_for_open_port(25)
|
||||
# TODO put this blocking into the systemd units
|
||||
|
|
|
@ -90,6 +90,7 @@ in
|
|||
fqdn = "mail.example.com";
|
||||
domains = [ "example.com" ];
|
||||
localDnsResolver = false;
|
||||
indexDir = "/var/lib/dovecot/indices";
|
||||
|
||||
ldap = {
|
||||
enable = true;
|
||||
|
@ -115,7 +116,12 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
testScript = ''
|
||||
testScript =
|
||||
{
|
||||
nodes,
|
||||
...
|
||||
}:
|
||||
''
|
||||
import sys
|
||||
import re
|
||||
|
||||
|
@ -217,5 +223,9 @@ in
|
|||
]))
|
||||
machine.succeed("journalctl -u postfix | grep -q 'Sender address rejected: not owned by user bob@example.com'")
|
||||
|
||||
with subtest("Check dovecot mail and index locations"):
|
||||
# If these paths change we need a migration
|
||||
machine.succeed("doveadm user -f home bob@example.com | grep ${nodes.machine.config.mailserver.mailDirectory}/ldap/bob@example.com")
|
||||
machine.succeed("doveadm user -f mail bob@example.com | grep 'maildir:~/mail:INDEX=${nodes.machine.config.mailserver.indexDir}/ldap/bob@example.com'")
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue