Create loadbalancers with qos policy id option.

Change-Id: I278351c136da0dbb640ed7312ccf45d67d80d1dc
This commit is contained in:
pbharathbhu 2020-03-26 12:36:40 +00:00
parent 36a15ed440
commit 3800e954ce
2 changed files with 242 additions and 3 deletions

View File

@ -1563,8 +1563,8 @@ class FeatureManager(traffic_manager.IperfManager,
redirect_url=None, l7rule=False,
compare_type=None,
type=None, value=None, barbican=False,
barbican_container=None, invert=None
):
barbican_container=None, invert=None,
qos_policy_id=None):
count = 0
lb_name = None
if persistence:
@ -1581,7 +1581,8 @@ class FeatureManager(traffic_manager.IperfManager,
create_octavia_load_balancer(name=lb_name,
vip_subnet_id=vip_subnet_id,
vip_network_id=vip_net_id,
vip_port_id=vip_port_id
vip_port_id=vip_port_id,
vip_qos_policy_id=qos_policy_id
)['loadbalancer']
lb_id = self.loadbalancer['id']
self.octavia_admin_client.wait_for_load_balancer_status(lb_id)

View File

@ -656,3 +656,241 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8704-3843a11a2b34')
def test_verify_octavia_lb_port_id_lc_default_pool(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option, lease connection algorithm
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="LEAST_CONNECTIONS",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8704-3843a12b1a34')
def test_verify_octavia_lb_port_id_source_ip_default_pool(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option, source_ip algorithm.
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="SOURCE_IP",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-5677-4b7a-8704-3843a12b1a34')
def test_verify_octavia_https_lb_port_id_source_ip_default_pool(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option, source_ip algorithm, https protocol.
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTPS_PORT)
net_id = diction['network']['id']
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTPS", protocol_port="443",
lb_algorithm="SOURCE_IP",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8544-3843a11b1a34')
def test_verify_octavia_https_lb_port_id_rr_default_pool(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option, https traffic
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTPS_PORT)
net_id = diction['network']['id']
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTPS", protocol_port="443",
lb_algorithm="ROUND_ROBIN",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8544-3843a11b1a34')
def test_verify_octavia_https_lb_port_id_lc_default_pool(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option,least connections https traffic
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTPS", protocol_port="443",
lb_algorithm="LEAST_CONNECTIONS",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True)
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8704-3844b21b1a34')
def test_create_verify_octavia_lb_with_vip_net_id_qos_lc_hm_ping(self):
"""
This testcase creates an octavia Loadbalancer with vip-net-ip
option, and verifies the traffic on the loadbalancer vip
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
policy = self.cmgr_adm.qos_client.create_qos_policy(
name='test-policy', description='test policy desc1',
shared=False)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.qos_client.delete_qos_policy,
policy['policy']['id'])
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="LEAST_CONNECTIONS",
vip_net_id=net_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay,
qos_policy_id=policy['policy']['id'])
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8544-3843a11b1a34')
def test_verify_octavia_https_lb_port_id_lc_default_pool_qos(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option,least connections https traffic
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
policy = self.cmgr_adm.qos_client.create_qos_policy(
name='test-policy', description='test policy desc1',
shared=False)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.qos_client.delete_qos_policy,
policy['policy']['id'])
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="LEAST_CONNECTIONS",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True,
qos_policy_id=policy['policy']['id'])
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8544-3843a11b1a23')
def test_verify_octavia_https_lb_port_id_rr_default_pool_qos(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option,round_robin https traffic
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
policy = self.cmgr_adm.qos_client.create_qos_policy(
name='test-policy', description='test policy desc1',
shared=False)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.qos_client.delete_qos_policy,
policy['policy']['id'])
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="ROUND_ROBIN",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True,
qos_policy_id=policy['policy']['id'])
self.check_project_lbaas()
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('c5ac8546-6867-4b7a-8544-3843a11b1a24')
def test_verify_octavia_https_lb_port_id_source_ip_default_pool_qos(self):
"""
This testcase is for verifying the loadbalancer with port-id and
the pool is created using lb option and attached to a listener
with default-pool option,SOURCE_IP https traffic
"""
diction = self.deploy_octavia_topology()
self.start_web_servers(constants.HTTP_PORT)
net_id = diction['network']['id']
policy = self.cmgr_adm.qos_client.create_qos_policy(
name='test-policy', description='test policy desc1',
shared=False)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.qos_client.delete_qos_policy,
policy['policy']['id'])
port_id = self.cmgr_adm.ports_client.create_port(
network_id=net_id)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
lb_algorithm="SOURCE_IP",
vip_port_id=port_id, hm_type='PING',
timeout=self.hm_timeout,
max_retries=self.hm_max_retries,
delay=self.hm_delay, default_pool=True,
qos_policy_id=policy['policy']['id'])
self.check_project_lbaas()