avocado_runner_remote package

Module contents

exception avocado_runner_remote.ConnectError

Bases: avocado_runner_remote.RemoterError

class avocado_runner_remote.DummyLoader(args, extra_params)

Bases: avocado.core.loader.TestLoader

Dummy-runner loader class

discover(url, which_tests=<DiscoverMode.DEFAULT: <object object>>)

Discover (possible) tests from an reference.

  • reference (str) – the reference to be inspected.
  • which_tests (DiscoverMode) – Limit tests to be displayed

a list of test matching the reference as params.

static get_decorator_mapping()
static get_type_label_mapping()
name = 'dummy'
class avocado_runner_remote.Remote(hostname, username=None, password=None, key_filename=None, port=22, timeout=60, attempts=10, env_keep=None)

Bases: object

Performs remote operations.

Creates an instance of Remote.

  • hostname – the hostname.
  • username – the username. Default: autodetect.
  • password – the password. Default: try to use public key.
  • key_filename – path to an identity file (Example: .pem files from Amazon EC2).
  • timeout – remote command timeout, in seconds. Default: 60.
  • attempts – number of attempts to connect. Default: 10.

Create a directory.

Parameters:remote_path – the remote path to create.

Performs uptime (good to check connection).

Returns:the uptime string or empty string if fails.
class avocado_runner_remote.RemoteCLI

Bases: avocado.core.plugin_interfaces.CLI

Run tests on a remote machine


Configures the command line parser with options specific to this plugin

description = "Remote machine options for 'run' subcommand"
name = 'remote'

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_runner_remote.RemoteTestRunner(job, result)

Bases: avocado.core.runner.TestRunner

Tooled TestRunner to run on remote machine using ssh


Checks if the remote system appears to have avocado installed

The “appears to have” description is justified by the fact that the check is rather simplistic, it attempts to run an avocado -v command and checks if the output looks like what avocado would print out.

Return type:tuple with (bool, tuple)
Returns:(True, (x, y, z)) if avocado appears to be installed and (False, None) otherwise.
remote = None

remoter connection to the remote machine

remote_version_re = <_sre.SRE_Pattern object>
run_suite(test_suite, variants, timeout=0, replay_map=None, suite_order='variants-per-test')

Run one or more tests and report with test result.

  • params_list – a list of param dicts.
  • variants – A varianter iterator (unused here)

a set with types of test failures.

run_test(references, timeout)

Run tests.

Parameters:references – a string with test references.
Returns:a dictionary with test results.

Setup remote environment


This method is only called when run_suite gets to the point of to be executing setup method and is called at the end of the execution.

Warning:It might be called on setup exceptions, so things initialized during setup might not yet be initialized.
exception avocado_runner_remote.RemoterError

Bases: exceptions.Exception

avocado_runner_remote.receive_files(local_path, remote_path)

Receive files from the defined fabric host.

This assumes the fabric environment was previously (and properly) initialized.

  • local_path – the local path.
  • remote_path – the remote path.
avocado_runner_remote.run(command, ignore_status=False, quiet=True, timeout=60)

Executes a command on the defined fabric hosts.

This is basically a wrapper to fabric.operations.run, encapsulating the result on an avocado process.CmdResult object. This also assumes the fabric environment was previously (and properly) initialized.

  • command – the command string to execute.
  • ignore_status – Whether to not raise exceptions in case the command’s return code is different than zero.
  • timeout – Maximum time allowed for the command to return.
  • quiet – Whether to not log command stdout/err. Default: True.

the result of the remote program’s execution.

Return type:



fabric.exceptions.CommandTimeout – When timeout exhausted.

avocado_runner_remote.send_files(local_path, remote_path)

Send files to the defined fabric host.

This assumes the fabric environment was previously (and properly) initialized.

  • local_path – the local path.
  • remote_path – the remote path.