blob: 51c40f9f024b8fbab83ed7d69f12a0beb95178a8 [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,
39 tempest_config.TelemetryGroup)
40 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 Kumar696751e2017-12-04 16:04:15 +053044 conf, tempest_config.event_group,
45 tempest_config.event_opts)
Chandan Kumar6f97ca02017-12-07 12:50:34 +053046 config.register_opt_group(
47 conf, tempest_config.alarming_group,
48 tempest_config.AlarmingGroup)
Chandan Kumard9a10fe2018-01-11 14:34:45 +053049 config.register_opt_group(
50 conf, tempest_config.metric_group,
51 tempest_config.metric_opts)
Ryota MIBU54e35cf2015-12-11 00:40:19 +090052
53 def get_opt_lists(self):
Chandan Kumar696751e2017-12-04 16:04:15 +053054 return [(tempest_config.telemetry_group.name,
55 tempest_config.TelemetryGroup),
Erno Kuvajab0e09122023-11-30 13:09:46 +000056 (tempest_config.telemetry_services_group.name,
57 tempest_config.telemetry_services_opts),
Chandan Kumar696751e2017-12-04 16:04:15 +053058 (tempest_config.event_group.name,
59 tempest_config.event_opts),
60 (config.service_available_group.name,
Chandan Kumar6f97ca02017-12-07 12:50:34 +053061 tempest_config.service_option),
62 (tempest_config.alarming_group.name,
Chandan Kumard9a10fe2018-01-11 14:34:45 +053063 tempest_config.AlarmingGroup),
64 (tempest_config.metric_group.name,
65 tempest_config.metric_opts)]