Add tests/__init__.py from Nova to fix eventlet import

As nova.test imports eventlet, nova.tests.__init__ will fail
based on eventlet being imported without 'EVENTLET_NO_GREENDNS' being
set. This isn't an issue in Nova itself as all the tests will automatically
run nova.tests.__init__ which sets this variable and imports eventlet.

Here, we introduce this code from Nova so that just as in Nova,
our unit tests first import eventlet and set this ENV variable.

Change-Id: I8e035e532a4bb79f96623641a606ed3f089b3d04
Remove unused tests/base.py

This code was introduced in the initial series of commits
but is unused. Pruning.

Change-Id: I7aecb161f275bad48d4ec1ec6f78d0cb3ba05196
Remove oslo-incubator code

Because of the necessity of importing code
directly from Nova and the fact that Nova includes and imports
its own incubated code, using our own copies of incubated code
can conflict. As a practical example, the oslo logging module
sets configuration variables (using oslo.config) that conflict
with multiple imports of that same code.

While it might be possible to catch these exceptions and handle
them within the Oslo modules, it's relatively unnecessary given
that we must already depend upon and import code from Nova.

This might prove problematic later should we need to bring in
oslo modules that are not imported in Nova, but that's a bridge
we can cross if and when that becomes more than an academic exercise.

Change-Id: I5a612221e2a77768fcab45329726488b55fd5f8e
Remove depreciation / removal warning.

This depreciation warning is no longer relevant outside of the upstream
Nova branch.

Change-Id: Id79ba32829496ec900f31889324252e44f5f018b
Install nova (master/git) in testing environment

As we're a plugin, we require several imports from nova.
Thus, it is important that we have those modules available in
our testing environment.

Unfortunately, it seems that bringing this in via the requirements
files is unreliable so we instead include this directly via the tox.ini
where we can specify the '-e' parameter.

Change-Id: Ia5aa9d91fe5c263f5c8d492f9335c6e9adb191eb
Merge "Remove unused tests/base.py"
Merge "Remove depreciation / removal warning."
Merge "Remove oslo-incubator code"
Merge "Install nova (master/git) in testing environment"
Fix imports in test_driver

The old nova-based module path to mock_client and to
the driver itself were  being used and would result
in import and pep8 errors.

Change-Id: I004d487a0fcb93013477e31f3b7207fe4902c850
Handle inspect containers failures

Docker's client.inspect_container method may return None
if a container does not exist. As it is expected to be a
dictionary in several places in the docker driver, TypeErrors
may occur and raise unhandled Exceptions.

In the case of list_instances, this results in an
unhandled race-condition. There, we inspect a container
that existed when we begain assembling the list of instances
from the list of running containers, but containers have
been deleted and are no longer inspectable. This patch
will safely skip including those containers in the response
should their inspect_containers call return False.

Furthermore, as it is presumed the return of inspect_container will
be a dictionary, we change the result of a failed query into
an empty dictionary. This will allow successful .get() methods
for easier management of failed queries while still providing
a negative boolean response from the method ({} is False).

Change-Id: Iead7025efa024bed809640a37168174fc5354654
Closes-Bug: #1288940
Discover the docker registry port only once

The method of autodiscovering the docker registry is
slow, but only needs to be performed once. Rather than
discovering it on each spawn/snapshot/etc, we may simply
perform this discovery during host init.

Change-Id: Ic719d71c410104f2ae0343103c59bed497958318
Closes-Bug: 1286171
Stub get_meminfo to prevent reading /proc/meminfo

We don't want to read from /proc/meminfo while running tests. It
isn't pretty and it only works on Linux.

Creates a new stubs module and updates test_hostinfo to use
it for its hostinfo.get_meminfo stub. The TestHostInfoCase
tests now use Stubs rather than assignment operators.

Change-Id: Ifbf47e0c0faebf6b52139c2b38b673a7b9310d2f
Closes-Bug: 1284990
import namespace fixes and PBR naming fixed.

fixed namespace issues in driver.py

fixed pbr naming in __init__.py to match /setup.cfg#L2

Change-Id: I25b011d801c7930c345c19008850c361deaec41b
Merge "Stub get_meminfo to prevent reading /proc/meminfo"
Merge "Discover the docker registry port only once"
Lowercase all image names for Docker driver

Docker repository names must be lowercase. When
an image is requested or a snapshot is created,
the requested name should be lowercased such that
it may be given a valid name in the Docker registry.

Adds tests for snapshots and get_image_name.

Change-Id: I97b281d30454e33ba32e428901bb5da58400308f
Closes-bug: 1284761
Merge "import namespace fixes and PBR naming fixed."
Merge "Lowercase all image names for Docker driver"