.travis.yml: Run selftests in verbose mode

In case of timeout we might want to get the name of the last running
test, therefor setting verbose mode for them.

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

.travis.yml: Run selftests in verbose mode
no changes, just style cleanups
avocado: Insert children using add_child tree

When initializing TreeNode we should use the add_child function
in order to set the parent correctly.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
avocado.multiplexer: Construct the tree directly from yaml file

Instead of creating OrderedDicts and then converting it into
tree structure, this modifies the `mapping` constructor to create
the tree structure directly. This way we only walk through the yaml
file once.

Also remove the `tree_unittest.TestReadYAML` selftest as it lost it's
meaning. Valures are checked in the TestTreeNode selftest.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
avocado.core.tree: Use yaml.CLoader when available

CLoader is C (faster) version of the Loader. In case it's unavailable
it fall-backs automatically to the default Loader.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
selftests: Speedup functional..multiplex_test

multiplex_test uses sleeptest to check it supplies the values correctly.
This patch uses passtest instead.

For now it uses the same multiplex file and in `test_run_mplex_timeout`
still uses sleeptest, but there is FIXME message to use envtest once
it supports params passing (another pull request)

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge branch 'ldoktor-multiplexer'
GDB: introduce a "ready to use" check when instantiating a GDBServer

It turns out that, in some conditions, such as when immediatelly trying
to communicate with a gdbserver process after it is executed, results in
failure.

The reason seems to be that gdbserver itself takes "some" time between
being executed and binding to the TCP port.

While prototyping GDB remote client in pure Python, this kind of race
condition was found.

Now, by default, there will be a 2 seconds timeout and a explicit check
for gdbserver's "ready to use" status.

Changes from v1:
 * added documentation for the __init__ method

Signed-off-by: Cleber Rosa <crosa@redhat.com>
GDB: add implementation of remote protocol

GDB talks to targets via a so-called remote protocol. These targets
can be things like gdbserver, ROM monitors on specific hardware boards,
or applications that implement the same protocol.

One noteworthy example of application is QEMU, which implements some
basic GDB Remote commands and also a few extenions of its own.

This initial implementation allows connecting to the remote target,
sending commands and receive results. The API can certainly grow later
based on demand.

Changes from v1:
 * Fix a typo in the REMOTE_MAX_PACKET_SIZE comment

Signed-off-by: Cleber Rosa <crosa@redhat.com>
GDB: use gdbserver --server-sdtderr option if available

A new command line option is being added to upstream GDB. This new
option allows gdbserver's own stderr (but not its inferior process
stderr) to be redirected to another file.

If that feature is available on the about to be used gdbserver, then
let's make use of it. This redirects its stderr to /dev/null, because
avocado itself has no real use for gdbserver's own stderr output.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Merge pull request #280 from clebergnu/gdb_remote_v2

GDB remote protocol support [v2]
Merge pull request #281 from clebergnu/gdbserver_stderr_v2

GDB: use gdbserver --server-sdtderr option if available
avocado.spec: Fix bogus date

Fixes a sloppy copy and paste I made in the spec file.

Signed-off-by: Lucas Menghel Rodrigues <lmr@redhat.com>
selftests: functinal/basic_tests: Add expected output for the abort test

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
examples/tests/abort: Add a timeout to avoid aborttest taking too long

It is likely that a race condition in avocado makes the abort
test to take a long while executing (24 hours), but that
was only identified in the Travis CI environment. Instead
of taking that long, we should end the abort test quickly,
after a test timeout. This will allow us to continue to
see the failure, only that the rest of the tests will be
executed, and no penalties to Travis due to inefficient
builds.

Of course, we still need to find the actual bug and fix it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #283 from lmr/fix-abort-test

Fix abort test taking too long to execute
setup.py: Remove dependency in setuptools

setuptools is not a standard module and makes things
unpredictable and forces us to push MANIFEST.in to
include more files so the binary distributions get
filled appropriately. In a retrospect, it was a bad
idea. Let's revert it.

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

Fix rpmbuild
Include wrapper scripts when creating avocado-examples package.

Include all examples/wrappers/*.sh scripts when building
the `avocado-examples` package. The scripts will live under
`/usr/share/avocado/wrappers` when installed.

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