avocado.utils: Add utils for Avocado debugging

This module should contain useful tools for avocado debugging and
currently contains simple decorator which prints execution
duration of decorated functions and accumulated duration.

This is very easy to use and helpful to compare different versions.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
docs: Add Line-profiler guide

Python's line_profiler is very handy and it might be handy to mention
it in our documentation.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
docs: Add guide to some Eclipse less-known features related to avocado

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge pull request #304 from ldoktor/debug

avocado.utils: Add tools for Avocado development [v2]
Introduce avocado.loader module.

Introduce avocado.loader module with two different tasks
to perform: test discovery and test loading.

The test discover find tests (by ad hoc criteria) and return
a list of tests (test suite) to be loaded and then executed.

The test loader takes a test factory (a test class name and
parameters) and then load the test, creating a new test instance
ready to be executed.

Signed-off-by: Rudá Moura <rmoura@redhat.com>
avocado.runner: remove load_test() and use avocado.loader module.

Remove the previous load_test() method (which performs discovery
and loading) and use the new avocado.loader module.

Rename run() method to run_suite().

Signed-off-by: Rudá Moura <rmoura@redhat.com>
avocado.job: Use avocado.loader module.

Use avocado.loader features and allows to extend the test loading
with a hook test_loader, for using inside a plugin.

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

Test discovery and load (Phase I)
docs: Replace usernames with references to $HOME

Instead of leaving our own users in doc references, replace
/home/$USER to simply $HOME.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.runner: Fix typo in test stream

We're looking to replace `stderr`, not `sterr`.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #306 from lmr/fix_user_references_docs

docs: Replace usernames with references to $HOME
avocado: Mass import cleanup

Make non standard python modules to be imported after
standard ones, also respect lines between imports and
the rest of the code. Also, remove unused imports.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #307 from lmr/refactor-cleanups

Refactor cleanups
avocado: Remove references to /var/tmp/avocado

This probably won't work for multi-users and/or
if /var/tmp/avocado exists before avocado is run
for the first time (with different permissions from
a different user). It's also probably a security
issue: a malicious user could create a /var/tmp/avocado
symlink pointing to /home/someone/important-dir.

This patch removes references to /var/tmp/avocado,
fixing this important security bug.

Recommended reading:

https://kurt.seifried.org/2012/03/14/creating-temporary-files-securely/
http://www.linuxsecurity.com/content/view/115462/151/

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #308 from lmr/fix-var-tmp

avocado: Remove references to /var/tmp/avocado
Revert "Merge pull request #308 from lmr/fix-var-tmp"

This reverts commit 954ebf4d5febd75157ddf0eb7e8631fe1d6af55b, reversing
changes made to 1662755962371fad8348f371289fce095dcb587a.
avocado.utils: Introduce data_structures module

Introduce a module with useful classes for use inside
avocado core code or plugins. We start with the Borg
class, a design pattern considered to be better than
the Singleton [1]

[1] http://www.aleax.it/5ep.html

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Create and keep track of avocado tmp dir safely

Currently avocado uses /var/tmp/avocado as the default
location for the avocado tmp dir. This is a bug from the
security standpoint, since a malicious user could create
a /var/tmp/avocado symlink pointing to an important directory
of the system.

So, instead of using /var/tmp/avocado, remove the ability
to configure the base tmp directory (other than the traditional
$TMPDIR environment variable), and make the data_dir.get_tmp_dir()
API to return a safe, non predictable temporary directory.

Recommended reading:

https://kurt.seifried.org/2012/03/14/creating-temporary-files-securely/
http://www.linuxsecurity.com/content/view/115462/151/

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #309 from lmr/fix-var-tmp_v2

[V2] Fix avocado tmp directory security issue
avocado: Bump to version 0.17.0

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