Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/config/vnc_openstack/vnc_openstack/tests/test_vmi_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,15 @@ def test_update(self):
subnet_uuid=subnet_uuid)
self._port_count_check(1)

vm_uuid = str(uuid.uuid4())
# update certain params and check
entries = [{'input': {
'port_q': {
'name': 'test-port-updated',
'admin_state_up': False,
'security_groups': [],
'device_owner': 'vm',
'device_id': 'test-instance-1',
'device_id': vm_uuid,
'fixed_ips': [{'subnet_id': subnet_uuid,
'ip_address': '192.168.1.10'}],
'allowed_address_pairs': [{'ip_address': "10.0.0.0/24"},
Expand All @@ -211,8 +212,8 @@ def test_update(self):
'output': {'name': 'test-port-updated',
'admin_state_up': False,
'id': port_id_1,
#'device_id': 'test-instance-1',
'device_owner': 'vm',
'device_id': vm_uuid,
'device_owner': '',
'security_groups': [self._generated()],
'extra_dhcp_opts': [{'opt_value': '8.8.8.8',
'opt_name': '4'}],
Expand All @@ -227,11 +228,13 @@ def test_update(self):
parent_obj=self.proj_obj,
security_group_entries=sg_rules)
self._test_vnc_lib.security_group_create(sg_obj)
vm_uuid_2 = str(uuid.uuid4())
entries[0]['input']['port_q']['security_groups'] = [sg_obj.uuid]
entries[0]['input']['port_q']['device_id'] = 'test-instance-2'
entries[0]['input']['port_q']['device_id'] = vm_uuid_2
entries[0]['input']['port_q'][
'fixed_ips'][0]['ip_address'] = '192.168.1.11'
entries[0]['output']['security_groups'] = [sg_obj.uuid]
entries[0]['output']['device_id'] = vm_uuid_2
entries[0]['output']['fixed_ips'] = [{'ip_address': '192.168.1.11'}]

self._test_check_update(entries)
Expand Down
1 change: 0 additions & 1 deletion src/config/vnc_openstack/vnc_openstack/tests/vnc_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def update_back_ref(self, ref_name, refs,
'to': back_ref_obj.get_fq_name()}
back_ref_name = ("%s_back_refs"
% back_ref_name.replace("-", "_"))
print " -- Updating back refs %s for %s resource" % (back_ref_name, _ref_name)
if hasattr(ref_obj, back_ref_name) and getattr(ref_obj, back_ref_name):
getattr(ref_obj, back_ref_name).append(back_ref)
else:
Expand Down