Files @ 3a03065f2240
Branch filter:

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

branko
MAR-189: Refactored admin acocunt handling in the ldap_server role:

- Get rid of the admin entry from the directory, and resort to using
the directory's olcRootDN/olcRootPW attributes instead. Aligns
Buster package deployment with Bullseye one, as implemented via fix
for the following Debian bug:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821331

- Add the helper filter plugin to deal with calculating the salted
SHA1 checksum.
- Drop the architecture from Molecule instance names.
- Move the IPs around a tiny bit for Molecule instances.
import os

import testinfra.utils.ansible_runner

from helpers import parse_ldif


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() == ''