From a1c25b3b64e44087b331a6be0e8d48817cc4045f Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Mon, 25 Feb 2019 14:06:39 +0100 Subject: [PATCH] Fix barbican service_available check Tempest plugins should not explicitly set option from other plugins. The change I7013888f94261d94e1cd4c3167dc84da7125d1da set service_available.barbican to false if the barbican plugin doesn't exist, but cause duplicate error if both are installed. The right way to check if a service is available or not is checking if the attribute exists and set the default to false. This patch fix the duplicate error. Depends-On: https://review.openstack.org/#/c/639153/ Change-Id: I1ba353328e759391cc6a46d95b74c85c4cea6d92 Closes-Bug: 1817154 --- octavia_tempest_plugin/config.py | 13 ------------- .../tests/barbican_scenario/v2/test_tls_barbican.py | 2 +- zuul.d/jobs.yaml | 3 +++ 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py index 91aa2c48..701eb8e6 100644 --- a/octavia_tempest_plugin/config.py +++ b/octavia_tempest_plugin/config.py @@ -31,19 +31,6 @@ ServiceAvailableGroup = [ "to be available."), ] -# Pull in the service_available for barbican if it is not defined. -# If the barbican tempest plugin isn't loaded, this won't load from -# tempest.conf. -try: - if cfg.CONF.service_available.barbican is not None: - LOG.info('Barbican service_available state: {}'.format( - cfg.CONF.service_available.barbican)) -except cfg.NoSuchOptError: - ServiceAvailableGroup.append( - cfg.BoolOpt('barbican', default=False, - help="Whether or not the barbican service is expected to " - "be available.")) - octavia_group = cfg.OptGroup(name='load_balancer', title='load-balancer service options') diff --git a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py index 86dac047..27663b22 100644 --- a/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py +++ b/octavia_tempest_plugin/tests/barbican_scenario/v2/test_tls_barbican.py @@ -50,7 +50,7 @@ class TLSWithBarbicanTest(test_base.LoadBalancerBaseTestWithCompute): if not CONF.validation.run_validation: raise cls.skipException('Traffic tests will not work without ' 'run_validation enabled.') - if not CONF.service_available.barbican: + if not getattr(CONF.service_available, 'barbican', False): raise cls.skipException('TLS with Barbican tests require the ' 'barbican service.') diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index d53fa42e..40e260f8 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -369,12 +369,15 @@ - openstack/barbican - openstack/diskimage-builder - openstack/python-barbicanclient + - openstack/barbican-tempest-plugin vars: tempest_test_regex: ^octavia_tempest_plugin.tests.barbican_scenario.v2 devstack_services: barbican: true devstack_plugins: barbican: https://git.openstack.org/openstack/barbican.git + devstack_localrc: + TEMPEST_PLUGINS: '"/opt/stack/octavia-tempest-plugin /opt/stack/barbican-tempest-plugin"' # Temporary transitional aliases for gates used in other repos # Remove once octavia has transitioned job names