Separate prometheus related tests

We have an issue, that tempest doesn't distinguish between
branches. New features aren't available on old branches and
so we can't execute testing, which involves sg-core or prometheus
on old branches. Separating sg-core and prometheus related tests
allows us to use tempest regex to execute those tests only on
branches, which have the required features.

This also fills in service_available requirements, to make it
clear which tests are runable on prometheus based storage
and which are runable on gnocchi based storage.

Change-Id: Ic5bea08295d8c85303c676706415e093625ee16f
This commit is contained in:
Jaromir Wysoglad 2023-11-22 05:17:28 -05:00
parent 8271356a67
commit 3dd1d0df75
5 changed files with 57 additions and 0 deletions

View File

@ -93,6 +93,13 @@
USE_PYTHON3: True
TEMPEST_PLUGINS: '"/opt/stack/telemetry-tempest-plugin /opt/stack/heat-tempest-plugin"'
GNOCCHI_ARCHIVE_POLICY_TEMPEST: "ceilometer-high-rate"
# NOTE(jwysogla): We can define both of the variables. In versions, where
# the ceilometer devstack plugin doesn't support the CEILOMETER_BACKENDS,
# it'll just ignore it and use the CEILOMETER_BACKEND. In versions, where
# CEILOMETER_BACKENDS is supported, the ceilometer devstack plugin will
# just try to merge the variables, so the final contents in this casse will
# be "gnocchi,sg-core"
CEILOMETER_BACKEND: "gnocchi"
CEILOMETER_BACKENDS: "gnocchi,sg-core"
CEILOMETER_PIPELINE_INTERVAL: 15
CEILOMETER_ALARM_THRESHOLD: 6000000000

View File

@ -31,6 +31,8 @@ class BaseAlarmingTest(tempest.test.BaseTestCase):
super(BaseAlarmingTest, cls).skip_checks()
if not CONF.service_available.aodh:
raise cls.skipException("Aodh support is required")
if not CONF.service_available.gnocchi:
raise cls.skipException("Gnocchi support is required")
@classmethod
def setup_clients(cls):

View File

@ -30,6 +30,10 @@ service_option = [cfg.BoolOpt('ceilometer',
cfg.BoolOpt('gnocchi',
default=True,
help="Whether or not Gnocchi is expected to be"
"available"),
cfg.BoolOpt('sg_core',
default=True,
help="Whether or not sg-core is expected to be"
"available")]
telemetry_group = cfg.OptGroup(name='telemetry',

View File

@ -0,0 +1,44 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
from tempest import config
import tempest.test
from telemetry_tempest_plugin.scenario import utils
CONF = config.CONF
TEST_DIR = os.path.join(os.path.dirname(__file__),
'telemetry_integration_prometheus_gabbits')
class PrometheusGabbiTest(tempest.test.BaseTestCase):
credentials = ['admin']
TIMEOUT_SCALING_FACTOR = 5
@classmethod
def skip_checks(cls):
super(PrometheusGabbiTest, cls).skip_checks()
if not CONF.service_available.sg_core:
raise cls.skipException("sg-core support is required")
def _prep_test(self, filename):
os.environ.update({
"SG_CORE_SERVICE_URL":
str(config.CONF.telemetry.sg_core_service_url),
})
utils.generate_tests(PrometheusGabbiTest, TEST_DIR)