avocado.utils.path: Add PathInspector class

We're planning to move away from the rule

1 test == 1 directory

In order to do that, we need to be able to tell
the difference between a dropin test (this can
be written in any language as long as it is an
executable file) and an avocado test (a python
file that contains a test class derived from
the base avocado test file).

Introduce in the path library a path inspector,
that has code to figure this out.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Get rid of the 1 test == 1 dir rule

Make it possible to load avocado tests from any path,
rather than enforcing the rule '1 test has 1 dir'.

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

We want avocado tests to not require specific directories,
the user should be able to arrange them in the dir structure
they see fit. Also, if a test requires data, we suppose their
data dir is located in the same directory as the source file,
with the name:

[modulename].data

Re arrange the test dir to reflect this new structure.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests: Fix exec permissions for a bunch of avocado tests

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.test: Adapt test data dir to new organization

If tests do want to provide a datadir, it must be in
the same directory as the test source file. We probably
need to review this limitation and provide other
interesting alternatives.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.plugins.runner: Change the test lister to the new schema

Now tests don't need their own directories.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
selftests: Adapt all functional tests to the new testing schema

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.core.exceptions: Add OptionValidationError

So we can let the test runner to notify the user of
incorrect options passed in.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Give a better message to user when empty test URL is provided

Give the user a nice message rather than a crash report.

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

Add tests to verify if passing the full test path
works, rather than the test ID, and if an empty
test ID/alias triggers the correct error code.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
setup.py: adjust to new test data location

Signed-off-by: Cleber Rosa <crosa@redhat.com>
setup.py: install all in-tree tests and associated data files

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocado.spec: split in-tree sample tests into a subpackage

Signed-off-by: Cleber Rosa <crosa@redhat.com>
multiplexer plugin: simple usability fix

Since the multiplex file is a positional argument, we can not say
it's a required parameter, but we can and should check that at
least one was provided.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
avocado: Make tests to refer their ids

Make avocado tests to refer to their test ids (paths),
relative to the directory you are in. For example,
running:

avocado run tests/sleeptest.py

will give you

DEBUG LOG: /home/lmr/avocado/logs/run-2014-07-31-12.54.01/debug.log
TOTAL TESTS: 1
(1/1) tests/synctest.py.1: PASS (1.93 s)

Test log and data directories were changed accordingly. Now,
if your test is synctest.py, your data dir will be called
synctest.py.data.

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

Packaging fixes
Merge pull request #120 from lmr/flat-tests-2

Flat tests
Merge pull request #123 from clebergnu/multiplex_plugin_fix

multiplexer plugin: simple usability fix
avocado.plugins.xunit: Add NL at the end of output.

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