avocado.plugins.vm: Remove unused import

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.vm: Extra padding on test result

The terminal support class retracts one character on regular
operation of the HumanOutput plugin (throbber). However,
we don't need that on the VM output plugin.

To avoid messing up with the internal state of the
TerminalSupport class, let's just add an extra padding
space to the VM result class.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.vm: Use relative test paths instead of absolute ones

When running tests on a VM, the tests are copied to it
and subsequently executed using absolute paths. While
this is technically correct, it is better to replicate
the dir structure of the tests in the source machine.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.vm: Display Job ID properly in the CLI

Set a Job ID in the host, and force the avocado command
run using it inside the VM. With this, we get to display
that information to the user.

Also, right now, as we parse and display results all at once,
displaying the job log doesn't matter much. Therefore,
let's keep the output symmetrical to the one obtained
running avocado in the host.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.vm: Increase CLI output consistence

Reword and align messages that inform libvirt domain
and VM login.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
docs: Add Virtual Machine Plugin documentation

It was something that we forgot to do back when the feature
was implemented. This basic guide should be enough to
understand and use the feature.

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

VM plugin improvements
avocado.core.tree: Modify repr() and str() behavior.

To make things easy for debugging, changing the default
behavior of repr() and str() to the class TreeNode.

* For repr() just output the node name.
  Example: TreeNode(name='prod')
* For str() output the node path and the variables from the environment.
  Example: /root/env/prod: foo=123, bar=456

So the output looks like that:

... after a break pointing into the multiplex() function...

(Pdb) print args[0]
[TreeNode(name='short'), TreeNode(name='medium'), TreeNode(name='long'), TreeNode(name='longest')]

(Pdb) print args[0][0]
/root/short: sleep_length=0.5

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.multiplexer: filters accepts strings or lists of strings.

For the filter_only and filter_out functions for filtering,
always accept a string or a list of string for for the parameters.

So this is possible to parse a YAML file like:

foo:
    filter-only: /root/env/prod

or

foo:
    filter-only: [/root/env/prod]

The previous behavior was treating the string as sequence,
so the filters were using the chars as input values.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.job: better output when variants are zero.

Provide a better output when the number of variants of a multiplex
is zero (for a giving set of tests and one multiplex file).

Also, when there is no tests passed, report early.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
selftests: Unit tests for path_parent() and any_sibling().

Include unit test for support functions used in the multiplexer.py
module: path_parent() and any_sibling().

Signed-off-by: Ruda Moura <rmoura@redhat.com>
multiplexer_unittest.py: simple pep8 style fix

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocado.multiplexer: improvements in path_parent and any_sibling.

Include documentation for path_parent and any_sibling and
use variable names more relevant.

In function any_sibling, if the number of arguments is less than 2,
then returns False, because it is obviously alone.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
multiplexer_unittest.py: switch from comments to a docstring

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Merge pull request #213 from clebergnu/ruda_multiplex_updates

Ruda's multiplex updates