|
@@ -24,28 +24,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/parameters-optional_smtp.key.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional_smtp.key.pem", "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/parameters-optional_smtp.cert.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional_smtp.cert.pem", "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/parameters-optional_imap.key.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional_imap.key.pem", "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/parameters-optional_imap.cert.pem", "r").read().rstrip()
|
|
|
assert tls_file.content_string == open("tests/data/x509/parameters-optional_imap.cert.pem", "r").read().rstrip()
|
|
|
|
|
|
|
|
|
def test_certificate_validity_check_configuration(host):
|
|
@@ -61,14 +61,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):
|
|
@@ -79,7 +79,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):
|
|
@@ -92,7 +92,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
|
|
@@ -118,7 +118,7 @@ def test_local_aliases(host):
|
|
|
with host.sudo():
|
|
|
mail_log = host.file('/var/log/mail.log')
|
|
|
pattern = r"dovecot: lda\(john.doe@domain1\): msgid=<%s>: saved mail to INBOX" % 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_dovecot_mailbox_directories(host):
|