File diff e3eaa053564d → eb03c3b4f367
roles/ldap_server/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -34,42 +34,6 @@ def test_log_level(host):
 
        assert 'olcLogLevel: 256' in log_level.stdout
 

	
 

	
 
def test_ldap_tls_private_key_file(host):
 
    """
 
    Tests if the TLS private key has been deployed correctly.
 
    """
 

	
 
    with host.sudo():
 

	
 
        inventory_hostname = host.ansible.get_variables()['inventory_hostname']
 

	
 
        key = host.file('/etc/ssl/private/%s_ldap.key' % inventory_hostname)
 

	
 
        assert key.is_file
 
        assert key.user == 'root'
 
        assert key.group == 'openldap'
 
        assert key.mode == 0o640
 
        assert key.content_string == open('tests/data/x509/%s_ldap.key' % inventory_hostname).read()
 

	
 

	
 
def test_ldap_tls_certificate_file(host):
 
    """
 
    Tests if the TLS certificate has been deployed correctly.
 
    """
 

	
 
    with host.sudo():
 

	
 
        inventory_hostname = host.ansible.get_variables()['inventory_hostname']
 

	
 
        cert = host.file('/etc/ssl/certs/%s_ldap.pem' % inventory_hostname)
 

	
 
        assert cert.is_file
 
        assert cert.user == 'root'
 
        assert cert.group == 'root'
 
        assert cert.mode == 0o644
 
        assert cert.content_string == open('tests/data/x509/%s_ldap.pem' % inventory_hostname).read()
 

	
 

	
 
def test_certificate_validity_check_configuration(host):
 
    """
 
    Tests if certificate validity check configuration file has been deployed