Changeset - c3ee52b6c9ea
[Not reviewed]
0 2 0
Branko Majic (branko) - 5 months ago 2023-12-07 22:26:41
branko@majic.rs
MAR-189: Refactor test for additional SMTP server configuration:

- Use different override to avoid Postfix warnings about overridden
configuration option in the same file.
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
roles/mail_server/molecule/default/group_vars/parameters-optional.yml
Show inline comments
 
@@ -31,7 +31,7 @@ smtp_allow_relay_from:
 
  - "{{ release_based_smtp_allow_relay_from[ansible_distribution_release] }}"
 
mail_message_size_limit: 20480001
 
mail_server_smtp_additional_configuration: |
 
  smtpd_banner = $myhostname ESMTP My SMTP Server
 
  mail_name = MySMTP
 
  smtp_skip_5xx_greeting = no
 

	
 
# Variables dependant on distribution release.
roles/mail_server/molecule/default/tests/test_optional.py
Show inline comments
 
@@ -218,7 +218,7 @@ def test_smtp_additional_configuration_present_in_file(host):
 

	
 
    config = host.file("/etc/postfix/main.cf")
 

	
 
    assert "smtpd_banner = $myhostname ESMTP My SMTP Server" in config.content_string
 
    assert "mail_name = MySMTP" in config.content_string
 
    assert "smtp_skip_5xx_greeting = no" in config.content_string
 

	
 

	
 
@@ -230,4 +230,4 @@ def test_smtp_additional_configuration_active(host):
 

	
 
    command = host.run('swaks --quit-after BANNER --to root@localhost')
 

	
 
    assert "ESMTP My SMTP Server" in command.stdout
 
    assert "ESMTP MySMTP (Debian/GNU)" in command.stdout
0 comments (0 inline, 0 general)