diff --git a/roles/common/molecule/default/tests/test_maintenance_from_allowed_client.py b/roles/common/molecule/default/tests/test_maintenance_from_allowed_client.py index 21fcfab1017555cf95e0c80b0fee8018ee0c7bfe..5a0a2ee81e8e3f50f81947b8b52ff5287881b598 100644 --- a/roles/common/molecule/default/tests/test_maintenance_from_allowed_client.py +++ b/roles/common/molecule/default/tests/test_maintenance_from_allowed_client.py @@ -16,28 +16,30 @@ parameters_optional_hosts = testinfra.utils.ansible_runner.AnsibleRunner( @pytest.mark.parametrize("target_host", parameters_mandatory_hosts + parameters_optional_hosts) -def test_ssh_connectivity(host, target_host): +@pytest.mark.parametrize("ip_protocol", [4, 6]) +def test_ssh_connectivity(host, target_host, ip_protocol): """ Test if SSH server is reachable. """ with host.sudo(): - scan = host.run('nmap -p 22 -oG - %s', target_host) + scan = host.run('nmap -%s -p 22 -oG - %s', str(ip_protocol), target_host) assert scan.rc == 0 assert "Ports: 22/open/tcp//ssh" in scan.stdout @pytest.mark.parametrize("target_host", parameters_mandatory_hosts + parameters_optional_hosts) -def test_http_connectivity(host, target_host): +@pytest.mark.parametrize("ip_protocol", [4, 6]) +def test_http_connectivity(host, target_host, ip_protocol): """ Test if HTTP server is reachable. """ with host.sudo(): - scan = host.run('nmap -p 80 -oG - %s', target_host) + scan = host.run('nmap -%s -p 80 -oG - %s', str(ip_protocol), target_host) assert scan.rc == 0 assert "Ports: 80/open/tcp//http" in scan.stdout