From ce14ccaaccc5921b28f8be16472a6b8d7a3e8c3d Mon Sep 17 00:00:00 2001 From: ricolin Date: Wed, 7 Feb 2018 17:15:38 +0800 Subject: [PATCH] Add function descriptions for tempest plugin Change-Id: Id6791a3df84d474c95b6b043c90180d09d4d824f --- heat_tempest_plugin/plugin.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/heat_tempest_plugin/plugin.py b/heat_tempest_plugin/plugin.py index 6926691..0eeb519 100644 --- a/heat_tempest_plugin/plugin.py +++ b/heat_tempest_plugin/plugin.py @@ -22,7 +22,23 @@ from heat_tempest_plugin import config as heat_config class HeatTempestPlugin(plugins.TempestPlugin): + """A HeatTempestPlugin class + + Provides the basic hooks for an external plugin to provide tempest the + necessary information to run the plugin. + """ + def load_tests(self): + """Provide Load tests information + + Method to return the information necessary to load the tests in the + plugin. + + :return: a tuple with the first value being the test_dir and the second + being the top_level + :return type: tuple + """ + base_path = os.path.split(os.path.dirname( os.path.abspath(__file__)))[0] test_dir = "heat_tempest_plugin" @@ -30,6 +46,15 @@ class HeatTempestPlugin(plugins.TempestPlugin): return full_test_dir, base_path def register_opts(self, conf): + """Add additional configuration options to tempest. + + This method will be run for the plugin during the register_opts() + function in tempest.config + + Parameters: + conf (ConfigOpts): The conf object that can be used to register + additional options on. + """ config.register_opt_group(conf, heat_config.service_available_group, heat_config.ServiceAvailableGroup) config.register_opt_group(conf, heat_config.heat_group, @@ -38,6 +63,13 @@ class HeatTempestPlugin(plugins.TempestPlugin): heat_config.HeatFeaturesGroup) def get_opt_lists(self): + """Get a list of options for sample config generation + + Return option_list: A list of tuples with the group name + and options in that group. + Return type: list + """ + return [(heat_config.heat_group.name, heat_config.HeatGroup), (heat_config.heat_features_group.name,