Basic structure for plugins.

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

Basic structure for plugins.
avocado.plugins: Remove some unused imports

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
README.rst: Remove incomplete section

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins: Streamline default plugin names and docstrings

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Make sysinfo into a runner Plugin.

Make sysinfo into a runner Plugin,
rename application from AvocadoRunnerApp to AvocadoApp,
due all options are now implemented as plugins and
Avocado is now a core application.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
Ignore files from git and fix script name in setup.py.

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

Make sysinfo into a runner Plugin.
Merge pull request #3 from ruda/minor_fixes

Ignore files from git and fix script name in setup.py.
avocado.cli.app: Remove unused imports

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.runner: PEP8 Fix
Add support for loading external plugins.

Also, app.run() now returns an exit code -- requires further
udpates to pass the exit code back from plugins.

To load external plugins:

p = MyPlugin()
app = avocado.cli.app.AvocadoApp(external_plugins=[p])
app.run()

and here's a MyPlugin example:

import sys
import avocado
from avocado.plugins import plugin

class MyPlugin(plugin.Plugin):
    def configure(self, parser):
        myparser = parser.add_parser('hello',
                                     help='Hello World!')
        myparser.set_defaults(func=self.hello)
	self.enabled = True

    def hello(self, args):
        print 'Hello World!', args

And how to execute:

python myplugin.py hello
Hello World! Namespace(func=<bound method MyPlugin.hello of <__main__.MyPlugin object at 0x1574f90>>, log_level='', logdir='', verbose=False)

Signed-off-by: Ruda Moura <rmoura@redhat.com>
Add support for loading external plugins from directory.

Create new option --plugins to pass a directory for loading external plugins.
Also, add some plugins examples in examples/avocado_example_plugins.py.

The external plugins are loaded from avocado_*.py modules and the plugins are
subclasses of Plugin().

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

Add support for loading external plugins.
avocado.plugins: PEP8 Fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins: PEP8 Fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.test: Move runner plugin functionality to test module

So that we can make avocado test modules self runnable.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Implement Job and TestModuleRunner classes

A Job is a sequence of operations executed on a
machine. This patch implements the class, which
is a refactor of the test run function, and a
class that implements a convenience found in
python unittests: the main() method. This allows
test modules to be executable in stand alone
mode, without the need of the avocado test runner.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.runner: Make the test runner to use the new Job class

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.test: Remove the run_test() function

As it is not necessary in avocado anymore.

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