Files @ a6f0fe607199
Branch filter:

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

branko
MAR-129: Removed m_ldap_entry module:

- Removed the custom m_ldap_entry module used for managing LDAP
entries.
- Replaced the module usage with official ldap_entry and ldap_attr
modules.
- Updated role reference documentation.
- Updated usage instructions since we can't misuse the m_ldap_entry
any longer for adding members to groups.
import os

import testinfra.utils.ansible_runner


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


def test_connectivity(host):
    """
    Tests connectivity to the web server (ports that should be reachable).
    """

    with host.sudo():

        for server in ["parameters-mandatory-jessie64",
                       "parameters-optional-jessie64"]:
            # HTTP, HTTPS.
            for port in [80, 443]:

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