Add a flavor to the load balancer CRUD scenarios

This patch adds flavor configuration to the load balancer CRUD
scenario tests. It also updates the multinode jobs to use a
flavor configured for the active/standby topology.

Depends-On: https://review.openstack.org/626819
Change-Id: I46c442df698f7da5bf48c404b06039477382852c
This commit is contained in:
Michael Johnson 2019-01-16 15:59:34 -08:00
parent caf6a8d7dc
commit 02240bdb20
4 changed files with 65 additions and 0 deletions

View File

@ -96,6 +96,7 @@ ERROR = 'ERROR'
SORT = 'sort'
SINGLE = 'SINGLE'
ACTIVE_STANDBY = 'ACTIVE_STANDBY'
SUPPORTED_LB_TOPOLOGIES = (ACTIVE_STANDBY, SINGLE)
# Protocols
HTTP = 'HTTP'

View File

@ -109,6 +109,12 @@ OctaviaGroup = [
cfg.StrOpt('provider',
default='octavia',
help='The provider driver to use for the tests.'),
cfg.StrOpt('loadbalancer_topology',
default=const.SINGLE,
choices=const.SUPPORTED_LB_TOPOLOGIES,
help=('Load balancer flavor topology configuration. '
'SINGLE - One amphora per load balancer. '
'ACTIVE_STANDBY - Two amphora per load balancer.')),
cfg.StrOpt('RBAC_test_type', default=const.ADVANCED,
choices=[const.ADVANCED, const.OWNERADMIN, const.NONE],
help='Type of RBAC tests to run. "advanced" runs the octavia '

View File

@ -17,6 +17,7 @@ from uuid import UUID
from dateutil import parser
from oslo_serialization import jsonutils
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -30,6 +31,49 @@ CONF = config.CONF
class LoadBalancerScenarioTest(test_base.LoadBalancerBaseTest):
@classmethod
def resource_setup(cls):
"""Setup resources needed by the tests."""
super(LoadBalancerScenarioTest, cls).resource_setup()
if cls.lb_admin_flavor_profile_client.is_version_supported(
cls.api_version, '2.6'):
# Create a shared flavor profile
flavor_profile_name = data_utils.rand_name("lb_scenario-setup")
flavor_data = {const.LOADBALANCER_TOPOLOGY:
CONF.load_balancer.loadbalancer_topology}
flavor_data_json = jsonutils.dumps(flavor_data)
flavor_profile_kwargs = {
const.NAME: flavor_profile_name,
const.PROVIDER_NAME: CONF.load_balancer.provider,
const.FLAVOR_DATA: flavor_data_json
}
cls.flavor_profile = (
cls.lb_admin_flavor_profile_client.create_flavor_profile(
**flavor_profile_kwargs))
cls.addClassResourceCleanup(
cls.lb_admin_flavor_profile_client.cleanup_flavor_profile,
cls.flavor_profile[const.ID])
flavor_name = data_utils.rand_name("lb_scenario-setup")
flavor_description = data_utils.arbitrary_string(size=255)
flavor_kwargs = {
const.NAME: flavor_name,
const.DESCRIPTION: flavor_description,
const.ENABLED: True,
const.FLAVOR_PROFILE_ID: cls.flavor_profile[const.ID]}
cls.flavor = cls.lb_admin_flavor_client.create_flavor(
**flavor_kwargs)
cls.addClassResourceCleanup(
cls.lb_admin_flavor_client.cleanup_a_flavor,
cls.flavor[const.ID])
cls.flavor_id = cls.flavor[const.ID]
@decorators.idempotent_id('a5e2e120-4f7e-4c8b-8aac-cf09cb56711c')
def test_load_balancer_ipv4_CRUD(self):
self._test_load_balancer_CRUD(4)
@ -56,6 +100,10 @@ class LoadBalancerScenarioTest(test_base.LoadBalancerBaseTest):
const.PROVIDER: CONF.load_balancer.provider,
const.NAME: lb_name}
if self.lb_admin_flavor_profile_client.is_version_supported(
self.api_version, '2.6'):
lb_kwargs[const.FLAVOR_ID] = self.flavor_id
self._setup_lb_network_kwargs(lb_kwargs, ip_version)
lb = self.mem_lb_client.create_loadbalancer(**lb_kwargs)

View File

@ -325,12 +325,22 @@
tempest_concurrency: 2
tempest_test_regex: ^octavia_tempest_plugin.tests.scenario.v2
tox_envlist: all
devstack_local_conf:
test-config:
"$TEMPEST_CONFIG":
load_balancer:
loadbalancer_topology: ACTIVE_STANDBY
- job:
name: octavia-v2-dsvm-py2-scenario-two-node
parent: octavia-v2-dsvm-scenario-two-node
host-vars:
controller:
devstack_local_conf:
test-config:
"$TEMPEST_CONFIG":
load_balancer:
loadbalancer_topology: ACTIVE_STANDBY
devstack_localrc:
USE_PYTHON3: False
controller2: