Fix broken unit tests
Commit I0a1c128858c1d639e80763cac0df358949c56cfb broke ipv6 unit tests, becasue it prevents setting a new port as compute Change-Id: Id5d27a0971bd2f8be072261ee23933043f77518f
This commit is contained in:
parent
89bf73715b
commit
2d95529bb6
@ -1270,7 +1270,9 @@ class TestPortsV2(NsxVPluginV2TestCase,
|
|||||||
data['port']['fixed_ips'])
|
data['port']['fixed_ips'])
|
||||||
|
|
||||||
def _update_port_index(self, port_id, device_id, index):
|
def _update_port_index(self, port_id, device_id, index):
|
||||||
data = {'port': {'device_id': device_id, 'vnic_index': index}}
|
data = {'port': {'device_owner': 'compute:None',
|
||||||
|
'device_id': device_id,
|
||||||
|
'vnic_index': index}}
|
||||||
req = self.new_update_request('ports',
|
req = self.new_update_request('ports',
|
||||||
data, port_id)
|
data, port_id)
|
||||||
res = self.deserialize('json', req.get_response(self.api))
|
res = self.deserialize('json', req.get_response(self.api))
|
||||||
@ -1291,9 +1293,11 @@ class TestPortsV2(NsxVPluginV2TestCase,
|
|||||||
with self.port(subnet=subnet,
|
with self.port(subnet=subnet,
|
||||||
device_id=device_id,
|
device_id=device_id,
|
||||||
mac_address=port_mac,
|
mac_address=port_mac,
|
||||||
fixed_ips=fixed_ip_data,
|
fixed_ips=fixed_ip_data) as port:
|
||||||
device_owner='compute:None') as port:
|
# set port as compute first
|
||||||
self.assertIsNone(port['port']['vnic_index'])
|
res = self._update_port_index(
|
||||||
|
port['port']['id'], device_id, None)
|
||||||
|
self.assertIsNone(res['port']['vnic_index'])
|
||||||
|
|
||||||
self.fc2.approve_assigned_addresses = (
|
self.fc2.approve_assigned_addresses = (
|
||||||
mock.Mock().approve_assigned_addresses)
|
mock.Mock().approve_assigned_addresses)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user