diff --git a/roles/mail_forwarder/molecule/default/tests/test_optional.py b/roles/mail_forwarder/molecule/default/tests/test_optional.py index 84316c572afda63c688bb98eb524eadcb27581e7..d0375369d89ca382de7f772b4fd57381708d061b 100644 --- a/roles/mail_forwarder/molecule/default/tests/test_optional.py +++ b/roles/mail_forwarder/molecule/default/tests/test_optional.py @@ -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/ca.cert.pem", "r").read().rstrip() + assert truststore.content_string == open("tests/data/x509/ca.cert.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 == "%s" % hostname + assert mailname.content_string == "%s" % hostname def test_postfix_main_cf_file_content(host): @@ -38,7 +38,7 @@ 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 @@ -67,8 +67,8 @@ def test_local_aliases(host): pattern1 = "%s: to=, orig_to=.*status=sent" % (message_id, hostname) pattern2 = "%s: to=, orig_to=.*status=sent" % (message_id, hostname) - assert re.search(pattern1, mail_log.content) is not None - assert re.search(pattern2, mail_log.content) is not None + assert re.search(pattern1, mail_log.content_string) is not None + assert re.search(pattern2, mail_log.content_string) is not None def test_relay_mail_sending(host): @@ -89,7 +89,7 @@ def test_relay_mail_sending(host): # port. pattern = r"%s: to=, relay=mail-server\[[^]]*\]:27.*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 def test_tls_enforced_towards_relay_mail_server(host): @@ -125,4 +125,4 @@ def test_tls_enforced_towards_relay_mail_server(host): mail_log = host.file('/var/log/mail.log') pattern = r"%s: to=, relay=domain1.*status=deferred \(Server certificate not verified\)" % message_id - assert re.search(pattern, mail_log.content) is not None + assert re.search(pattern, mail_log.content_string) is not None