def _create_backend(): backend = DynamicBackend() backend.id = "22" backend.soa = "MY_SOA" backend.ip_address = "127.0.0.33" backend.ttl = "200" backend.name_servers = collections.OrderedDict( [("ns1.lcl.io", "127.0.0.34"), ("ns2.lcl.io", "127.0.0.35"),] ) backend.domain = "lcl.io" backend.blacklisted_ips = ["127.0.0.2"] return backend
def _create_backend(): backend = DynamicBackend() backend.id = "22" backend.soa = "MY_SOA" backend.ip_address = "127.0.0.33" backend.ttl = "200" backend.name_servers = collections.OrderedDict([ ("ns1.lcl.io", "127.0.0.34"), ("ns2.lcl.io", "127.0.0.35"), ]) backend.domain = "lcl.io" backend.blacklisted_ips = ["127.0.0.2"] return backend
def _create_backend(): backend = DynamicBackend() backend.id = "22" backend.soa = "MY_SOA" backend.ip_address = "127.0.0.33" backend.ttl = "200" backend.name_servers = collections.OrderedDict([ ("ns1.nip.io.test", "127.0.0.34"), ("ns2.nip.io.test", "127.0.0.35"), ]) backend.domain = "nip.io.test" backend.whitelisted_ranges = [ # This allows us to test that the blacklist works even when the IPs are # part of whitelisted ranges ipaddress.IPv4Network('127.0.0.0/8'), # This range covers deadbeef ipaddress.IPv4Network('222.173.190.239/32'), ] backend.blacklisted_ips = ["127.0.0.2"] return backend
def _configure_backend(self, filename="backend_test.conf"): backend = DynamicBackend() backend._get_config_filename = lambda: self._get_test_config_filename( filename) backend.configure() return backend
def _configure_backend(filename="backend_test.conf"): backend = DynamicBackend() backend.configure(_get_test_config_filename(filename)) return backend
def _configure_backend(self, filename="backend_test.conf"): backend = DynamicBackend() backend._get_config_filename = lambda: self._get_test_config_filename(filename) backend.configure() return backend