Files @ 701044d4cbba
Branch filter:

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

branko
MAR-31: Added scaffolding for testing xmpp_server role:

- Fixed wrong default for xmpp_domains parameter (should be a list).
- Added Molecule configuration file with LDAP server, client, and two XMPP
server instances.
- Added test playbook that sets-up all servers.
- Fixed mode syntax issues (use lead zero).
- Added data required for testing.
- Added dummy file with tests.
import testinfra.utils.ansible_runner

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


def test_connectivity(Command, Sudo):

    with Sudo():

        ping = Command('hping3 -S -p 389 -c 1 10.31.127.10')
        assert ping.rc == 0

        ping = Command('hping3 -S -p 636 -c 1 10.31.127.10')
        assert ping.rc == 0

        ping = Command('hping3 -S -p 389 -c 1 10.31.127.11')
        assert ping.rc == 0

        ping = Command('hping3 -S -p 636 -c 1 10.31.127.11')
        assert ping.rc == 0