Exemplo n.º 1
0
 def test_with_interfaces(self):
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '172.16.77.1')
Exemplo n.º 2
0
 def test_with_interfaces(self):
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '172.16.77.1')
Exemplo n.º 3
0
 def test_extra_ipv4_on_external_port(self):
     self.networks[0]["interface"]["addresses"] = [
         u"fe80::f816:3eff:fe4d:bf12/64",
         u"fdca:3ba5:a17a:acda:f816:3eff:fe4d:bf12/64",
         u"192.168.1.1",
         u"172.16.77.2",
     ]
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(mock_client, fake_router, self.networks)
     self.assertEqual(result, "172.16.77.1")
Exemplo n.º 4
0
 def test_without_ipv4_on_external_port(self):
     # Only set a V6 address
     self.networks[0]['interface']['addresses'] = [
         'fdee:9f85:83be:0:f816:3eff:fee5:1742/48',
     ]
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '')
Exemplo n.º 5
0
 def test_without_ipv4_on_external_port(self):
     # Only set a V6 address
     self.networks[0]['interface']['addresses'] = [
         'fdee:9f85:83be:0:f816:3eff:fee5:1742/48',
     ]
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '')
Exemplo n.º 6
0
 def test_extra_ipv4_on_external_port(self):
     self.networks[0]['interface']['addresses'] = [
         u'fe80::f816:3eff:fe4d:bf12/64',
         u'fdca:3ba5:a17a:acda:f816:3eff:fe4d:bf12/64',
         u'192.168.1.1',
         u'172.16.77.2',
     ]
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '172.16.77.1')
Exemplo n.º 7
0
 def test_extra_ipv4_on_external_port(self):
     self.networks[0]['interface']['addresses'] = [
         u'fe80::f816:3eff:fe4d:bf12/64',
         u'fdca:3ba5:a17a:acda:f816:3eff:fe4d:bf12/64',
         u'192.168.1.1',
         u'172.16.77.2',
     ]
     mock_client = mock.Mock()
     result = conf_mod.get_default_v4_gateway(
         mock_client,
         fake_router,
         self.networks,
     )
     self.assertEqual(result, '172.16.77.1')