Include wrapper scripts when creating avocado-examples package.

Include all examples/wrappers/*.sh scripts when building
the `avocado-examples` package. The scripts will live under
`/usr/share/avocado/wrappers` when installed.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
Make use of python-subprocess32 module if available.

python-subprocess32 [https://code.google.com/p/python-subprocess32/]
is a backport of Python 3.2 subprocess module with:

* Better process forking.
* More reliable when running with threads.

Although we're not going to use any feature of subprocess32,
this change turn it possible to use subprocess32 as a drop-in
replacement for the original subprocess module.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
Merge pull request #284 from ruda/wrappers_packaging

Include wrappers script when creating `avocado-examples` package.
Merge pull request #285 from ruda/optional_subprocess32

Make use of python-subprocess32 module if available.
avocado.test: Support params passing to DropinTests

This patch injects all params as env variables to
DropinTests. This is very useful for multiplexing
these tests.

Additionally the env_variables.sh example test was
adjusted to print CUSTOM_VARIABLE, which can be used
in selftest.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge pull request #288 from ldoktor/envtest

avocado.test: Support params passing to DropinTests [v2]
avocado.job: Fix deadlock in TestRunner.run()

multiprocessing.Queue().put() is asynchronous and in case the test died
critically before the put() was executed, TestRunner.run() waited for
infinity for early_state. This patch uses
multiprocessing.queues.SimpleQueue(), where it's guaranteed that after
executing put() the data are already in the SimpleQueue.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge branch 'ldoktor_abort_hang'
avocado: Print config file paths in datadir and list subcommands

It is useful information to the user where the config file
is, to reinforce where avocado is picking the default values.
So add it to the output of `datadir` and `list` subcommands.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugin: Visual plugin output tweaks

Get to a more toned down output for the subcommands
'datadir', 'plugins' and 'list'.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.plugin: Add parser attribute to Plugin object

This way we define more clearly the attributes of the
plugin object (many of them will implement a parser
object).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins: Split sysinfo and test_lister plugins

Put the sysinfo and test_lister plugins into separate
plugin files. Although not strictly necessary, the
neat 1 plugin - 1 source file relation makes things
organized and easy to understand.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #291 from lmr/plugin-tweaks

Plugin tweaks
Run avocado when called by 'python -m avocado'

Add a main entry point when avocado is called
by the command line option 'python -m avocado'.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
selftests..multiplex_tests: Check that vars changes

Replace test_run_mplex_timeout with test_run_mplex_params test which
executes 'env_variables.sh' and checks that output contain correct
output. This test checks the multiplexer capability to change variable
value.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge pull request #293 from ldoktor/selftest-mux

selftests..multiplex_tests: Check that vars changes
Merge pull request #292 from ruda/main_entry_point

 Run avocado when called by 'python -m avocado'
avocado.runner: New module with TestRunner class inside.

Creates the module `avocado.runner` where the `TestRunner` class lives.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
avocado.job: Remove TestRunner class.

Remove TestRunner class from this module, it's now defined inside new
module `avocado.runner`.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
avocado.plugins: Plugins vm and remote uses avocado.runner module.

Change plugins vm and remote to use new module `avocado.runner`
that contains the TestRunner class.

Signed-off-by: Rudá Moura <rmoura@redhat.com>