tmt.frameworks package
Submodules
tmt.frameworks.beakerlib module
- class tmt.frameworks.beakerlib.Beakerlib
Bases:
TestFramework
- classmethod extract_results(invocation: TestInvocation, logger: Logger) list[tmt.result.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
rsync
tmt 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, logger: Logger) list[tmt.result.Result]
Check result of a shell test
- 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:
object
A 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, logger: Logger) list[tmt.result.Result]
Extract test results.
- Parameters:
invocation – test invocation to which the check belongs to.
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
rsync
tmt 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[tmt.frameworks.TestFramework]], type[tmt.frameworks.TestFramework]]
A decorator for registering test frameworks.
Decorate a test framework plugin class to register a test framework.