| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 1 | # | 
|  | 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 |  | 
|  | 16 | import os | 
|  | 17 |  | 
| Chandan Kumar | 696751e | 2017-12-04 16:04:15 +0530 | [diff] [blame] | 18 | from tempest import config | 
| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 19 | from tempest.test_discover import plugins | 
|  | 20 |  | 
| Chandan Kumar | b30a192 | 2017-12-09 20:24:46 +0530 | [diff] [blame] | 21 | from telemetry_tempest_plugin import config as tempest_config | 
| gordon chung | 849b391 | 2016-02-01 17:27:55 -0500 | [diff] [blame] | 22 |  | 
| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 23 |  | 
| Chandan Kumar | b30a192 | 2017-12-09 20:24:46 +0530 | [diff] [blame] | 24 | class TelemetryTempestPlugin(plugins.TempestPlugin): | 
| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 25 |  | 
|  | 26 | def load_tests(self): | 
|  | 27 | base_path = os.path.split(os.path.dirname( | 
| Chandan Kumar | b30a192 | 2017-12-09 20:24:46 +0530 | [diff] [blame] | 28 | os.path.abspath(__file__)))[0] | 
|  | 29 | test_dir = "telemetry_tempest_plugin" | 
| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 30 | 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 Kumar | 696751e | 2017-12-04 16:04:15 +0530 | [diff] [blame] | 34 | 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 Kajinami | 7da415b | 2024-10-05 12:39:31 +0900 | [diff] [blame] | 39 | tempest_config.telemetry_opts) | 
| Chandan Kumar | 696751e | 2017-12-04 16:04:15 +0530 | [diff] [blame] | 40 | config.register_opt_group( | 
| Erno Kuvaja | b0e0912 | 2023-11-30 13:09:46 +0000 | [diff] [blame] | 41 | conf, tempest_config.telemetry_services_group, | 
|  | 42 | tempest_config.telemetry_services_opts) | 
|  | 43 | config.register_opt_group( | 
| Chandan Kumar | 6f97ca0 | 2017-12-07 12:50:34 +0530 | [diff] [blame] | 44 | conf, tempest_config.alarming_group, | 
| Takashi Kajinami | 7da415b | 2024-10-05 12:39:31 +0900 | [diff] [blame] | 45 | tempest_config.alarming_opts) | 
| Chandan Kumar | d9a10fe | 2018-01-11 14:34:45 +0530 | [diff] [blame] | 46 | config.register_opt_group( | 
|  | 47 | conf, tempest_config.metric_group, | 
|  | 48 | tempest_config.metric_opts) | 
| Ryota MIBU | 54e35cf | 2015-12-11 00:40:19 +0900 | [diff] [blame] | 49 |  | 
|  | 50 | def get_opt_lists(self): | 
| Chandan Kumar | 696751e | 2017-12-04 16:04:15 +0530 | [diff] [blame] | 51 | return [(tempest_config.telemetry_group.name, | 
| Takashi Kajinami | 7da415b | 2024-10-05 12:39:31 +0900 | [diff] [blame] | 52 | tempest_config.telemetry_opts), | 
| Erno Kuvaja | b0e0912 | 2023-11-30 13:09:46 +0000 | [diff] [blame] | 53 | (tempest_config.telemetry_services_group.name, | 
|  | 54 | tempest_config.telemetry_services_opts), | 
| Chandan Kumar | 696751e | 2017-12-04 16:04:15 +0530 | [diff] [blame] | 55 | (config.service_available_group.name, | 
| Chandan Kumar | 6f97ca0 | 2017-12-07 12:50:34 +0530 | [diff] [blame] | 56 | tempest_config.service_option), | 
|  | 57 | (tempest_config.alarming_group.name, | 
| Takashi Kajinami | 7da415b | 2024-10-05 12:39:31 +0900 | [diff] [blame] | 58 | tempest_config.alarming_opts), | 
| Chandan Kumar | d9a10fe | 2018-01-11 14:34:45 +0530 | [diff] [blame] | 59 | (tempest_config.metric_group.name, | 
|  | 60 | tempest_config.metric_opts)] |