Files @ 8a6ebeaabb26
Branch filter:

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

branko
MAR-125: Eliminated a couple of warnings:

- Use the file module when cleaning-up the /etc/duply/main/gnupg directory.
- Mark the bind_password in m_ldap_entry and m_ldap_permissions as no_log
parameters.
import testinfra.utils.ansible_runner


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


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

    with Sudo():

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

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