avocado.job: Remove the 'Interrupted by user' message on Ctrl+C

If a process is misbehaved, that message will be confusing,
because avocado is actually waiting on child processes to
finish.

Then let's get rid of the message altogether.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.process: Execute commands on a subshell

For a number of reasons, the original implementation
called the processes with shell=False (subprocess default),
I noticed later that we lose things like the ability
to use pipes in commands executed and proper job
control and process handling.

So change that and use shell=True.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
selftests/functional: basic_tests: Remove unused import

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.process: Refactor and bugfix

Chasing a bug, I found opportunities to improve the
process related code:

*  Populating the CmdResult object on every
   opportunity that wait() or poll() is executed
   in the subprocess.

*  Changing the name of the original wait() method
   to run(), making it consistent with the run()
   function of the module.

Also, to avoid a defunct process on a Ctrl+C, register
the SIGINT signal handler to the SubProcess wait()
method.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Fix Ctrl+C handling (for real this time)

1) Revert the test subprocess side SIGINT handler
   to its original form (just raising an appropriate
   TestInterruptError exception)
2) Move the KeyboardInterrupt handling to the test
   run main loop, as we had nested handling blocks
   that ended up creating a deadlock.
3) Start counting the ignore window time after Ctrl+C is
   pressed by the second time, not the first.

With this, we finally get trinity to call its Ctrl+C
handler correctly and cleanup after itself, as well
as avocado cleaning up correctly if enough time is
given to the test subprocesses to end.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests/trinity: Don't print ResultCmd object

Not necessary or desirable, since we get trinity's
output in the logs already, and the output of the
test is quite extensive.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #158 from lmr/ctrl-c-improvements-last

Ctrl c improvements last
avocado.core.tree: Add note about ETE2 and copyright clarification

Add a note in the copyright headers and tree docstrings
recognizing that the base Tree data structure had inspiration
(and the ASCII drawing code) from the ETE2 project, and
hereby list Jaime Huerta Cepas <jhcepas@gmail.com> as one
of the authors of the code, with his express consent.

CC: Jaime Huerta Cepas <jhcepas@gmail.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #160 from lmr/copyright-clarification

avocado.core.tree: Add note about ETE2 and copyright clarification
avocado.plugins.plugin: Change instance creation in Plugin class.

* Add optional parameters 'name' and 'enabled' to the constructor.
  You can just use the class variables name and enabled.
  Change plugin variable to noname and enabled variable to False.

* Include new attribute 'description' to include short documentation
  about the plugin. By default it uses the docstring of the class
  or fall backs to a message that there is no documentation.

* Add repr() facility.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.plugins.lister: Get plugin docs with description attribute.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.plugins.manager: Log when module has no plugin inside.

Log a message when loading external plugins discovers that
there is no plugin inside a module.

Plus: cosmetic formatting.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
selftests: "Hello World!" external plugin, functional test.

Add new "hello world!" plugin, to perform functional tests
on external plugins.

Created class ExternalPluginsTest() to move all
functional tests regarding external plugins there.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
selftest: Add unit tests for plugins.

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