Remove direct calls to os_client for SGs

This commit removes the direct call to self.os_admin.security_groups_client
and uses the methods on the base test class.

Change-Id: I666a3046047d385818c57ea6aaa8182c1c669b1e
This commit is contained in:
Daniel Mellado 2018-09-05 09:37:51 +02:00
parent 227cd9cd04
commit 6ffd99ba93
1 changed files with 6 additions and 6 deletions

View File

@ -111,8 +111,8 @@ class TestNamespaceScenario(base.BaseKuryrScenarioTest):
self.assertIn(net_crd_ns1_name, net_crd_ns1['metadata']['name'])
self.assertIn(net_crd_ns2_name, net_crd_ns2['metadata']['name'])
seen_sgs = self.os_admin.security_groups_client.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs['security_groups']]
seen_sgs = self.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs]
self.assertIn(net_crd_ns1['spec']['sgId'], seen_sg_ids)
self.assertIn(net_crd_ns2['spec']['sgId'], seen_sg_ids)
@ -179,8 +179,8 @@ class TestNamespaceScenario(base.BaseKuryrScenarioTest):
self.assertIn(net_crd_ns1_name, net_crd_ns1['metadata']['name'])
self.assertIn(net_crd_ns2_name, net_crd_ns2['metadata']['name'])
seen_sgs = self.os_admin.security_groups_client.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs['security_groups']]
seen_sgs = self.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs]
self.assertIn(net_crd_ns1['spec']['sgId'], seen_sg_ids)
self.assertIn(net_crd_ns2['spec']['sgId'], seen_sg_ids)
@ -254,7 +254,7 @@ class TestNamespaceScenario(base.BaseKuryrScenarioTest):
seen_subnet_names = [n['name'] for n in seen_subnets['subnets']]
self.assertNotIn(subnet, seen_subnet_names)
seen_sgs = self.os_admin.security_groups_client.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs['security_groups']]
seen_sgs = self.list_security_groups()
seen_sg_ids = [sg['id'] for sg in seen_sgs]
if net_crd['spec'].get('sgId', None):
self.assertNotIn(net_crd['spec']['sgId'], seen_sg_ids)