@@ -300,3 +300,31 @@ def test_nginx_tls_files(host):
assert tls_file.group == 'root'
assert tls_file.mode == 0o644
assert tls_file.content_string == open("tests/data/x509/server/%s_https.cert.pem" % hostname, "r").read().rstrip()
def test_certificate_validity_check_configuration(host):
"""
Tests if certificate validity check configuration file has been deployed
correctly.
hostname = host.run('hostname').stdout.strip()
config = host.file('/etc/check_certificate/%s_https.conf' % hostname)
assert config.is_file
assert config.user == 'root'
assert config.group == 'root'
assert config.mode == 0o644
assert config.content_string == "/etc/ssl/certs/%s_https.pem" % hostname
def test_tls_enabled(host):
Tests if TLS has been enabled.
fqdn = hostname[:hostname.rfind('-')]
tls = host.run('wget -q -O - https://%s/', fqdn)
assert tls.rc == 0