Select Git revision
test_dhcp.py
-
nimrod authored
service will stay up (not correct in any way but enough for these tests). - The service doesn't always on TCP ports so can't count on that for waiting for it to come online, use pid file instead. - Corrected tests. - Updated TODO list (logs to syslog anyway).
nimrod authoredservice will stay up (not correct in any way but enough for these tests). - The service doesn't always on TCP ports so can't count on that for waiting for it to come online, use pid file instead. - Corrected tests. - Updated TODO list (logs to syslog anyway).
test_dhcp.py 515 B
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
def test_dhcp_service(Service, Socket, SystemInfo):
if SystemInfo.type == 'openbsd':
service = Service('dhcpd')
elif SystemInfo.type == 'linux':
service = Service('isc-dhcp-server')
assert service.is_running
try:
assert service.is_enabled
except NotImplementedError:
pass
assert Socket('udp://0.0.0.0:67').is_listening