Skip to content
Snippets Groups Projects
Select Git revision
  • 36ccf81f88a39fb8049f7638856e628b3ab87501
  • master default
2 results

test_dhcp.py

Blame
  • 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