blob: 1ac2a20979175a2a5f32fa2f2833633698f02001 [file] [log] [blame]
Ryota MIBU54e35cf2015-12-11 00:40:19 +09001#
2# Copyright 2015 NEC Corporation.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16import os
17
Chandan Kumar696751e2017-12-04 16:04:15 +053018from tempest import config
Ryota MIBU54e35cf2015-12-11 00:40:19 +090019from tempest.test_discover import plugins
20
Chandan Kumarb30a1922017-12-09 20:24:46 +053021from telemetry_tempest_plugin import config as tempest_config
gordon chung849b3912016-02-01 17:27:55 -050022
Ryota MIBU54e35cf2015-12-11 00:40:19 +090023
Chandan Kumarb30a1922017-12-09 20:24:46 +053024class TelemetryTempestPlugin(plugins.TempestPlugin):
Ryota MIBU54e35cf2015-12-11 00:40:19 +090025
26 def load_tests(self):
27 base_path = os.path.split(os.path.dirname(
Chandan Kumarb30a1922017-12-09 20:24:46 +053028 os.path.abspath(__file__)))[0]
29 test_dir = "telemetry_tempest_plugin"
Ryota MIBU54e35cf2015-12-11 00:40:19 +090030 full_test_dir = os.path.join(base_path, test_dir)
31 return full_test_dir, base_path
32
33 def register_opts(self, conf):
Chandan Kumar696751e2017-12-04 16:04:15 +053034 config.register_opt_group(
35 conf, config.service_available_group,
36 tempest_config.service_option)
37 config.register_opt_group(
38 conf, tempest_config.telemetry_group,
Takashi Kajinami7da415b2024-10-05 12:39:31 +090039 tempest_config.telemetry_opts)
Chandan Kumar696751e2017-12-04 16:04:15 +053040 config.register_opt_group(
Erno Kuvajab0e09122023-11-30 13:09:46 +000041 conf, tempest_config.telemetry_services_group,
42 tempest_config.telemetry_services_opts)
43 config.register_opt_group(
Chandan Kumar6f97ca02017-12-07 12:50:34 +053044 conf, tempest_config.alarming_group,
Takashi Kajinami7da415b2024-10-05 12:39:31 +090045 tempest_config.alarming_opts)
Chandan Kumard9a10fe2018-01-11 14:34:45 +053046 config.register_opt_group(
47 conf, tempest_config.metric_group,
48 tempest_config.metric_opts)
Ryota MIBU54e35cf2015-12-11 00:40:19 +090049
50 def get_opt_lists(self):
Chandan Kumar696751e2017-12-04 16:04:15 +053051 return [(tempest_config.telemetry_group.name,
Takashi Kajinami7da415b2024-10-05 12:39:31 +090052 tempest_config.telemetry_opts),
Erno Kuvajab0e09122023-11-30 13:09:46 +000053 (tempest_config.telemetry_services_group.name,
54 tempest_config.telemetry_services_opts),
Chandan Kumar696751e2017-12-04 16:04:15 +053055 (config.service_available_group.name,
Chandan Kumar6f97ca02017-12-07 12:50:34 +053056 tempest_config.service_option),
57 (tempest_config.alarming_group.name,
Takashi Kajinami7da415b2024-10-05 12:39:31 +090058 tempest_config.alarming_opts),
Chandan Kumard9a10fe2018-01-11 14:34:45 +053059 (tempest_config.metric_group.name,
60 tempest_config.metric_opts)]