Bump avocado version to 0.8.0

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Makefile: Update build rules

Make reference to the 'trusty' ubuntu version, rather
than the outdated 'saucy'. Also, put the ubuntu
maintainer's email in the source generation package.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.misc: Remove unique function

The presence of a misc module encourages dumping functions
there without thought to better module names to put them
on. Let's remove the unique function since it can be
expressed by the combination of 2 native python types,
should the need arise.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.misc: Remove get_relative_path

That function is not used in the avocado code base, and
it is superseded by standard library function
os.path.relpath().

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.misc: Remove unused part of read_file() implementation

That part is not going to be executed anyway. It's probably
a leftover from previous iterations.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.misc: Improve function docstrings

Also, reorder write_file and write_one_line.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils: Rename misc to io

Having 'misc' libraries tends to encourage people to
dump random functions without much thought as to
their location. Let's rename 'misc' to 'io'.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils: Straighten up internal imports

It is nice to be able to refer to modules using the
dot notation. This fixes some missing imports in the
avocado.utils module, as well as it removes unused
ones.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils: Add path submodule

Add a module for path related operations in avocado.utils.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado: Use avocado.utils.path.init_dir in dir init operations

It saves quite a lot of code, since this is such a common
operation in avocado.

I'd like to have the reviewer to give a good thought of
whether this is a good solution or not (I think it is,
although API names and such could be better thought off).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: Get rid of timeout in Queue.get() call

The timeout there is unnecessary and introduces races.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #119 from lmr/avocado-utils-work

Avocado utils work
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>