Browse Source

Add configuration support for skipping tests

This patch add configuration support in Octavia Tempest Plugin,
in case a provider driver does not support Health Monitors.

Change-Id: I25eb52e9f64a08560c9ea2f664edd9826be6e379
Reedip 7 months ago
parent
commit
f88cffc9b4

+ 9
- 0
octavia_tempest_plugin/config.py View File

@@ -144,3 +144,12 @@ OctaviaGroup = [
144 144
                default=None,
145 145
                help='Availability zone to use for creating servers.'),
146 146
 ]
147
+
148
+lb_feature_enabled_group = cfg.OptGroup(name='loadbalancer-feature-enabled',
149
+                                        title='Enabled/Disabled LB features')
150
+LBFeatureEnabledGroup = [
151
+    cfg.BoolOpt('health_monitor_enabled',
152
+                default=True,
153
+                help="Whether Health Monitor is available with provider"
154
+                     " driver or not."),
155
+]

+ 5
- 0
octavia_tempest_plugin/plugin.py View File

@@ -35,6 +35,9 @@ class OctaviaTempestPlugin(plugins.TempestPlugin):
35 35
                                   project_config.ServiceAvailableGroup)
36 36
         config.register_opt_group(conf, project_config.octavia_group,
37 37
                                   project_config.OctaviaGroup)
38
+        config.register_opt_group(conf,
39
+                                  project_config.lb_feature_enabled_group,
40
+                                  project_config.LBFeatureEnabledGroup)
38 41
 
39 42
     def get_opt_lists(self):
40 43
         return [
@@ -42,6 +45,8 @@ class OctaviaTempestPlugin(plugins.TempestPlugin):
42 45
              project_config.ServiceAvailableGroup),
43 46
             (project_config.octavia_group.name,
44 47
              project_config.OctaviaGroup),
48
+            (project_config.lb_feature_enabled_group.name,
49
+             project_config.LBFeatureEnabledGroup)
45 50
         ]
46 51
 
47 52
     def get_service_clients(self):

+ 6
- 0
octavia_tempest_plugin/tests/api/v2/test_healthmonitor.py View File

@@ -33,6 +33,12 @@ LOG = logging.getLogger(__name__)
33 33
 class HealthMonitorAPITest(test_base.LoadBalancerBaseTest):
34 34
     """Test the healthmonitor object API."""
35 35
 
36
+    @classmethod
37
+    def skip_checks(cls):
38
+        super(HealthMonitorAPITest, cls).skip_checks()
39
+        if not CONF.loadbalancer_feature_enabled.health_monitor_enabled:
40
+            cls.skip('Health Monitors not supported')
41
+
36 42
     @classmethod
37 43
     def resource_setup(cls):
38 44
         """Setup resources needed by the tests."""

+ 6
- 0
octavia_tempest_plugin/tests/scenario/v2/test_healthmonitor.py View File

@@ -28,6 +28,12 @@ CONF = config.CONF
28 28
 
29 29
 class HealthMonitorScenarioTest(test_base.LoadBalancerBaseTest):
30 30
 
31
+    @classmethod
32
+    def skip_checks(cls):
33
+        super(HealthMonitorScenarioTest, cls).skip_checks()
34
+        if not CONF.loadbalancer_feature_enabled.health_monitor_enabled:
35
+            cls.skip('Health Monitors not supported')
36
+
31 37
     @classmethod
32 38
     def resource_setup(cls):
33 39
         """Setup resources needed by the tests."""

Loading…
Cancel
Save