avocado.utils.remote: Add timeout and attempts.

Add options to control remote timeout and the number of attempts
to connect.

Add 'remote_capable' feature.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
Merge pull request #93 from ruda/remote_timeout_attempts_capable

avocado.utils.remote: Add conenction timeout and attempts and remote_capable
avocado.utils: Small unused variable fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #95 from avocado-framework/small_lint_fixes

avocado.utils: Small unused variable fixes
avocado.core.exceptions: Introduce TestTimeoutError exception

Intended to be used in the special case a test times out.
Also, explain better what a TestError is supposed to be
(right now the description causes confusion).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.test: Add Test __getstate__ for serialization

In order to make the Test class serializable, implement
__getstate__ in a way that only exports the pickleable
attributes. This will be necessary for the following
patches that will insulate individual test executions
in forked processes.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.core.exceptions: Modifications to CmdError for serialization

In order to serialize the CmdError class, we need to
allow passing None command and CmdResult objects to
the class constructor.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Run avocado tests isolated in sub processes

In order to ensure avocado tests won't mess with the
main avocado process' environment, execute them in
forked subprocesses. If the test params have a
'timeout' attribute, use it as the timeout param
of the .join() multiprocess method, allowing the
subprocesses to be killed after timeout seconds if
they did not complete.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests: Add timeouttest

Add a timeout test module for avocado, to exercise the
test timeout functionality. This test is supposed to
fail by timeout.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
selftests/functional: Add timeout functional testing

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
selftests/functional: Add multiplex timeout test

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
docs: Add resources about test subprocesses and using test timeouts

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #96 from avocado-framework/test-execution-subprocess

Test execution isolation using subprocesses and timeout feature
avocado.utils.virt: Disable virt if remote module is off

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.utils.remote: Log when module is disabled.

Log message if remote or virt module is off.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
Merge pull request #99 from ruda/virt_off_if_remote_off

Virt off if remote off
avocado.result: Introduce TestResultProxy

Create a class that has the same interface as a
test result, but in fact has a list of test result
objects and can write to each of them any time
a test result operation is called. This is the
first step to make multiple output plugins to
work.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Make it possible to use multiple output plugins

Set up the TestResultProxy for the Job object, and
populate the test result objects according to what
the currently active plugins set. This means we go
on finding arguments with the suffix _result and
selecting any values that are classes derived from
TestResult and appending them to the result proxy.

With this, we can use any number of test result
plugins we'd like. If no test result objects are
set by plugins, fall back to the human output plugin.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Change output plugins to have extra 'output' and 'output_option' attr

In order to be able to tell whether there's more than one
output plugin trying to use the stdout, add the 'output'
and 'output_option' attributes. This changes the current
output plugins to use and set these attributes correctly.

Fix the xunit unittest to take into account the new
attribute names.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Prevent 2 output plugins to output to the stdout at the same time

With the new attributes, change the output setup procedure
to verify if more than one output plugin wants to use the
stdout, in which case we print an error message and fail.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>