|
@@ -119,7 +119,7 @@ def test_environment_profile_configuration(host, profile_file, expected_group, e
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == expected_group
|
|
|
assert config.mode == 0o640
|
|
|
assert config.content == expected_content
|
|
|
assert config.content_string == expected_content
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("admin_user, expected_virtualenv_path", [
|
|
@@ -193,7 +193,7 @@ def test_forward_file(host, forward_file, expected_group, expected_content):
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == expected_group
|
|
|
assert config.mode == 0o640
|
|
|
assert config.content == expected_content
|
|
|
assert config.content_string == expected_content
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("original_destination, expected_destination_user", [
|
|
@@ -220,11 +220,11 @@ def test_mail_forwarding(host, original_destination, expected_destination_user):
|
|
|
|
|
|
# First extract message ID of forwarded mail.
|
|
|
pattern = r"%s: to=<%s>.*status=sent \(forwarded as ([^)]*)\)" % (original_queue_id, original_destination)
|
|
|
forward_queue_id = re.search(pattern, mail_log.content).group(1)
|
|
|
forward_queue_id = re.search(pattern, mail_log.content_string).group(1)
|
|
|
|
|
|
# Now try to determine where the forward ended-up at.
|
|
|
pattern = "%s: to=<%s@%s>, orig_to=<%s>.*status=sent" % (forward_queue_id, expected_destination_user, hostname, original_destination)
|
|
|
assert re.search(pattern, mail_log.content) is not None
|
|
|
assert re.search(pattern, mail_log.content_string) is not None
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("virtualenv_dir, expected_owner, expected_group", [
|
|
@@ -372,8 +372,8 @@ def test_systemd_socket_configuration_file(host, config_file, expected_website_n
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == 'root'
|
|
|
assert config.mode == 0o644
|
|
|
assert "Socket for website %s" % expected_website_name in config.content
|
|
|
assert "ListenStream=%s" % expected_socket_file_path in config.content
|
|
|
assert "Socket for website %s" % expected_website_name in config.content_string
|
|
|
assert "ListenStream=%s" % expected_socket_file_path in config.content_string
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("socket_file_path", [
|
|
@@ -413,7 +413,7 @@ def test_systemd_service_configuration_file(host, service_file, expected_fqdn):
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == 'root'
|
|
|
assert config.mode == 0o644
|
|
|
assert expected_fqdn in config.content
|
|
|
assert expected_fqdn in config.content_string
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("service_name", [
|
|
@@ -471,14 +471,14 @@ def test_nginx_tls_files(host, private_key_path, certificate_path, expected_priv
|
|
|
assert tls_file.user == 'root'
|
|
|
assert tls_file.group == 'root'
|
|
|
assert tls_file.mode == 0o640
|
|
|
assert tls_file.content == open(expected_private_key, "r").read().rstrip()
|
|
|
assert tls_file.content_string == open(expected_private_key, "r").read().rstrip()
|
|
|
|
|
|
tls_file = host.file(certificate_path)
|
|
|
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(expected_certificate, "r").read().rstrip()
|
|
|
assert tls_file.content_string == open(expected_certificate, "r").read().rstrip()
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("config_file_path, expected_content", [
|
|
@@ -497,7 +497,7 @@ def test_certificate_validity_check_configuration(host, config_file_path, expect
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == 'root'
|
|
|
assert config.mode == 0o644
|
|
|
assert config.content == expected_content
|
|
|
assert config.content_string == expected_content
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize("config_file", [
|