Beispiel #1
0
 def test_find_nova_addresses_ext_tag(self):
     addrs = {'public': [{'OS-EXT-IPS:type': 'fixed',
                          'addr': '198.51.100.2',
                          'version': 4}]}
     self.assertEqual(
         ['198.51.100.2'], meta.find_nova_addresses(addrs, ext_tag='fixed'))
     self.assertEqual([], meta.find_nova_addresses(addrs, ext_tag='foo'))
Beispiel #2
0
 def test_find_nova_addresses_key_name(self):
     # Note 198.51.100.0/24 is TEST-NET-2 from rfc5737
     addrs = {'public': [{'addr': '198.51.100.1', 'version': 4}],
              'private': [{'addr': '192.0.2.5', 'version': 4}]}
     self.assertEqual(
         ['198.51.100.1'],
         meta.find_nova_addresses(addrs, key_name='public'))
     self.assertEqual([], meta.find_nova_addresses(addrs, key_name='foo'))
Beispiel #3
0
 def test_find_nova_addresses_all(self):
     addrs = {'public': [{'OS-EXT-IPS:type': 'fixed',
                          'addr': '198.51.100.2',
                          'version': 4}]}
     self.assertEqual(
         ['198.51.100.2'], meta.find_nova_addresses(
             addrs, key_name='public', ext_tag='fixed', version=4))
     self.assertEqual([], meta.find_nova_addresses(
         addrs, key_name='public', ext_tag='fixed', version=6))
Beispiel #4
0
 def test_find_nova_addresses_floating_first(self):
     # Note 198.51.100.0/24 is TEST-NET-2 from rfc5737
     addrs = {
         'private': [{
             'addr': '192.0.2.5',
             'version': 4,
             'OS-EXT-IPS:type': 'fixed'
         }],
         'public': [{
             'addr': '198.51.100.1',
             'version': 4,
             'OS-EXT-IPS:type': 'floating'
         }]
     }
     self.assertEqual(['198.51.100.1', '192.0.2.5'],
                      meta.find_nova_addresses(addrs))
Beispiel #5
0
 def test_find_nova_addresses_all(self):
     addrs = {"public": [{"OS-EXT-IPS:type": "fixed", "addr": "198.51.100.2", "version": 4}]}
     self.assertEqual(
         ["198.51.100.2"], meta.find_nova_addresses(addrs, key_name="public", ext_tag="fixed", version=4)
     )
     self.assertEqual([], meta.find_nova_addresses(addrs, key_name="public", ext_tag="fixed", version=6))
Beispiel #6
0
 def test_find_nova_addresses_ext_tag(self):
     addrs = {"public": [{"OS-EXT-IPS:type": "fixed", "addr": "198.51.100.2", "version": 4}]}
     self.assertEqual(["198.51.100.2"], meta.find_nova_addresses(addrs, ext_tag="fixed"))
     self.assertEqual([], meta.find_nova_addresses(addrs, ext_tag="foo"))
Beispiel #7
0
 def test_find_nova_addresses_key_name(self):
     # Note 198.51.100.0/24 is TEST-NET-2 from rfc5737
     addrs = {"public": [{"addr": "198.51.100.1", "version": 4}], "private": [{"addr": "192.0.2.5", "version": 4}]}
     self.assertEqual(["198.51.100.1"], meta.find_nova_addresses(addrs, key_name="public"))
     self.assertEqual([], meta.find_nova_addresses(addrs, key_name="foo"))