avocado.plugins.runners package

Submodules

avocado.plugins.runners.asset module

class avocado.plugins.runners.asset.AssetRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for dependencies of type package

This runner handles the fetch of files using the Avocado Assets utility.

Runnable attributes usage:

  • kind: ‘asset’
  • uri: not used
  • args: not used
  • kwargs:
    • name: the file name or uri (required)
    • asset_hash: hash of the file (optional)
    • algorithm: hash algorithm (optional)
    • locations: location(s) where the file can be fetched from (optional)
    • expire: time in seconds for the asset to expire (optional)
CONFIGURATION_USED = ['datadir.paths.cache_dirs']
description = 'Runner for dependencies of type package'
name = 'asset'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.asset.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for dependencies of type asset'
PROG_NAME = 'avocado-runner-asset'
RUNNABLE_KINDS_CAPABLE = ['asset']
avocado.plugins.runners.asset.main()

avocado.plugins.runners.avocado_instrumented module

class avocado.plugins.runners.avocado_instrumented.AvocadoInstrumentedTestRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for Avocado INSTRUMENTED tests

Runnable attributes usage:

  • uri: path to a test file, combined with an Avocado.Test inherited class name and method. The test file path and class and method names should be separated by a “:”. One example of a valid uri is “mytest.py:Class.test_method”.
  • args: not used
CONFIGURATION_USED = ['run.test_parameters', 'datadir.paths.cache_dirs', 'core.show', 'job.output.loglevel', 'job.run.store_logging_stream']
DEFAULT_TIMEOUT = 86400
description = 'Runner for Avocado INSTRUMENTED tests'
name = 'avocado-instrumented'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.avocado_instrumented.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for avocado-instrumented tests'
PROG_NAME = 'avocado-runner-avocado-instrumented'
RUNNABLE_KINDS_CAPABLE = ['avocado-instrumented']
avocado.plugins.runners.avocado_instrumented.main()

avocado.plugins.runners.dry_run module

class avocado.plugins.runners.dry_run.DryRunRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for –dry-run.

It performs no action before reporting FINISHED status with cancel result.

Runnable attributes usage:

  • uri: not used
  • args: not used
description = 'Runner for --dry-run'
name = 'dry-run'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.dry_run.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for dry-run tests'
PROG_NAME = 'avocado-runner-dry-run'
RUNNABLE_KINDS_CAPABLE = ['dry-run']
avocado.plugins.runners.dry_run.main()

avocado.plugins.runners.exec_test module

class avocado.plugins.runners.exec_test.ExecTestRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for standalone executables treated as tests

This is similar in concept to the Avocado “SIMPLE” test type, in which an executable returning 0 means that a test passed, and anything else means that a test failed.

Runnable attributes usage:

  • uri: path to a binary to be executed as another process
  • args: arguments to be given on the command line to the binary given by path
  • kwargs: key=val to be set as environment variables to the process
CONFIGURATION_USED = ['run.keep_tmp', 'runner.exectest.exitcodes.skip']
description = 'Runner for standalone executables treated as tests'
name = 'exec-test'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.exec_test.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for exec-test tests'
PROG_NAME = 'avocado-runner-exec-test'
RUNNABLE_KINDS_CAPABLE = ['exec-test']
avocado.plugins.runners.exec_test.main()

avocado.plugins.runners.noop module

class avocado.plugins.runners.noop.NoOpRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Sample runner that performs no action before reporting FINISHED status

Runnable attributes usage:

  • uri: not used
  • args: not used
description = 'Sample runner that performs no action before reporting FINISHED status'
name = 'noop'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.noop.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for noop tests'
PROG_NAME = 'avocado-runner-noop'
RUNNABLE_KINDS_CAPABLE = ['noop']
avocado.plugins.runners.noop.main()

avocado.plugins.runners.package module

class avocado.plugins.runners.package.PackageRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for dependencies of type package

This runner handles, the installation, verification and removal of packages using the avocado-software-manager.

Runnable attributes usage:

  • kind: ‘package’
  • uri: not used
  • args: not used
  • kwargs:
    • name: the package name (required)
    • action: one of ‘install’, ‘check’, or ‘remove’ (optional, defaults to ‘install’)
description = 'Runner for dependencies of type package'
name = 'package'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.package.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for dependencies of type package'
PROG_NAME = 'avocado-runner-package'
RUNNABLE_KINDS_CAPABLE = ['package']
avocado.plugins.runners.package.main()

avocado.plugins.runners.podman_image module

class avocado.plugins.runners.podman_image.PodmanImageRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for dependencies of type podman-image

This runner handles download and verification.

Runnable attributes usage:

  • kind: ‘podman-image’
  • uri: the name of the image
  • args: not used
description = 'Runner for dependencies of type podman-image'
name = 'podman-image'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
class avocado.plugins.runners.podman_image.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'Runner for dependencies of type podman-image'
PROG_NAME = 'avocado-runner-podman-image'
RUNNABLE_KINDS_CAPABLE = ['podman-image']
avocado.plugins.runners.podman_image.main()

avocado.plugins.runners.python_unittest module

class avocado.plugins.runners.python_unittest.PythonUnittestRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for Python unittests

The runnable uri is used as the test name that the native unittest TestLoader will use to find the test. A native unittest test runner (TextTestRunner) will be used to execute the test.

Runnable attributes usage:

  • uri: a single test reference, that is “a test method within a test case
    class” within a test module. Example is: “./tests/foo.py:ClassFoo.test_bar”.
  • args: not used
  • kwargs: not used
description = 'Runner for Python unittests'
module_class_method

Return a dotted name with module + class + method.

Important to note here that module is only the module file without the full path.

module_path

Path where the module is located.

Ex: uri = ‘./avocado.dev/selftests/.data/unittests/test.py:Class.test_foo’ It will return ‘./avocado.dev/selftests/.data/unittests/’

name = 'python-unittest'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
unittest

Returns the unittest part of an uri as tuple.

Ex:

uri = ‘./avocado.dev/selftests/.data/unittests/test.py:Class.test_foo’ It will return (“test”, “Class”, “test_foo”)

class avocado.plugins.runners.python_unittest.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for python-unittest tests'
PROG_NAME = 'avocado-runner-python-unittest'
RUNNABLE_KINDS_CAPABLE = ['python-unittest']
avocado.plugins.runners.python_unittest.main()

avocado.plugins.runners.sysinfo module

class avocado.plugins.runners.sysinfo.PostSysInfo(config, sysinfo_config, queue, test_fail=False)

Bases: avocado.plugins.runners.sysinfo.PreSysInfo

Log different system properties after end event.

An event may be a job, a test, or any other event with a beginning and end.

Parameters:test_fail (bool) – flag for fail tests. Default False
sysinfo_dir = 'sysinfo/post'
class avocado.plugins.runners.sysinfo.PreSysInfo(config, sysinfo_config, queue)

Bases: object

Log different system properties before start event.

An event may be a job, a test, or any other event with a beginning and end.

Set sysinfo collectibles.

Parameters:
  • config (dict) – avocado configuration
  • sysinfo_config (dict) – dictionary with commands/tasks which should be performed during the sysinfo collection.
  • queue (multiprocessing.SimpleQueue) – queue for the runner messages
collect()

Log all collectibles at the start of the event.

installed_pkgs
sysinfo_dir = 'sysinfo/pre'
class avocado.plugins.runners.sysinfo.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for gathering sysinfo'
PROG_NAME = 'avocado-runner-sysinfo'
RUNNABLE_KINDS_CAPABLE = ['sysinfo']
class avocado.plugins.runners.sysinfo.SysinfoRunner

Bases: avocado.core.nrunner.runner.BaseRunner

Runner for gathering sysinfo

Runnable attributes usage:

  • uri: sysinfo type pre/post. This variable decides if the sysinfo is
    collected before or after the test.
  • kwargs: “sysinfo” dictionary with commands/tasks which should be
    performed during the sysinfo collection.
CONFIGURATION_USED = ['sysinfo.collect.installed_packages', 'sysinfo.collect.commands_timeout', 'sysinfo.collect.locale']
description = 'Runner for gathering sysinfo'
name = 'sysinfo'
run(runnable)

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

Parameters:runnable (avocado.core.nrunner.Runnable) – a Runnable instance that describes what is to be run
avocado.plugins.runners.sysinfo.main()

avocado.plugins.runners.tap module

class avocado.plugins.runners.tap.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.app.BaseRunnerApp

PROG_DESCRIPTION = 'nrunner application for executable tests that produce TAP'
PROG_NAME = 'avocado-runner-tap'
RUNNABLE_KINDS_CAPABLE = ['tap']
class avocado.plugins.runners.tap.TAPRunner

Bases: avocado.plugins.runners.exec_test.ExecTestRunner

Runner for standalone executables treated as TAP

When creating the Runnable, use the following attributes:

  • kind: should be ‘tap’;
  • uri: path to a binary to be executed as another process. This must provides a TAP output.
  • args: any runnable argument will be given on the command line to the binary given by path
  • kwargs: you can specify multiple key=val as kwargs. This will be used as environment variables to the process.

Example:

runnable = Runnable(kind=’tap’,
uri=’tests/foo.sh’, ‘bar’, # arg 1 DEBUG=’false’) # kwargs 1 (environment)
description = 'Runner for standalone executables treated as TAP'
name = 'tap'
avocado.plugins.runners.tap.main()

Module contents