Ejemplo n.º 1
0
 def test_subnet_config(self):
     expected = {
         'cidr': '192.168.1.0/24',
         'dhcp_enabled': True,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': '192.168.1.1',
         'host_routes': {}
     }
     self.assertEqual(conf_mod._subnet_config(fake_subnet), expected)
Ejemplo n.º 2
0
 def test_subnet_config(self):
     expected = {
         'cidr': '192.168.1.0/24',
         'dhcp_enabled': True,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': '192.168.1.1',
         'host_routes': {}
     }
     self.assertEqual(conf_mod._subnet_config(fake_subnet), expected)
Ejemplo n.º 3
0
 def test_subnet_config(self):
     expected = {
         "cidr": "192.168.1.0/24",
         "dhcp_enabled": True,
         "dns_nameservers": ["8.8.8.8"],
         "gateway_ip": "192.168.1.1",
         "host_routes": {},
     }
     self.assertEqual(conf_mod._subnet_config(fake_subnet), expected)
Ejemplo n.º 4
0
 def test_subnet_config_with_slaac_enabled(self):
     expected = {
         'cidr': 'fdee:9f85:83be::/48',
         'dhcp_enabled': False,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': 'fdee:9f85:83be::1',
         'host_routes': {}
     }
     self.assertEqual(
         conf_mod._subnet_config(fake_subnet_with_slaac), expected)
Ejemplo n.º 5
0
 def test_subnet_config_with_slaac_enabled(self):
     expected = {
         'cidr': 'fdee:9f85:83be::/48',
         'dhcp_enabled': False,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': 'fdee:9f85:83be::1',
         'host_routes': {}
     }
     self.assertEqual(conf_mod._subnet_config(fake_subnet_with_slaac),
                      expected)
Ejemplo n.º 6
0
 def test_subnet_config_gateway_none(self):
     expected = {
         'cidr': '192.168.1.0/24',
         'dhcp_enabled': True,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': '',
         'host_routes': {}
     }
     sn = FakeModel(
         's1',
         cidr=netaddr.IPNetwork('192.168.1.0/24'),
         gateway_ip=None,
         enable_dhcp=True,
         dns_nameservers=['8.8.8.8'],
         host_routes={})
     self.assertEqual(conf_mod._subnet_config(sn), expected)
Ejemplo n.º 7
0
 def test_subnet_config_gateway_none(self):
     expected = {
         'cidr': '192.168.1.0/24',
         'dhcp_enabled': True,
         'dns_nameservers': ['8.8.8.8'],
         'gateway_ip': '',
         'host_routes': {}
     }
     sn = FakeModel('s1',
                    cidr=netaddr.IPNetwork('192.168.1.0/24'),
                    gateway_ip=None,
                    enable_dhcp=True,
                    dns_nameservers=['8.8.8.8'],
                    ipv6_ra_mode='',
                    host_routes={})
     self.assertEqual(conf_mod._subnet_config(sn), expected)
Ejemplo n.º 8
0
 def test_subnet_config_gateway_none(self):
     expected = {
         "cidr": "192.168.1.0/24",
         "dhcp_enabled": True,
         "dns_nameservers": ["8.8.8.8"],
         "gateway_ip": "",
         "host_routes": {},
     }
     sn = FakeModel(
         "s1",
         cidr=netaddr.IPNetwork("192.168.1.0/24"),
         gateway_ip=None,
         enable_dhcp=True,
         dns_nameservers=["8.8.8.8"],
         host_routes={},
     )
     self.assertEqual(conf_mod._subnet_config(sn), expected)