File diff 6bb8ed6d6443 → d752715bb533
roles/mail_forwarder/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -16,7 +16,7 @@ def test_smtp_relay_truststore_file(host):
 

	
 
    truststore = host.file('/etc/ssl/certs/smtp_relay_truststore.pem')
 

	
 
    assert truststore.content == open("tests/data/x509/truststore.pem", "r").read().rstrip()
 
    assert truststore.content_string == open("tests/data/x509/truststore.pem", "r").read().rstrip()
 

	
 

	
 
def test_smtp_mailname(host):
 
@@ -28,7 +28,7 @@ def test_smtp_mailname(host):
 

	
 
    mailname = host.file('/etc/mailname')
 

	
 
    assert mailname.content == hostname
 
    assert mailname.content_string == hostname
 

	
 

	
 
def test_postfix_main_cf_file_content(host):
 
@@ -38,14 +38,14 @@ def test_postfix_main_cf_file_content(host):
 

	
 
    hostname = host.run('hostname').stdout.strip()
 
    config = host.file('/etc/postfix/main.cf')
 
    config_lines = config.content.split("\n")
 
    config_lines = config.content_string.split("\n")
 

	
 
    assert "myhostname = %s" % hostname in config_lines
 
    assert "mydestination = %s, %s, localhost.localdomain, localhost" % (hostname, hostname) in config_lines
 
    assert "relayhost = " in config_lines
 
    assert "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128" in config_lines
 
    assert "smtp_tls_security_level" not in config.content
 
    assert "smtp_tls_CAfile" not in config.content
 
    assert "smtp_tls_security_level" not in config.content_string
 
    assert "smtp_tls_CAfile" not in config.content_string
 
    assert "smtp_host_lookup = dns, native" in config_lines
 

	
 

	
 
@@ -67,4 +67,4 @@ def test_direct_mail_sending(host):
 
        # Pattern used to verify the mail was sent directly on default port.
 
        pattern = r"%s: to=<root@domain1>, relay=domain1\[[^]]*\]:25.*status=sent" % message_id
 

	
 
        assert re.search(pattern, mail_log.content) is not None
 
        assert re.search(pattern, mail_log.content_string) is not None