Files @ f176b9957d1b
Branch filter:

Location: majic-ansible-roles/roles/ldap_server/molecule/default/tests/test_deprecated.py

branko
MAR-218: Drop the workaround for running connectivity tests:

- Relevant PR has been long merged into testinfra, and no longer poses
an issue.
import os

import testinfra.utils.ansible_runner


testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*')


def test_server_admin_entry_absent(host):
    """
    Tests if the explicit admin entry is absent from directory tree.
    """

    with host.sudo():
        ldapsearch = host.run('ldapsearch -H ldapi:/// -Q -LLL -Y EXTERNAL -b dc=local cn=admin dn')

        assert ldapsearch.rc == 0
        assert ldapsearch.stdout.strip() == ''