diff --git a/roles/xmpp_server/molecule/default/tests/test_optional.py b/roles/xmpp_server/molecule/default/tests/test_optional.py index 9b4012eaf7f6ed84f21b506921a09abe7825daec..abfd7c6d423c58d3f7cb4f454cb6992c6d76a401 100644 --- a/roles/xmpp_server/molecule/default/tests/test_optional.py +++ b/roles/xmpp_server/molecule/default/tests/test_optional.py @@ -22,14 +22,14 @@ def test_prosody_tls_files(host): assert tls_file.user == 'root' assert tls_file.group == 'prosody' assert tls_file.mode == 0o640 - assert tls_file.content == open("tests/data/x509/parameters-optional_xmpp.key.pem", "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/parameters-optional_xmpp.key.pem", "r").read().rstrip() tls_file = host.file('/etc/ssl/certs/%s_xmpp.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/parameters-optional_xmpp.cert.pem", "r").read().rstrip() + assert tls_file.content_string == open("tests/data/x509/parameters-optional_xmpp.cert.pem", "r").read().rstrip() def test_certificate_validity_check_configuration(host): @@ -45,7 +45,7 @@ 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_xmpp.pem" % hostname + assert config.content_string == "/etc/ssl/certs/%s_xmpp.pem" % hostname def test_prosody_configuration_file_content(host): @@ -59,26 +59,26 @@ def test_prosody_configuration_file_content(host): config = host.file('/etc/prosody/prosody.cfg.lua') - assert "admins = { \"jane.doe@domain2\", \"mick.doe@domain3\", }" in config.content - assert "key = \"/etc/ssl/private/%s_xmpp.key\";" % hostname in config.content - assert "certificate = \"/etc/ssl/certs/%s_xmpp.pem\";" % hostname in config.content - assert "ldap_server = \"ldap-server\"" in config.content - assert "ldap_rootdn = \"cn=prosody,ou=services,dc=local\"" in config.content - assert "ldap_password = \"prosodypassword\"" in config.content - assert "ldap_filter = \"(&(mail=$user@$host)(memberOf=cn=xmpp,ou=groups,dc=local))\"" in config.content - assert "ldap_base = \"ou=people,dc=local\"" in config.content + assert "admins = { \"jane.doe@domain2\", \"mick.doe@domain3\", }" in config.content_string + assert "key = \"/etc/ssl/private/%s_xmpp.key\";" % hostname in config.content_string + assert "certificate = \"/etc/ssl/certs/%s_xmpp.pem\";" % hostname in config.content_string + assert "ldap_server = \"ldap-server\"" in config.content_string + assert "ldap_rootdn = \"cn=prosody,ou=services,dc=local\"" in config.content_string + assert "ldap_password = \"prosodypassword\"" in config.content_string + assert "ldap_filter = \"(&(mail=$user@$host)(memberOf=cn=xmpp,ou=groups,dc=local))\"" in config.content_string + assert "ldap_base = \"ou=people,dc=local\"" in config.content_string assert """VirtualHost "domain2" Component "conference.domain2" "muc" restrict_room_creation = "local" Component "proxy.domain2" "proxy65" - proxy65_acl = { "domain2" }""" in config.content + proxy65_acl = { "domain2" }""" in config.content_string assert """VirtualHost "domain3" Component "conference.domain3" "muc" restrict_room_creation = "local" Component "proxy.domain3" "proxy65" - proxy65_acl = { "domain3" }""" in config.content + proxy65_acl = { "domain3" }""" in config.content_string def test_correct_prosody_package_installed(host):