Files @ 3722152897ec
Branch filter:

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

branko
MAR-218: Disable Ansible lints for prefixed role variable names:

- At this point in time, it does not make much sense to introduce
prefixing and breaking every single role invocation.
- Might be worth revisting down the line, although it would require
understanding a bit more clearly if prefixing has any kind of
special logic handling or it's pure guidelines.
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-*')
)
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