avocado.utils.virt: Improve implementation.

Improve the current implementation by adding properties
to get status, names and domains. Add support functions
to start, stop, resume, suspend, shutdown, etc machines.

Clear documentation about what kind of snapshot: system checkpoint.

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

avocado.utils.virt: Improve implementation.
avocado: Make each test to print its label at the beginning of each test

Fixes bug #77.

Replace the basic logging.StreamHandler used to control
avocado stdout for a version that allows us to skip printing
newlines at each message. Then use this stream handler to
log the test label at the beginning of each test, rather
than at the end. When the tests are done, they can now simply
print STATUS strings appropriately, therefore not requiring
to log the test label.

Both the HumanTestResult and VMTestResult classes were
adapted to use this new soluton.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.test: Refactor traceback printing code

Reorganize and reduce code repetition by creating functions
to conveniently log/store tracebacks.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.archive: Warn of bad members inside archives

When performing tests with the latest LTP tarball, I found
a bad return from Tarfile().extract_file(), that could be
either a badly formed tarball or a Tarfile() bug. Either
way, the archive module was equipped to deal with such a
situation, not failing the test altogether.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.process: Make functions to log stdout/err as it happens

Fixes bug #78

In order to make process.run() and friends to log stdout/err
as they are generated, create a BgSubProcess object that has
threads that poll those streams continuously, channeling the
outputs through the logging system, and also storing it in
the result attribute.

Maybe this implementation could use some more love to make
it fully thread safe, with locks. This is just a first
version to show it is possible in a cleaner fashion than
what is implemented in autotest currently.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Fix bug running dropin tests

The heuristics to determine wether a test is a dropin
was wrong since we introduced multiplexing. This patch
fixes it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
selftests/all/functional: Add more basic functional tests

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #84 from avocado-framework/better-test-reporting

avocado: Make each test to print its label at the beginning of each test
avocado.utils.process: Fix stderr prefixing

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.cli.app: Catch all libc runtime errors to STDERR.

Fix bug #79.
Fix by setting environment variable LIBC_FATAL_STDERR_ to 1
to force all libc errors to be redirected to STDERR.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
avocado.utils.download: Update documentation.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
tests.doublefree: Add 'double free' test.

Double free performs a build of doublefree.c and execution,
that triggers a double free() function calling, for the same malloc()
region.

The motivation behind this test is to catch libc errors and log inside
Avocado execution (see bug #79).

Signed-off-by: Ruda Moura <rmoura@redhat.com>
tests: Add trinity wrapper

Trinity is a popular linux system call wrapper

http://codemonkey.org.uk/projects/trinity/

By implementing it we noticed a number of shortcomings
with avocado that have to be fixed in order to provide
a smoother developer experience.

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