Skip to content

Commit

Permalink
Merge "Fix broken vnc_openstack unit tests" into R3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 18, 2016
2 parents 89b5ad0 + 0eae591 commit 8c70843
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/config/api-server/vnc_cfg_ifmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,9 @@ def _locate_subnet_uuid(subnet):
updated = False
for ipam in vn_dict.get('network_ipam_refs', []):
subnets = ipam['attr']['ipam_subnets']
for subnet in [subnet for subnet in subnets
if 'subnet_uuid' not in subnet]:
for subnet in subnets:
if subnet.get('subnet_uuid'):
continue
subnet['subnet_uuid'] = _locate_subnet_uuid(subnet)
updated = True

Expand Down
5 changes: 4 additions & 1 deletion src/config/vnc_openstack/vnc_openstack/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ def test_port_bindings(self):
self._vnc_lib.virtual_network_create(vn_obj)

sg_obj = vnc_api.SecurityGroup('default')
self._vnc_lib.security_group_create(sg_obj)
try:
self._vnc_lib.security_group_create(sg_obj)
except vnc_api.RefsExistError:
pass

proj_uuid = self._vnc_lib.fq_name_to_id('project',
fq_name=['default-domain', 'default-project'])
Expand Down
5 changes: 4 additions & 1 deletion src/config/vnc_openstack/vnc_openstack/tests/test_kvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ def unset_mocks():
# end tearDown

def test_post_project_create_default_sg(self):
proj_obj = Project('proj-%s' %(self.id()))
proj_id = str(uuid.uuid4())
proj_name = self.id()
test_case.get_keystone_client().tenants.add_tenant(proj_id, proj_name)
proj_obj = self._vnc_lib.project_read(id=proj_id)
self._vnc_lib.project_create(proj_obj)
sg_obj = self._vnc_lib.security_group_read(
fq_name=proj_obj.fq_name+['default'])
Expand Down

0 comments on commit 8c70843

Please sign in to comment.