avocado.plugins.spawners package

Submodules

avocado.plugins.spawners.podman module

class avocado.plugins.spawners.podman.PodmanCLI

Bases: avocado.core.plugin_interfaces.CLI

configure(parser)

Configures the command line parser with options specific to this plugin.

description = 'podman spawner command line options for "run"'
name = 'podman'
run(config)

Execute any action the plugin intends.

Example of action may include activating a special features upon finding that the requested command line options were set by the user.

Note: this plugin class is not intended for adding new commands, for that please use CLICmd.

class avocado.plugins.spawners.podman.PodmanSpawner(config=None, job=None)

Bases: avocado.core.plugin_interfaces.DeploymentSpawner, avocado.core.spawners.common.SpawnerMixin

METHODS = [<SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]
static check_task_requirements(runtime_task)

Check the runtime task requirements needed to be able to run

create_task_output_dir(runtime_task)

Creates output directory in the intended location, before the task spawn.

The output directory path will be saved to the task.runnable.config for the usage by runners.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
deploy_artifacts()

Basic artifacts deployment for the isolated environment.

During this stage test references (i.e: mytest.py), data files (i.e: mytest.py.data/), and any other basic requirement should be deployed to the isolated environment. Please keep in mind that test requirements defined at the requirements resolver level are not part of this deployment and it will be fulfilled by the requirement resolver.

This method should also be executed before spawning the task.

deploy_avocado(where)

Avocado deployment for the isolated environment.

This method should be executed before spawning the task.

Parameters:where – handle for where the spawner should deploy avocado. You can use this parameter to pass any valid argument, like a container, vm, or any other isolated environment object or identifier.
description = 'Podman (container) based spawner'
get_eggs_paths(py_major, py_minor)

Return the basic eggs needed to bootstrap Avocado.

This will return a tuple with the current location and where this should be deployed.

is_requirement_in_cache(runtime_task)

Checks if it’s necessary to run the requirement.

There are occasions when the similar requirement has been run and its results are already saved in cache. In such occasion, it is not necessary to run the task again. For example, this might be useful for tasks which would install the same package to the same environment.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – runtime task with requirement
Returns:If the results are already in cache.
Return type:True if task is in cache False if task is not in cache None if task is running in different process and should be in cache soon.
is_task_alive(runtime_task)

Determines if a task is alive or not.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
python_version
save_requirement_in_cache(runtime_task)

Saves the information about requirement in cache before the runtime_task is run.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – runtime task with requirement
spawn_task(runtime_task)

Spawns a task return whether the spawning was successful.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
terminate_task(runtime_task)

Terminates a task before finish.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
update_requirement_cache(runtime_task, result)

Updates the information about requirement in cache based on result.

Parameters:
wait_task(runtime_task)

Waits for a task to finish.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
class avocado.plugins.spawners.podman.PodmanSpawnerInit

Bases: avocado.core.plugin_interfaces.Init

description = 'Podman (container) based spawner initialization'
initialize()

Entry point for the plugin to perform its initialization.

avocado.plugins.spawners.process module

class avocado.plugins.spawners.process.ProcessSpawner(config=None, job=None)

Bases: avocado.core.plugin_interfaces.Spawner, avocado.core.spawners.common.SpawnerMixin

METHODS = [<SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]
static check_task_requirements(runtime_task)

Check the runtime task requirements needed to be able to run

create_task_output_dir(runtime_task)

Creates output directory in the intended location, before the task spawn.

The output directory path will be saved to the task.runnable.config for the usage by runners.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
description = 'Process based spawner'
static is_requirement_in_cache(runtime_task)

Checks if it’s necessary to run the requirement.

There are occasions when the similar requirement has been run and its results are already saved in cache. In such occasion, it is not necessary to run the task again. For example, this might be useful for tasks which would install the same package to the same environment.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – runtime task with requirement
Returns:If the results are already in cache.
Return type:True if task is in cache False if task is not in cache None if task is running in different process and should be in cache soon.
static is_task_alive(runtime_task)

Determines if a task is alive or not.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
static save_requirement_in_cache(runtime_task)

Saves the information about requirement in cache before the runtime_task is run.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – runtime task with requirement
spawn_task(runtime_task)

Spawns a task return whether the spawning was successful.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
static terminate_task(runtime_task)

Terminates a task before finish.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.
static update_requirement_cache(runtime_task, result)

Updates the information about requirement in cache based on result.

Parameters:
static wait_task(runtime_task)

Waits for a task to finish.

Parameters:runtime_task (avocado.core.task.runtime.RuntimeTask) – wrapper for a Task with additional runtime information.

Module contents