Change-Id: Iea9d4611fa44617ffec379b914c56326481d451b
This commit is contained in:
dkumbhar 2020-10-15 07:31:25 +00:00
parent 4ad5280275
commit f52975b4ee
4 changed files with 31 additions and 25 deletions

View File

@ -1605,9 +1605,10 @@ class FeatureManager(traffic_manager.IperfManager,
admin_state_up=True)['loadbalancer'] admin_state_up=True)['loadbalancer']
lb_id = self.loadbalancer['id'] lb_id = self.loadbalancer['id']
self.octavia_admin_client.wait_for_load_balancer_status(lb_id) self.octavia_admin_client.wait_for_load_balancer_status(lb_id)
self.addCleanup(test_utils.call_and_ignore_notfound_exc, if clean_up is None:
self.octavia_admin_client. self.addCleanup(test_utils.call_and_ignore_notfound_exc,
delete_octavia_load_balancer, lb_id) self.octavia_admin_client.
delete_octavia_load_balancer, lb_id)
if barbican: if barbican:
tls_id = barbican_container["container_ref"] tls_id = barbican_container["container_ref"]
else: else:
@ -1620,10 +1621,11 @@ class FeatureManager(traffic_manager.IperfManager,
allowed_cidrs=allowed_cidrs, allowed_cidrs=allowed_cidrs,
default_tls_container_ref=tls_id default_tls_container_ref=tls_id
)['listener'] )['listener']
self.addCleanup(test_utils.call_and_ignore_notfound_exc, if clean_up is None:
self.octavia_admin_listener_client. self.addCleanup(test_utils.call_and_ignore_notfound_exc,
delete_octavia_listener, self.octavia_admin_listener_client.
self.listener['id']) delete_octavia_listener,
self.listener['id'])
self.octavia_admin_client.wait_for_load_balancer_status(lb_id) self.octavia_admin_client.wait_for_load_balancer_status(lb_id)
if l7policy and action != 'REDIRECT_TO_POOL': if l7policy and action != 'REDIRECT_TO_POOL':
l7p = self.octavia_admin_l7policies_client.\ l7p = self.octavia_admin_l7policies_client.\
@ -1660,20 +1662,22 @@ class FeatureManager(traffic_manager.IperfManager,
session_persistence=session_persistence) session_persistence=session_persistence)
self.octavia_admin_client.wait_for_load_balancer_status(lb_id) self.octavia_admin_client.wait_for_load_balancer_status(lb_id)
pool_id = self.pool['pool']['id'] pool_id = self.pool['pool']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc, if clean_up is None:
self.octavia_admin_pools_client. self.addCleanup(test_utils.call_and_ignore_notfound_exc,
delete_octavia_pool, self.octavia_admin_pools_client.
pool_id) delete_octavia_pool,
pool_id)
if hm_type: if hm_type:
self.healthmonitor = self.octavia_hm_client.\ self.healthmonitor = self.octavia_hm_client.\
create_octavia_hm(pool_id=pool_id, type=hm_type, delay=delay, create_octavia_hm(pool_id=pool_id, type=hm_type, delay=delay,
timeout=timeout, max_retries=max_retries, timeout=timeout, max_retries=max_retries,
name=lb_name) name=lb_name)
self.octavia_admin_client.wait_for_load_balancer_status(lb_id) self.octavia_admin_client.wait_for_load_balancer_status(lb_id)
self.addCleanup(test_utils.call_and_ignore_notfound_exc, if clean_up is None:
self.octavia_hm_client. self.addCleanup(test_utils.call_and_ignore_notfound_exc,
delete_octavia_hm, self.octavia_hm_client.
self.healthmonitor['healthmonitor']['id']) delete_octavia_hm,
self.healthmonitor['healthmonitor']['id'])
self.members = [] self.members = []
for server_name in self.topology_servers.keys(): for server_name in self.topology_servers.keys():
if count < member_count: if count < member_count:

View File

@ -656,10 +656,13 @@ class OctaviaLB_Client(base.BaseNetworkClient):
uri = self.resource_object_path % load_balancer_id uri = self.resource_object_path % load_balancer_id
return self.show_resource(uri, **fields) return self.show_resource(uri, **fields)
def delete_octavia_load_balancer(self, load_balancer_id, cascade=False): def delete_octavia_load_balancer(self, load_balancer_id):
uri = self.resource_object_path % load_balancer_id uri = self.resource_object_path % load_balancer_id
if cascade: return self.delete_resource(uri)
uri = uri + '?cascade=True'
def delete_octavia_load_balancer_with_cascade(self, load_balancer_id):
uri = self.resource_object_path % load_balancer_id
uri = uri + '?cascade=True'
return self.delete_resource(uri) return self.delete_resource(uri)
def show_octavia_lb_status_tree(self, load_balancer_id, **fields): def show_octavia_lb_status_tree(self, load_balancer_id, **fields):

View File

@ -836,8 +836,8 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
timeout=10, max_retries=5, timeout=10, max_retries=5,
name=lb_name) name=lb_name)
self.octavia_admin_client.wait_for_load_balancer_status(lb_id) self.octavia_admin_client.wait_for_load_balancer_status(lb_id)
self.octavia_admin_client.delete_octavia_load_balancer(lb_id, self.octavia_admin_client.\
cascade=True) delete_octavia_load_balancer_with_cascade(lb_id)
self.octavia_admin_client.\ self.octavia_admin_client.\
wait_for_load_balancer_status(lb_id, is_delete_op=True) wait_for_load_balancer_status(lb_id, is_delete_op=True)
lbs = self.octavia_admin_client.\ lbs = self.octavia_admin_client.\

View File

@ -45,7 +45,6 @@ class TestNewCase(feature_manager.FeatureManager):
super(TestNewCase, cls).setup_clients() super(TestNewCase, cls).setup_clients()
cls.cmgr_adm = cls.get_client_manager('admin') cls.cmgr_adm = cls.get_client_manager('admin')
cls.cmgr_alt = cls.get_client_manager('alt') cls.cmgr_alt = cls.get_client_manager('alt')
cls.cmgr_adm = cls.get_client_manager('admin')
cls.routers_client = cls.cmgr_adm.routers_client cls.routers_client = cls.cmgr_adm.routers_client
cls.networks_client = cls.cmgr_adm.networks_client cls.networks_client = cls.cmgr_adm.networks_client
cls.subnets_client = cls.cmgr_adm.subnets_client cls.subnets_client = cls.cmgr_adm.subnets_client
@ -279,7 +278,7 @@ class TestNewCase(feature_manager.FeatureManager):
""" """
self.create_topo_single_network( self.create_topo_single_network(
"route-port", create_instance=False) "route-port", create_instance=False)
p_client = self.ports_client p_client = self.cmgr_adm.ports_client
port = self.get_router_port(p_client) port = self.get_router_port(p_client)
kwargs = {'port_security_enabled': True} kwargs = {'port_security_enabled': True}
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
@ -433,7 +432,7 @@ class TestNewCase(feature_manager.FeatureManager):
# Create single network attached to router topo # Create single network attached to router topo
self.create_topo_single_network( self.create_topo_single_network(
"admin_state", create_instance=False) "admin_state", create_instance=False)
ports = self.ports_client.list_ports() ports = self.cmgr_adm.ports_client.list_ports()
for port in ports['ports']: for port in ports['ports']:
if 'device_owner' in port: if 'device_owner' in port:
if port['device_owner'] == "network:dhcp": if port['device_owner'] == "network:dhcp":
@ -452,7 +451,7 @@ class TestNewCase(feature_manager.FeatureManager):
topology_dict = self.create_topo_single_network( topology_dict = self.create_topo_single_network(
"dhcp_port", create_instance=False) "dhcp_port", create_instance=False)
network_state = topology_dict['network_state'] network_state = topology_dict['network_state']
ports = self.ports_client.list_ports() ports = self.cmgr_adm.ports_client.list_ports()
for port in ports['ports']: for port in ports['ports']:
if 'device_owner' in port: if 'device_owner' in port:
if port['device_owner'] == "network:dhcp" \ if port['device_owner'] == "network:dhcp" \
@ -598,7 +597,7 @@ class TestNewCase(feature_manager.FeatureManager):
1) 1)
fix_ip = [ fix_ip = [
{'subnet_id': subnet_state.get('id'), {'subnet_id': subnet_state.get('id'),
'ip_address': network_cidr[0] + '.2'}] 'ip_address': network_cidr[0] + '.222'}]
args = {'fixed_ips': fix_ip, 'network_id': network_state['id']} args = {'fixed_ips': fix_ip, 'network_id': network_state['id']}
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.cmgr_adm.ports_client.create_port, self.cmgr_adm.ports_client.create_port,