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>
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>
Merge pull request #294 from ruda/refactory_job_and_runner_modules

Move class TestRunner inside avocado.job into a proper new module avocado.runner
avocado.plugins: Fix garbage output on remote and vm plugins.

When using the remote or vm plugins, the JSON (or XML) result from
the remote server is coming with garbage at the end.
This commit fix this by filtering the result.

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

Fix garbage output on remote and vm plugins.
avocado.settings: If local config doesn't exist, create an empty config file

And put a reminder of the purpose of that file, while we're at it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Move settings.ini to avocado.conf

As discussed in the Trello card

https://trello.com/c/WsDMg7RP/161-initial-support-for-avocado-config-files-server-and-client

Move settings.ini to avocado.conf. The basic idea is
that the name is more intuitive.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins: Add config plugin

Add the config plugin, that introduces the 'config'
subcommand. This shows to the user the config keys
available in the system.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
etc/avocado.conf: Use /var/tmp instead of /tmp

To avoid problems with /tmp being mounted on a tmpfs in
certain systems.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.settings: Read from both system wide and user config

Whatever is in the system wide settings can be later
overriden by users. Also, change the settings.config_path
attribute to settings.config_paths, and change it to
a list. This way users can see the order in which their
config files are parsed. Also, Introduce a system wide conf.d
directory, that is supposed to ship config files for avocado
plugins. The order for config parsing is:

 * System wide avocado config (/etc/avocado/avocado.conf)
 * System wide avocado plugins config (/etc/avocado/conf.d/*.conf)
 * Local config for the user running avocado (~/.config/avocado/avocado.conf)

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

Add a section that explains how the avocado config system
works.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Remove datadir plugin

Since the 'config' plugin supersedes functionality
in the 'datadir' plugin, let's remove it from avocado.
Update the configuration accordingly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
debian packaging: Update control dependencies and changelog

The setup.py related changes are good enough to make the
avocado debian packages OK, but we were lacking the
python-pystache dependency on debian. Fix this.

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