Configure dashboard.dashboard_url if tempest_slow 43/72543/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 18 May 2021 17:21:53 +0000 (19:21 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 19 May 2021 07:49:06 +0000 (09:49 +0200)
Tempest Horizon is now also executed in tempest_slow.

Change-Id: I910adc68eeb067d089b705feb794911afd1747e0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/healthcheck/testcases.yaml
functest/ci/testcases.yaml
functest/opnfv_tests/openstack/tempest/tempest.py
setup.cfg

index 53e5a6c..7b6b2a1 100644 (file)
@@ -177,6 +177,6 @@ tiers:
                 dependencies:
                     - DASHBOARD_URL: '^(?!\s*$).+'
                 run:
-                    name: tempest_horizon
+                    name: tempest_common
                     args:
                         mode: '^tempest.scenario.test_dashboard_basic_ops.'
index 818fb18..3c71807 100644 (file)
@@ -177,7 +177,7 @@ tiers:
                 dependencies:
                     - DASHBOARD_URL: '^(?!\s*$).+'
                 run:
-                    name: tempest_horizon
+                    name: tempest_common
                     args:
                         mode: '^tempest.scenario.test_dashboard_basic_ops.'
 
index 2645e6f..60c117d 100644 (file)
@@ -582,6 +582,19 @@ class TempestCommon(singlevm.VmReady2):
         with open(self.conf_file, 'w') as config_file:
             rconfig.write(config_file)
 
+    def update_dashboard_section(self):
+        """Update dashboard section in tempest.conf"""
+        rconfig = configparser.RawConfigParser()
+        rconfig.read(self.conf_file)
+        if env.get('DASHBOARD_URL'):
+            if not rconfig.has_section('dashboard'):
+                rconfig.add_section('dashboard')
+            rconfig.set('dashboard', 'dashboard_url', env.get('DASHBOARD_URL'))
+        else:
+            rconfig.set('service_available', 'horizon', False)
+        with open(self.conf_file, 'w') as config_file:
+            rconfig.write(config_file)
+
     def configure(self, **kwargs):  # pylint: disable=unused-argument
         """
         Create all openstack resources for tempest-based testcases and write
@@ -624,6 +637,7 @@ class TempestCommon(singlevm.VmReady2):
         self.update_compute_section()
         self.update_validation_section()
         self.update_scenario_section()
+        self.update_dashboard_section()
         self.backup_tempest_config(self.conf_file, self.res_dir)
 
     def run(self, **kwargs):
@@ -682,21 +696,6 @@ class TempestCommon(singlevm.VmReady2):
         return super(TempestCommon, self).is_successful()
 
 
-class TempestHorizon(TempestCommon):
-    """Tempest Horizon testcase implementation class."""
-
-    def configure(self, **kwargs):
-        super(TempestHorizon, self).configure(**kwargs)
-        rconfig = configparser.RawConfigParser()
-        rconfig.read(self.conf_file)
-        if not rconfig.has_section('dashboard'):
-            rconfig.add_section('dashboard')
-        rconfig.set('dashboard', 'dashboard_url', env.get('DASHBOARD_URL'))
-        with open(self.conf_file, 'w') as config_file:
-            rconfig.write(config_file)
-        self.backup_tempest_config(self.conf_file, self.res_dir)
-
-
 class TempestHeat(TempestCommon):
     """Tempest Heat testcase implementation class."""
 
index d6bdfd1..3b46698 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -26,7 +26,6 @@ xtesting.testcase =
     cinder_test = functest.opnfv_tests.openstack.cinder.cinder_test:CinderCheck
     odl = functest.opnfv_tests.sdn.odl.odl:ODLTests
     tempest_common = functest.opnfv_tests.openstack.tempest.tempest:TempestCommon
-    tempest_horizon = functest.opnfv_tests.openstack.tempest.tempest:TempestHorizon
     tempest_heat = functest.opnfv_tests.openstack.tempest.tempest:TempestHeat
     rally_sanity = functest.opnfv_tests.openstack.rally.rally:RallySanity
     refstack = functest.opnfv_tests.openstack.refstack.refstack:Refstack