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 2 months ago
parent
commit
a7bb1619d4

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

@@ -72,8 +72,13 @@ class BaseBgpvpnTest(test.BaseNetworkTest):
72 72
     @classmethod
73 73
     def skip_checks(cls):
74 74
         super(BaseBgpvpnTest, cls).skip_checks()
75
+        msg = None
75 76
         if not utils.is_extension_enabled('bgpvpn', 'network'):
76 77
             msg = "Bgpvpn extension not enabled."
78
+        elif not CONF.bgpvpn.run_bgpvpn_tests:
79
+            msg = ("Running of bgpvpn related tests is disabled in "
80
+                   "plugin configuration.")
81
+        if msg:
77 82
             raise cls.skipException(msg)
78 83
 
79 84
     def create_bgpvpn(self, client, **kwargs):

+ 42
- 0
neutron_tempest_plugin/config.py View File

@@ -116,7 +116,16 @@ NeutronPluginOptions = [
116 116
 for opt in NeutronPluginOptions:
117 117
     CONF.register_opt(opt, 'neutron_plugin_options')
118 118
 
119
+# TODO(slaweq): This config option is added to avoid running bgpvpn tests twice
120
+# on stable branches till stable/stein. We need to remove this config option
121
+# once stable/stein is EOL. Bgpvpn tempest plugin has been merged into
122
+# neutron-tempest-plugin from Train. Train onwards bgpvpn tests will run from
123
+# neutron-tempest-plugins.
119 124
 BgpvpnGroup = [
125
+    cfg.BoolOpt('run_bgpvpn_tests',
126
+                default=True,
127
+                help=("If it is set to False bgpvpn api and scenario tests "
128
+                      "will be skipped")),
120 129
     cfg.IntOpt('min_asn',
121 130
                default=100,
122 131
                help=("Minimum number for the range of "
@@ -140,6 +149,39 @@ bgpvpn_group = cfg.OptGroup(name="bgpvpn", title=("Networking-Bgpvpn Service "
140 149
 CONF.register_group(bgpvpn_group)
141 150
 CONF.register_opts(BgpvpnGroup, group="bgpvpn")
142 151
 
152
+# TODO(slaweq): This config option is added to avoid running fwaas tests twice
153
+# on stable branches till stable/stein. We need to remove this config option
154
+# once stable/stein is EOL. Fwaas tempest plugin has been merged into
155
+# neutron-tempest-plugin from Train. Train onwards fwaas tests will run from
156
+# neutron-tempest-plugins.
157
+FwaasGroup = [
158
+    cfg.BoolOpt('run_fwaas_tests',
159
+                default=True,
160
+                help=("If it is set to False fwaas api and scenario tests "
161
+                      "will be skipped")),
162
+]
163
+
164
+fwaas_group = cfg.OptGroup(
165
+    name="fwaas", title=("Neutron-fwaas Service Options"))
166
+CONF.register_group(fwaas_group)
167
+CONF.register_opts(FwaasGroup, group="fwaas")
168
+
169
+# TODO(slaweq): This config option is added to avoid running SFC tests twice
170
+# on stable branches till stable/stein. We need to remove this config option
171
+# once stable/stein is EOL. SFC tempest plugin has been merged into
172
+# neutron-tempest-plugin from Train. Train onwards SFC tests will run from
173
+# neutron-tempest-plugins.
174
+SfcGroup = [
175
+    cfg.BoolOpt('run_sfc_tests',
176
+                default=True,
177
+                help=("If it is set to False SFC api and scenario tests "
178
+                      "will be skipped")),
179
+]
180
+
181
+sfc_group = cfg.OptGroup(name="sfc", title=("Networking-sfc Service Options"))
182
+CONF.register_group(sfc_group)
183
+CONF.register_opts(SfcGroup, group="sfc")
184
+
143 185
 config_opts_translator = {
144 186
     'project_network_cidr': 'tenant_network_cidr',
145 187
     '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 @@
13 13
 #    under the License.
14 14
 
15 15
 from tempest.api.network import base
16
+from tempest import config
16 17
 
17 18
 from neutron_tempest_plugin.fwaas.common import fwaas_v2_client
18 19
 
20
+CONF = config.CONF
21
+
19 22
 
20 23
 class BaseFWaaSTest(fwaas_v2_client.FWaaSClientMixin, base.BaseNetworkTest):
21
-    pass
24
+
25
+    @classmethod
26
+    def skip_checks(cls):
27
+        super(BaseFWaaSTest, cls).skip_checks()
28
+        msg = None
29
+        if not CONF.fwaas.run_fwaas_tests:
30
+            msg = ("Running of fwaas related tests is disabled in "
31
+                   "plugin configuration.")
32
+        if msg:
33
+            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):
40 40
 
41 41
     credentials = ['primary']
42 42
 
43
+    @classmethod
44
+    def skip_checks(cls):
45
+        super(ScenarioTest, cls).skip_checks()
46
+        msg = None
47
+        if not CONF.fwaas.run_fwaas_tests:
48
+            msg = ("Running of fwaas related tests is disabled in "
49
+                   "plugin configuration.")
50
+        if msg:
51
+            raise cls.skipException(msg)
52
+
43 53
     @classmethod
44 54
     def setup_clients(cls):
45 55
         super(ScenarioTest, cls).setup_clients()

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

@@ -18,17 +18,31 @@ import socket
18 18
 import netaddr
19 19
 from tempest.api.network import base
20 20
 from tempest.common import utils
21
+from tempest import config
21 22
 from tempest.lib.common.utils import data_utils
22 23
 from tempest.lib import exceptions as lib_exc
23 24
 
24 25
 from neutron_tempest_plugin.sfc.tests import flowclassifier_client
25 26
 from neutron_tempest_plugin.sfc.tests import sfc_client
26 27
 
28
+CONF = config.CONF
29
+
27 30
 
28 31
 class BaseFlowClassifierTest(
29 32
     flowclassifier_client.FlowClassifierClientMixin,
30 33
     base.BaseAdminNetworkTest
31 34
 ):
35
+
36
+    @classmethod
37
+    def skip_checks(cls):
38
+        super(BaseFlowClassifierTest, cls).skip_checks()
39
+        msg = None
40
+        if not CONF.sfc.run_sfc_tests:
41
+            msg = ("Running of SFC related tests is disabled in "
42
+                   "plugin configuration.")
43
+        if msg:
44
+            raise cls.skipException(msg)
45
+
32 46
     @classmethod
33 47
     def resource_setup(cls):
34 48
         super(BaseFlowClassifierTest, cls).resource_setup()

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

@@ -30,6 +30,17 @@ class SfcScenarioTest(
30 30
     sfc_client.SfcClientMixin,
31 31
     manager.NetworkScenarioTest
32 32
 ):
33
+
34
+    @classmethod
35
+    def skip_checks(cls):
36
+        super(SfcScenarioTest, cls).skip_checks()
37
+        msg = None
38
+        if not CONF.sfc.run_sfc_tests:
39
+            msg = ("Running of SFC related tests is disabled in "
40
+                   "plugin configuration.")
41
+        if msg:
42
+            raise cls.skipException(msg)
43
+
33 44
     def _check_connectivity(
34 45
         self, source_ip, destination_ip, routes=None,
35 46
         username=None, private_key=None

Loading…
Cancel
Save