Files
@ ac8884ab98ca
Branch filter:
Location: majic-ansible-roles/roles/web_server/molecule/default/tests/test_client.py - annotation
ac8884ab98ca
647 B
text/x-python
MAR-218: Fix some minor issues for the test runner script:
- No need to use the $ variable syntax for arithmetic operations.
- Use correct form when printing the list of roles (@ -> *).
- Fix missing quote when assembling the list of roles.
- No need to use the $ variable syntax for arithmetic operations.
- Use correct form when printing the list of roles (@ -> *).
- Fix missing quote when assembling the list of roles.
a5f4c1ec6853 a5f4c1ec6853 fc2c40c98e0c fc2c40c98e0c eee778bc2d7c eee778bc2d7c eee778bc2d7c eee778bc2d7c d62b3adec462 eee778bc2d7c eee778bc2d7c fc2c40c98e0c fc2c40c98e0c fc2c40c98e0c fc2c40c98e0c fc2c40c98e0c eee778bc2d7c eee778bc2d7c eee778bc2d7c eee778bc2d7c eee778bc2d7c eee778bc2d7c fc2c40c98e0c fc2c40c98e0c | 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-*')
)
@pytest.mark.parametrize('port', [80, 443])
def test_connectivity(host, server, port):
"""
Tests connectivity to the web server (ports that should be reachable).
"""
with host.sudo():
ping = host.run('hping3 -S -p %s -c 1 %s', str(port), server)
assert ping.rc == 0
|