Files @ a0e0015117c1
Branch filter:

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

branko
MAR-148: Fix the ldap_client role tests (newline in expected content).
import os

import pytest

import testinfra.utils.ansible_runner


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


@pytest.mark.parametrize('server', testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-mandatory', 'parameters-optional'])
)
def test_connectivity(host, server):

    with host.sudo():

        ping = host.run('hping3 -S -p 389 -c 1 %s', server)
        assert ping.rc == 0

        ping = host.run('hping3 -S -p 636 -c 1 %s', server)
        assert ping.rc == 0