|
@@ -103,7 +103,7 @@ def test_forward_file(host):
|
|
|
assert config.user == 'root'
|
|
|
assert config.group == 'web-parameters-optional_local'
|
|
|
assert config.mode == 0o640
|
|
|
assert config.content == "user\n"
|
|
|
assert config.content_string == "user\n"
|
|
|
|
|
|
|
|
|
def test_mail_forwarding(host):
|
|
@@ -125,11 +125,11 @@ def test_mail_forwarding(host):
|
|
|
|
|
|
# First extract message ID of forwarded mail.
|
|
|
pattern = r"%s: to=<web-parameters-optional_local@localhost>.*status=sent \(forwarded as ([^)]*)\)" % message_id
|
|
|
message_id = re.search(pattern, mail_log.content).group(1)
|
|
|
message_id = re.search(pattern, mail_log.content_string).group(1)
|
|
|
|
|
|
# Now try to determine where the forward ended-up at.
|
|
|
pattern = "%s: to=<user@%s>, orig_to=<web-parameters-optional_local@localhost>.*status=sent" % (message_id, hostname)
|
|
|
assert re.search(pattern, mail_log.content) is not None
|
|
|
assert re.search(pattern, mail_log.content_string) is not None
|
|
|
|
|
|
|
|
|
def test_installed_packages(host):
|
|
@@ -154,14 +154,14 @@ def test_nginx_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/parameters-optional.local_https.key.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional.local_https.key.pem", "r").read().rstrip()
|
|
|
|
|
|
tls_file = host.file('/etc/ssl/certs/parameters-optional.local_https.pem')
|
|
|
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.local_https.cert.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional.local_https.cert.pem", "r").read().rstrip()
|
|
|
|
|
|
|
|
|
def test_certificate_validity_check_configuration(host):
|
|
@@ -175,7 +175,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/parameters-optional.local_https.pem"
|
|
|
assert config.content_string == "/etc/ssl/certs/parameters-optional.local_https.pem"
|
|
|
|
|
|
|
|
|
def test_vhost_file(host):
|