Exemple #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)
 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)
 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)
 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)
Exemple #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)
 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)
Exemple #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)
 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)