Closed Mischback closed 2 years ago
Adjust the output of the test suite.
https://stackoverflow.com/a/16974979 suggests defining own logging levels, which may cover the gap between DEBUG
and INFO
and https://stackoverflow.com/a/35804945 shows how to do this (final implementation: https://github.com/madphysicist/haggis/blob/master/src/haggis/logs.py)!
To make the name resolution work during the test suite, the SUT's /etc/hosts
is modified to include another-host.test
.
For Postfix
to pick this up, the following setting has to be applied
smtp_host_lookup = dns,native
By default, Postfix
will only use the (system-configured) DNS server to resolve hosts, which is generally desired. Adding native
enables lookups from /etc/hosts
for hosts, that are not resolvable by DNS (and the *.test
TLD is never resolvable by DNS).
The Python-based test suite should verify, that the general setup of the different components is working.
Prerequisites
mail.sut.test
providing (virtual) mail addresses@sut.test
Test Cases
[x] SMTP (:25)
virtual_alias
config, can we use this as an input to the SMTP test suite, to send a mail to every valid recipient?[x] TODO: As of now, the implementation of
SmtpTestSuite
makes assumptions about the setup of the virtual alias database; this makes the whole test suite highly dependent on the actual test setup; this might be fixed by just returning adict
of the formThen, the test runner
tests/mailsrv_test_suite.py
can merge the results ofSmtpTestSuite
andSmtpStarttlsTestSuite
and process them by resolving the aliases.logging
messages. This should be fixed.SmtpTestSuite
may be simplified significantly!user_one@sut.test
:MAIL FROM: sender@another-host.test
RCPT TO: user_one@sut.test
Maildir
ofuser_one@sut.test
alias_one@sut.test
:MAIL FROM: sender@another-host.test
RCPT TO: alias_one@sut.test
Maildir
ofuser_one@sut.test
user_one@sut.test
anduser_two@sut.test
:MAIL FROM: sender@another-host.test
RCPT TO: [user_one@sut.test, user_two@sut.test]
Maildir
ofuser_one@sut.test
anduser_two@sut.test
alias_list@sut.test
:MAIL FROM: sender@another-host.test
RCPT TO: alias_list@sut.test
Maildir
ofuser_one@sut.test
anduser_two@sut.test
idontevenexist@sut.test
:MAIL FROM: sender@another-host.test
RCPT TO: idontevenexist@sut.test
someone@another-host.test
MAIL FROM: sender@another-host.test
RCPT TO: someone@another-host.test
alias_invalid@sut.test
MAIL FROM: sender@another-host.test
RCPT TO: alias_invalid@sut.test
STARTTLS
commandutil/test_configs/postfix_sender-login-map
) should be able to send mail to local / internal accounts and external accountsutil/test_configs/postfix_sender-login-map
)util/test_configs/postfix_sender-login-map
might be a list); this has to be cross-checked!Required Infrastructure
user_one@sut.test
is an actual vmail user with a password inDovecot
'suserdb
user_two@sut.test
is an actual vmail user with a password inDovecot
'suserdb
alias_one@sut.test
is a virtual alias touser_one@sut.test
alias_list@sut.test
is a virtual alias touser_one@sut.test
anduser_two@sut.test
alias_invalid@sut.test
is a virtual alias to a non existent mailboxuser_non@sut.test
user_non@sut.test
is not available invirtual_mailboxes
andvmail_users
idontevenexist@sut.test
Make sure this account does not exist inDovecot
'suserdb
,Postfix
'svirtual_mailboxes
database andPostfix
'svirtual_aliases
database