diff --git a/roles/mail_server/molecule/default/tests/test_mandatory.py b/roles/mail_server/molecule/default/tests/test_mandatory.py index 048fba86a4fef7305ca352d4bdff2201983ecdde..6feec89f0aa58111c94f6565cd7e699f3f4f1335 100644 --- a/roles/mail_server/molecule/default/tests/test_mandatory.py +++ b/roles/mail_server/molecule/default/tests/test_mandatory.py @@ -21,28 +21,28 @@ def test_smtp_tls_files(host): assert tls_file.user == 'root' assert tls_file.group == 'root' assert tls_file.mode == 0o640 - assert tls_file.content == open("tests/data/x509/%s_smtp.key" % hostname, "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/%s_smtp.key" % hostname, "r").read().rstrip() tls_file = host.file('/etc/ssl/certs/%s_smtp.pem' % hostname) assert tls_file.is_file assert tls_file.user == 'root' assert tls_file.group == 'root' assert tls_file.mode == 0o644 - assert tls_file.content == open("tests/data/x509/%s_smtp.pem" % hostname, "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/%s_smtp.pem" % hostname, "r").read().rstrip() tls_file = host.file('/etc/ssl/private/%s_imap.key' % hostname) assert tls_file.is_file assert tls_file.user == 'root' assert tls_file.group == 'root' assert tls_file.mode == 0o640 - assert tls_file.content == open("tests/data/x509/%s_imap.key" % hostname, "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/%s_imap.key" % hostname, "r").read().rstrip() tls_file = host.file('/etc/ssl/certs/%s_imap.pem' % hostname) assert tls_file.is_file assert tls_file.user == 'root' assert tls_file.group == 'root' assert tls_file.mode == 0o644 - assert tls_file.content == open("tests/data/x509/%s_imap.pem" % hostname, "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/%s_imap.pem" % hostname, "r").read().rstrip() def test_certificate_validity_check_configuration(host): @@ -58,14 +58,14 @@ def test_certificate_validity_check_configuration(host): assert config.user == 'root' assert config.group == 'root' assert config.mode == 0o644 - assert config.content == "/etc/ssl/certs/%s_smtp.pem" % hostname + assert config.content_string == "/etc/ssl/certs/%s_smtp.pem" % hostname config = host.file('/etc/check_certificate/%s_imap.conf' % hostname) assert config.is_file assert config.user == 'root' assert config.group == 'root' assert config.mode == 0o644 - assert config.content == "/etc/ssl/certs/%s_imap.pem" % hostname + assert config.content_string == "/etc/ssl/certs/%s_imap.pem" % hostname def test_mailname_file_content(host): @@ -76,7 +76,7 @@ def test_mailname_file_content(host): mailname = host.file('/etc/mailname') hostname = host.run('hostname').stdout.strip() - assert mailname.content == hostname + assert mailname.content_string == hostname def test_postfix_main_cf_file_content(host): @@ -87,7 +87,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