test: use real UUID in all UUID fields
Many of the fields in VIF related objects required a UUID, but tests are passing in random garbage. The UUIDField is going to start rejecting these bogus UUIDs so they need fixing Closes-Bug: #1550629 Change-Id: I8ccc68a6f6e709951ae1ba6c1388d6c025775332
This commit is contained in:
parent
ae034f5802
commit
76994a02d4
@ -109,8 +109,9 @@ class TestOSVIF(base.TestCase):
|
|||||||
return_value=plg):
|
return_value=plg):
|
||||||
os_vif.initialize()
|
os_vif.initialize()
|
||||||
info = objects.instance_info.InstanceInfo()
|
info = objects.instance_info.InstanceInfo()
|
||||||
vif = objects.vif.VIFBridge(id='uniq',
|
vif = objects.vif.VIFBridge(
|
||||||
plugin='foobar')
|
id='9a12694f-f95e-49fa-9edb-70239aee5a2c',
|
||||||
|
plugin='foobar')
|
||||||
os_vif.plug(vif, info)
|
os_vif.plug(vif, info)
|
||||||
mock_plug.assert_called_once_with(vif, info)
|
mock_plug.assert_called_once_with(vif, info)
|
||||||
|
|
||||||
@ -126,7 +127,8 @@ class TestOSVIF(base.TestCase):
|
|||||||
return_value=plg):
|
return_value=plg):
|
||||||
os_vif.initialize()
|
os_vif.initialize()
|
||||||
info = objects.instance_info.InstanceInfo()
|
info = objects.instance_info.InstanceInfo()
|
||||||
vif = objects.vif.VIFBridge(id='uniq',
|
vif = objects.vif.VIFBridge(
|
||||||
plugin='foobar')
|
id='9a12694f-f95e-49fa-9edb-70239aee5a2c',
|
||||||
|
plugin='foobar')
|
||||||
os_vif.unplug(vif, info)
|
os_vif.unplug(vif, info)
|
||||||
mock_unplug.assert_called_once_with(vif, info)
|
mock_unplug.assert_called_once_with(vif, info)
|
||||||
|
@ -43,11 +43,11 @@ class PluginTest(testtools.TestCase):
|
|||||||
|
|
||||||
def test_plug_bridge(self):
|
def test_plug_bridge(self):
|
||||||
network = objects.network.Network(
|
network = objects.network.Network(
|
||||||
id='network-id-xxx-yyy-zzz',
|
id='437c6db5-4e6f-4b43-b64b-ed6a11ee5ba7',
|
||||||
bridge='br0')
|
bridge='br0')
|
||||||
|
|
||||||
vif = objects.vif.VIFBridge(
|
vif = objects.vif.VIFBridge(
|
||||||
id='vif-xxx-yyy-zzz',
|
id='b679325f-ca89-4ee0-a8be-6db1409b69ea',
|
||||||
address='ca:fe:de:ad:be:ef',
|
address='ca:fe:de:ad:be:ef',
|
||||||
network=network,
|
network=network,
|
||||||
dev_name='tap-xxx-yyy-zzz',
|
dev_name='tap-xxx-yyy-zzz',
|
||||||
@ -65,13 +65,13 @@ class PluginTest(testtools.TestCase):
|
|||||||
|
|
||||||
def test_plug_bridge_create_br(self):
|
def test_plug_bridge_create_br(self):
|
||||||
network = objects.network.Network(
|
network = objects.network.Network(
|
||||||
id='network-id-xxx-yyy-zzz',
|
id='437c6db5-4e6f-4b43-b64b-ed6a11ee5ba7',
|
||||||
bridge='br0',
|
bridge='br0',
|
||||||
bridge_interface='eth0',
|
bridge_interface='eth0',
|
||||||
should_provide_bridge=True)
|
should_provide_bridge=True)
|
||||||
|
|
||||||
vif = objects.vif.VIFBridge(
|
vif = objects.vif.VIFBridge(
|
||||||
id='vif-xxx-yyy-zzz',
|
id='b679325f-ca89-4ee0-a8be-6db1409b69ea',
|
||||||
address='ca:fe:de:ad:be:ef',
|
address='ca:fe:de:ad:be:ef',
|
||||||
network=network,
|
network=network,
|
||||||
dev_name='tap-xxx-yyy-zzz',
|
dev_name='tap-xxx-yyy-zzz',
|
||||||
@ -89,7 +89,7 @@ class PluginTest(testtools.TestCase):
|
|||||||
|
|
||||||
def test_plug_bridge_create_br_vlan(self):
|
def test_plug_bridge_create_br_vlan(self):
|
||||||
network = objects.network.Network(
|
network = objects.network.Network(
|
||||||
id='network-id-xxx-yyy-zzz',
|
id='437c6db5-4e6f-4b43-b64b-ed6a11ee5ba7',
|
||||||
bridge='br0',
|
bridge='br0',
|
||||||
bridge_interface='eth0',
|
bridge_interface='eth0',
|
||||||
vlan=99,
|
vlan=99,
|
||||||
@ -97,7 +97,7 @@ class PluginTest(testtools.TestCase):
|
|||||||
should_provide_vlan=True)
|
should_provide_vlan=True)
|
||||||
|
|
||||||
vif = objects.vif.VIFBridge(
|
vif = objects.vif.VIFBridge(
|
||||||
id='vif-xxx-yyy-zzz',
|
id='b679325f-ca89-4ee0-a8be-6db1409b69ea',
|
||||||
address='ca:fe:de:ad:be:ef',
|
address='ca:fe:de:ad:be:ef',
|
||||||
network=network,
|
network=network,
|
||||||
dev_name='tap-xxx-yyy-zzz',
|
dev_name='tap-xxx-yyy-zzz',
|
||||||
|
@ -55,15 +55,15 @@ class PluginTest(testtools.TestCase):
|
|||||||
self.subnet_bridge_6])
|
self.subnet_bridge_6])
|
||||||
|
|
||||||
self.network_ovs = objects.network.Network(
|
self.network_ovs = objects.network.Network(
|
||||||
id='network-id-xxx-yyy-zzz',
|
id='437c6db5-4e6f-4b43-b64b-ed6a11ee5ba7',
|
||||||
bridge='br0',
|
bridge='br0',
|
||||||
subnets=self.subnets,
|
subnets=self.subnets,
|
||||||
vlan=99)
|
vlan=99)
|
||||||
|
|
||||||
self.profile_ovs = objects.vif.VIFPortProfileOpenVSwitch(
|
self.profile_ovs = objects.vif.VIFPortProfileOpenVSwitch(
|
||||||
interface_id='aaa-bbb-ccc')
|
interface_id='e65867e0-9340-4a7f-a256-09af6eb7a3aa')
|
||||||
self.vif_ovs = objects.vif.VIFBridge(
|
self.vif_ovs = objects.vif.VIFBridge(
|
||||||
id='vif-xxx-yyy-zzz',
|
id='b679325f-ca89-4ee0-a8be-6db1409b69ea',
|
||||||
address='ca:fe:de:ad:be:ef',
|
address='ca:fe:de:ad:be:ef',
|
||||||
network=self.network_ovs,
|
network=self.network_ovs,
|
||||||
dev_name='tap-xxx-yyy-zzz',
|
dev_name='tap-xxx-yyy-zzz',
|
||||||
@ -77,9 +77,9 @@ class PluginTest(testtools.TestCase):
|
|||||||
def _test_plug_ovs_hybrid(self, ipv6_exists):
|
def _test_plug_ovs_hybrid(self, ipv6_exists):
|
||||||
calls = {
|
calls = {
|
||||||
'device_exists': [mock.call('qbrvif-xxx-yyy'),
|
'device_exists': [mock.call('qbrvif-xxx-yyy'),
|
||||||
mock.call('qvovif-xxx-yyy')],
|
mock.call('qvob679325f-ca')],
|
||||||
'_create_veth_pair': [mock.call('qvbvif-xxx-yyy',
|
'_create_veth_pair': [mock.call('qvbb679325f-ca',
|
||||||
'qvovif-xxx-yyy',
|
'qvob679325f-ca',
|
||||||
1500)],
|
1500)],
|
||||||
'execute': [mock.call('brctl', 'addbr', 'qbrvif-xxx-yyy',
|
'execute': [mock.call('brctl', 'addbr', 'qbrvif-xxx-yyy',
|
||||||
run_as_root=True),
|
run_as_root=True),
|
||||||
@ -92,7 +92,8 @@ class PluginTest(testtools.TestCase):
|
|||||||
process_input='0', run_as_root=True,
|
process_input='0', run_as_root=True,
|
||||||
check_exit_code=[0, 1])],
|
check_exit_code=[0, 1])],
|
||||||
'create_ovs_vif_port': [mock.call(
|
'create_ovs_vif_port': [mock.call(
|
||||||
'br0', 'qvovif-xxx-yyy', 'aaa-bbb-ccc',
|
'br0', 'qvob679325f-ca',
|
||||||
|
'e65867e0-9340-4a7f-a256-09af6eb7a3aa',
|
||||||
'ca:fe:de:ad:be:ef',
|
'ca:fe:de:ad:be:ef',
|
||||||
'f0000000-0000-0000-0000-000000000001',
|
'f0000000-0000-0000-0000-000000000001',
|
||||||
1500,
|
1500,
|
||||||
@ -109,7 +110,7 @@ class PluginTest(testtools.TestCase):
|
|||||||
mock.call('ip', 'link', 'set', 'qbrvif-xxx-yyy', 'up',
|
mock.call('ip', 'link', 'set', 'qbrvif-xxx-yyy', 'up',
|
||||||
run_as_root=True),
|
run_as_root=True),
|
||||||
mock.call('brctl', 'addif', 'qbrvif-xxx-yyy',
|
mock.call('brctl', 'addif', 'qbrvif-xxx-yyy',
|
||||||
'qvbvif-xxx-yyy', run_as_root=True)])
|
'qvbb679325f-ca', run_as_root=True)])
|
||||||
|
|
||||||
with nested(
|
with nested(
|
||||||
mock.patch.object(linux_net, 'device_exists',
|
mock.patch.object(linux_net, 'device_exists',
|
||||||
@ -137,12 +138,12 @@ class PluginTest(testtools.TestCase):
|
|||||||
calls = {
|
calls = {
|
||||||
'device_exists': [mock.call('qbrvif-xxx-yyy')],
|
'device_exists': [mock.call('qbrvif-xxx-yyy')],
|
||||||
'execute': [mock.call('brctl', 'delif', 'qbrvif-xxx-yyy',
|
'execute': [mock.call('brctl', 'delif', 'qbrvif-xxx-yyy',
|
||||||
'qvbvif-xxx-yyy', run_as_root=True),
|
'qvbb679325f-ca', run_as_root=True),
|
||||||
mock.call('ip', 'link', 'set',
|
mock.call('ip', 'link', 'set',
|
||||||
'qbrvif-xxx-yyy', 'down', run_as_root=True),
|
'qbrvif-xxx-yyy', 'down', run_as_root=True),
|
||||||
mock.call('brctl', 'delbr',
|
mock.call('brctl', 'delbr',
|
||||||
'qbrvif-xxx-yyy', run_as_root=True)],
|
'qbrvif-xxx-yyy', run_as_root=True)],
|
||||||
'delete_ovs_vif_port': [mock.call('br0', 'qvovif-xxx-yyy',
|
'delete_ovs_vif_port': [mock.call('br0', 'qvob679325f-ca',
|
||||||
timeout=120)]
|
timeout=120)]
|
||||||
}
|
}
|
||||||
with nested(
|
with nested(
|
||||||
@ -160,7 +161,7 @@ class PluginTest(testtools.TestCase):
|
|||||||
def test_unplug_ovs_hybrid_bridge_does_not_exist(self):
|
def test_unplug_ovs_hybrid_bridge_does_not_exist(self):
|
||||||
calls = {
|
calls = {
|
||||||
'device_exists': [mock.call('qbrvif-xxx-yyy')],
|
'device_exists': [mock.call('qbrvif-xxx-yyy')],
|
||||||
'delete_ovs_vif_port': [mock.call('br0', 'qvovif-xxx-yyy',
|
'delete_ovs_vif_port': [mock.call('br0', 'qvob679325f-ca',
|
||||||
timeout=120)]
|
timeout=120)]
|
||||||
}
|
}
|
||||||
with nested(
|
with nested(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user