Add function descriptions for tempest plugin

Change-Id: Id6791a3df84d474c95b6b043c90180d09d4d824f
This commit is contained in:
ricolin 2018-02-07 17:15:38 +08:00 committed by Rico Lin
parent 1adf487fb1
commit ce14ccaacc
1 changed files with 32 additions and 0 deletions

View File

@ -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,