Files @ 8a6ebeaabb26
Branch filter:

Location: majic-ansible-roles/roles/ldap_client/tests/test_default.py - annotation

branko
MAR-125: Eliminated a couple of warnings:

- Use the file module when cleaning-up the /etc/duply/main/gnupg directory.
- Mark the bind_password in m_ldap_entry and m_ldap_permissions as no_log
parameters.
import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    '.molecule/ansible_inventory').get_hosts('all')


def test_installed_packages(Package):
    """
    Tests if correct packages are installed.
    """

    assert Package('ldap-utils').is_installed


def test_ldap_configuration_file(File):
    """
    Tests if LDAP configuration files has been deployed with correct
    permissions.
    """

    config = File('/etc/ldap/ldap.conf')

    assert config.is_file
    assert config.user == 'root'
    assert config.group == 'root'
    assert config.mode == 0o644