diff --git a/roles/mail_server/molecule/default/tests/test_default.py b/roles/mail_server/molecule/default/tests/test_default.py index 97169b411ccc2774362fb837d685f32a83e3eaa0..51d1855fdd64283fcdbb7e2883cd8b6a4fdc83ed 100644 --- a/roles/mail_server/molecule/default/tests/test_default.py +++ b/roles/mail_server/molecule/default/tests/test_default.py @@ -705,3 +705,17 @@ def test_smtp_default_port_tls_version_and_ciphers(host): assert tls_versions == expected_tls_versions assert tls_ciphers == expected_tls_ciphers[distribution_release] + + +def test_dovecot_warnings(host): + """ + Tests if Dovecot is reporting any warnings. + """ + + with host.sudo(): + + # Use invocation ID to get service logs since last restart. + invocation_id = host.run("systemctl show -p InvocationID --value dovecot").stdout.strip() + invocation_logs = host.run("journalctl INVOCATION_ID=%s + _SYSTEMD_INVOCATION_ID=%s", invocation_id, invocation_id) + + assert "doveconf: Warning" not in invocation_logs.stdout