avocado.core.spawners package


avocado.core.spawners.common module

class avocado.core.spawners.common.BaseSpawner

Bases: object

Defines an interface to be followed by all implementations.


Read bytes from a files in binary mode.

This is a helpful method to read local files bytes efficiently.

If the spawner that you are implementing needs access to local file, feel free to use this method.

static is_task_alive(task)
stream_output(job_id, task_id)

Returns output files streams in binary mode from a task.

This method will find for output files generated by a task and will return a generator with tuples, each one containing a filename and bytes.

You need to provide in your spawner a stream_output() method if this one is not suitable for your spawner. i.e: if the spawner is trying to access a remote output file.

class avocado.core.spawners.common.SpawnMethod

Bases: enum.Enum

The method employed to spawn a runnable or task.

ANY = <object object>

Spawns with any method available, that is, it doesn’t declare or require a specific spawn method

PYTHON_CLASS = <object object>

Spawns by running executing Python code, that is, having access to a runnable or task instance, it calls its run() method.


Spawns by running a command, that is having either a path to an executable or a list of arguments, it calls a function that will execute that command (such as with os.system())

avocado.core.spawners.exceptions module

exception avocado.core.spawners.exceptions.SpawnerException

Bases: Exception

avocado.core.spawners.mock module

class avocado.core.spawners.mock.MockRandomAliveSpawner

Bases: avocado.core.spawners.mock.MockSpawner

A mocking spawner that simulates randomness about tasks being alive.

class avocado.core.spawners.mock.MockSpawner

Bases: avocado.core.spawners.common.BaseSpawner

A mocking spawner that performs no real operation.

Tasks asked to be spawned by this spawner will initially reported to be alive, and on the next check, will report not being alive.

METHODS = [<SpawnMethod.PYTHON_CLASS: <object object>>, <SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]

avocado.core.spawners.podman module

class avocado.core.spawners.podman.PodmanSpawner

Bases: avocado.core.spawners.common.BaseSpawner

IMAGE = 'fedora:31'
METHODS = [<SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]
PODMAN_BIN = '/usr/bin/podman'
static is_task_alive(task)

avocado.core.spawners.process module

class avocado.core.spawners.process.ProcessSpawner

Bases: avocado.core.spawners.common.BaseSpawner

METHODS = [<SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]
static is_task_alive(task)

Module contents