Merge pull request #86 from cevich/docker_0.6.5

Dockertest Version 0.6.5 (No API Changes)
DockerContainersBase.get_size -> False

Docstring lists this as being skipped by default
but ``get_size`` formerly was ``True``.  This
makes retrieving the list of containers extremely
slow.  This changes the setting to match the
docstring.

Signed-off-by: Chris Evich <cevich@redhat.com>
dockertest.output: Enhance TextTable string parsing

*  Previously, it was hard coded to parse the table
   header and data via str.splitlines().  However,
   this does not allow easy subclass extension.

*  Split init string parsing into two overrideable
   methods, ``parseheader()`` and ``parserows()``.
   These may be overridden by subclasses to
   control basic-level interpretation of
   the ``table`` string parameter to ``__init__()``.

Signed-off-by: Chris Evich <cevich@redhat.com>
dockertest: Add table-parsing unittest for special case

Signed-off-by: Chris Evich <cevich@redhat.com>
Dockertest Version 0.7.1 (API Changes)

Signed-off-by: Chris Evich <cevich@redhat.com>
dockertest.subtest: Improve the (sub)test log output

This patch gets rid of standard autotest logging and uses the python
logging functions instead (as it's usual in autotest tests itself!).

Each line is prepended with 2 tabs in order to improve readability of
the text. Additionally duplicite messages were removed and the SubSubtest
log lines updated. Each SubSubtest line starts with additional 2 spaces.
Using another \t seemed waist of lines as each SubSubtest is introduced
with RUNNING: message.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
dockertest.dockercmd: Add verbose flag

This patch makes possible to set the verbose flag for underlying utils.run

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
dockertest: images/container modules parse update

*  Current tabular output parsers separate columns
   based on number of whitespace.  This fails
   if any table content contains multiple spaces.

*  Replace whitespace-sensitive parser with generic
   parser based on column name spacing, from
   output module.

*  DockerContainer.ports defined as always being a string
   but default param allows it to be set to None.  Fix
   this inside __init__ so it's assigned an empty string
   if a None parameter is received.

*  Several methods were calling ``get_container_list()``
   and assuming it was always a python-list.  However
   it's long-since been documented as "implementation-specific".
   Fix them to call self.list_containers() instead.

Signed-off-by: Chris Evich <cevich@redhat.com>
control: Prevent AttributeError in cleanup

Apperently not all modules have __name__ attribute...

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
dockertest:  Remove legacy cleanup options

Both ``remove_after_test`` and ``try_remove_after_test``
are now included in ``defaults.ini`` though marked
as deprecated.

Signed-off-by: Chris Evich <cevich@redhat.com>
Dockertest: Replace 'enabled' with 'disabled'

Enabling tests via ``--args`` on autotest command line
or running all tests is default.  No convenient way
to disable a test from inside dockertest.  The new
``disabled`` option, accepts subtest or subsubtest
CSV to bypass.

Signed-off-by: Chris Evich <cevich@redhat.com>
docker test: Attach test.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
dockertest: DockerImages attribute bug

There is no ``__setattr__()`` to pass-through to the interface class,
so any attribute setting will only affect ``DockerImages`` instance.
This is not normally what is desired.  Add a ``__setattr__()``
method and fixup local attribute access to permit callers to
interact with interface instance as intended.

Signed-off-by: Chris Evich <cevich@redhat.com>
subtests...rmi: Fix skip-list

A string is iterable, but a string is not a list.

Signed-off-by: Chris Evich <cevich@redhat.com>
subtests: Drop 'RUNNING' from logging

*  Consolidate log message formatting code.

*  Allow failif method w/o reason

Signed-off-by: Chris Evich <cevich@redhat.com>
containers:  debug logging when killing

Signed-off-by: Chris Evich <cevich@redhat.com>
images: Throw a real DockerCommandError

Some tests expect a DockerCommandError to be thrown
and will not accept a regular CmdError.  However,
this general behavior is wrong anyway because
callers should not be dependent on implementation-
specific exceptions.  Add a temporary band-aid
so DockerImagesCLI raises the expected exception.
Add a bunch of FIXME's to address the real problem
with some well-defined exception classes for common
conditions.

Signed-off-by: Chris Evich <cevich@redhat.com>
subtests...rmi: Remove by id if name fails

If an image has no name, removal will fail.
Try again by id and throw exception if that fails.

Signed-off-by: Chris Evich <cevich@redhat.com>