Browse Source

Add possibility to disable running stadium projects tests

This patch adds possibility to disable running of tests related to:
* networking-bgpvpn,
* neutron-fwaas,
* networking-sfc

which were moved to neutron-tempest-plugin repo recently.
This will be useful when tests will be run for one of
stable branches up to Stein, in which those tests are still
in project's repo.

Change-Id: I61dc252920154e7e0998eb2c7c1f026814796cdf
tags/0.4.0^0
Slawek Kaplonski 7 months ago
parent
commit
a7bb1619d4
6 changed files with 95 additions and 1 deletions
  1. +5
    -0
      neutron_tempest_plugin/bgpvpn/base.py
  2. +42
    -0
      neutron_tempest_plugin/config.py
  3. +13
    -1
      neutron_tempest_plugin/fwaas/api/fwaas_v2_base.py
  4. +10
    -0
      neutron_tempest_plugin/fwaas/scenario/fwaas_v2_manager.py
  5. +14
    -0
      neutron_tempest_plugin/sfc/tests/api/base.py
  6. +11
    -0
      neutron_tempest_plugin/sfc/tests/scenario/base.py

+ 5
- 0
neutron_tempest_plugin/bgpvpn/base.py View File

@@ -72,8 +72,13 @@ class BaseBgpvpnTest(test.BaseNetworkTest):
@classmethod
def skip_checks(cls):
super(BaseBgpvpnTest, cls).skip_checks()
msg = None
if not utils.is_extension_enabled('bgpvpn', 'network'):
msg = "Bgpvpn extension not enabled."
elif not CONF.bgpvpn.run_bgpvpn_tests:
msg = ("Running of bgpvpn related tests is disabled in "
"plugin configuration.")
if msg:
raise cls.skipException(msg)

def create_bgpvpn(self, client, **kwargs):

+ 42
- 0
neutron_tempest_plugin/config.py View File

@@ -116,7 +116,16 @@ NeutronPluginOptions = [
for opt in NeutronPluginOptions:
CONF.register_opt(opt, 'neutron_plugin_options')

# TODO(slaweq): This config option is added to avoid running bgpvpn tests twice
# on stable branches till stable/stein. We need to remove this config option
# once stable/stein is EOL. Bgpvpn tempest plugin has been merged into
# neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from
# neutron-tempest-plugins.
BgpvpnGroup = [
cfg.BoolOpt('run_bgpvpn_tests',
default=True,
help=("If it is set to False bgpvpn api and scenario tests "
"will be skipped")),
cfg.IntOpt('min_asn',
default=100,
help=("Minimum number for the range of "
@@ -140,6 +149,39 @@ bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service "
CONF.register_group(bgpvpn_group)
CONF.register_opts(BgpvpnGroup, group="bgpvpn")

# TODO(slaweq): This config option is added to avoid running fwaas tests twice
# on stable branches till stable/stein. We need to remove this config option
# once stable/stein is EOL. Fwaas tempest plugin has been merged into
# neutron-tempest-plugin from Train. Train onwards fwaas tests will run from
# neutron-tempest-plugins.
FwaasGroup = [
cfg.BoolOpt('run_fwaas_tests',
default=True,
help=("If it is set to False fwaas api and scenario tests "
"will be skipped")),
]

fwaas_group = cfg.OptGroup(
name="fwaas", title=("Neutron-fwaas Service Options"))
CONF.register_group(fwaas_group)
CONF.register_opts(FwaasGroup, group="fwaas")

# TODO(slaweq): This config option is added to avoid running SFC tests twice
# on stable branches till stable/stein. We need to remove this config option
# once stable/stein is EOL. SFC tempest plugin has been merged into
# neutron-tempest-plugin from Train. Train onwards SFC tests will run from
# neutron-tempest-plugins.
SfcGroup = [
cfg.BoolOpt('run_sfc_tests',
default=True,
help=("If it is set to False SFC api and scenario tests "
"will be skipped")),
]

sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options"))
CONF.register_group(sfc_group)
CONF.register_opts(SfcGroup, group="sfc")

config_opts_translator = {
'project_network_cidr': 'tenant_network_cidr',
'project_network_v6_cidr': 'tenant_network_v6_cidr',

+ 13
- 1
neutron_tempest_plugin/fwaas/api/fwaas_v2_base.py View File

@@ -13,9 +13,21 @@
# under the License.

from tempest.api.network import base
from tempest import config

from neutron_tempest_plugin.fwaas.common import fwaas_v2_client

CONF = config.CONF


class BaseFWaaSTest(fwaas_v2_client.FWaaSClientMixin, base.BaseNetworkTest):
pass

@classmethod
def skip_checks(cls):
super(BaseFWaaSTest, cls).skip_checks()
msg = None
if not CONF.fwaas.run_fwaas_tests:
msg = ("Running of fwaas related tests is disabled in "
"plugin configuration.")
if msg:
raise cls.skipException(msg)

+ 10
- 0
neutron_tempest_plugin/fwaas/scenario/fwaas_v2_manager.py View File

@@ -40,6 +40,16 @@ class ScenarioTest(tempest.test.BaseTestCase):

credentials = ['primary']

@classmethod
def skip_checks(cls):
super(ScenarioTest, cls).skip_checks()
msg = None
if not CONF.fwaas.run_fwaas_tests:
msg = ("Running of fwaas related tests is disabled in "
"plugin configuration.")
if msg:
raise cls.skipException(msg)

@classmethod
def setup_clients(cls):
super(ScenarioTest, cls).setup_clients()

+ 14
- 0
neutron_tempest_plugin/sfc/tests/api/base.py View File

@@ -18,17 +18,31 @@ import socket
import netaddr
from tempest.api.network import base
from tempest.common import utils
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc

from neutron_tempest_plugin.sfc.tests import flowclassifier_client
from neutron_tempest_plugin.sfc.tests import sfc_client

CONF = config.CONF


class BaseFlowClassifierTest(
flowclassifier_client.FlowClassifierClientMixin,
base.BaseAdminNetworkTest
):

@classmethod
def skip_checks(cls):
super(BaseFlowClassifierTest, cls).skip_checks()
msg = None
if not CONF.sfc.run_sfc_tests:
msg = ("Running of SFC related tests is disabled in "
"plugin configuration.")
if msg:
raise cls.skipException(msg)

@classmethod
def resource_setup(cls):
super(BaseFlowClassifierTest, cls).resource_setup()

+ 11
- 0
neutron_tempest_plugin/sfc/tests/scenario/base.py View File

@@ -30,6 +30,17 @@ class SfcScenarioTest(
sfc_client.SfcClientMixin,
manager.NetworkScenarioTest
):

@classmethod
def skip_checks(cls):
super(SfcScenarioTest, cls).skip_checks()
msg = None
if not CONF.sfc.run_sfc_tests:
msg = ("Running of SFC related tests is disabled in "
"plugin configuration.")
if msg:
raise cls.skipException(msg)

def _check_connectivity(
self, source_ip, destination_ip, routes=None,
username=None, private_key=None

Loading…
Cancel
Save