tmt.frameworks package
Submodules
tmt.frameworks.beakerlib module
- class tmt.frameworks.beakerlib.Beakerlib
Bases:
TestFramework- classmethod extract_results(invocation: TestInvocation, results: list[Result], logger: Logger) list[Result]
Check result of a beakerlib test
- classmethod get_environment_variables(invocation: TestInvocation, logger: Logger) Environment
Provide additional environment variables for the test.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
environment variables to expose for the test. Variables would be added on top of any variables the plugin, test or plan might have already collected.
- classmethod get_pull_options(invocation: TestInvocation, logger: Logger) list[str]
Provide additional options for pulling test data directory.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
additional options for the
rsynctmt would use to pull the test data directory from the guest.
- classmethod get_requirements(test: Test, logger: Logger) list[DependencySimple]
Provide additional test requirements needed by its framework.
- Parameters:
test – test for which we are asked to provide requirements.
logger – to use for logging.
- Returns:
a list of additional requirements needed by the framework.
tmt.frameworks.shell module
- class tmt.frameworks.shell.Shell
Bases:
TestFramework- classmethod extract_results(invocation: TestInvocation, results: list[Result], logger: Logger) list[Result]
Check result of a shell test.
If there are no extra results (e.g. extracted from the tmt-report-results.yaml), continue normally - set the main result outcome according to test exit status.
Otherwise, process given results, reduce their outcomes into a single one and set these results as tmt subresults.
- Parameters:
invocation – test invocation to which the results belong to.
results – results to reduce and save as tmt subresults.
- Returns:
list of results.
- classmethod get_test_command(invocation: TestInvocation, logger: Logger) ShellScript
Provide a test command.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
a command to use to run the test.
Module contents
- class tmt.frameworks.TestFramework
Bases:
objectA base class for test framework plugins.
All methods provide viable default behavior with the exception of
extract_results()which must be implemented by the plugin.- classmethod extract_results(invocation: TestInvocation, results: list[Result], logger: Logger) list[Result]
Extract test results.
- Parameters:
invocation – test invocation to which the check belongs to.
results – current list of results as reported by a test
logger – to use for logging.
- Returns:
list of results produced by the given test.
- classmethod get_environment_variables(invocation: TestInvocation, logger: Logger) Environment
Provide additional environment variables for the test.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
environment variables to expose for the test. Variables would be added on top of any variables the plugin, test or plan might have already collected.
- classmethod get_pull_options(invocation: TestInvocation, logger: Logger) list[str]
Provide additional options for pulling test data directory.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
additional options for the
rsynctmt would use to pull the test data directory from the guest.
- classmethod get_requirements(test: Test, logger: Logger) list[DependencySimple]
Provide additional test requirements needed by its framework.
- Parameters:
test – test for which we are asked to provide requirements.
logger – to use for logging.
- Returns:
a list of additional requirements needed by the framework.
- classmethod get_test_command(invocation: TestInvocation, logger: Logger) ShellScript
Provide a test command.
- Parameters:
invocation – test invocation to which the check belongs to.
logger – to use for logging.
- Returns:
a command to use to run the test.
- tmt.frameworks.provides_framework(framework: str) Callable[[type[TestFramework]], type[TestFramework]]
A decorator for registering test frameworks.
Decorate a test framework plugin class to register a test framework.