Start adding reusable test fixtures.

Now that nova is using fixtures, we have grown some that can be used across
projects. The mox/stubout fixture is a great example of this - and also can
be used in the oslo tests themselves.

Change-Id: Ia78019317a6772c5c66a875c948854248383f9ea
Use testtools as test base class.

On the path to testr migration, we need to replace the unittest base classes
with testtools.
Replace tearDown with addCleanup, addCleanup is more resilient than tearDown.
The fixtures library has excellent support for managing and cleaning
tempfiles. Use it.
Replace skip_ with testtools.skipTest

Part of blueprint grizzly-testtools.

Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
Replace direct use of testtools BaseTestCase.

Using the BaseTestCase across the tests in the tree lets us put in log
fixtures and consistently handle mox and stubout.

Part of blueprint grizzly-testtools.

Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
Merge "Start adding reusable test fixtures."
Merge "Use testtools as test base class."
Merge "Replace direct use of testtools BaseTestCase."
Default lockutils to using a tempdir

* Previously lockutils attempted to use __file__/../ as the lock path.
  This causes packages to fail if the user running the code doesn't have
  +w access to that dir. Remove the default so it will use mkdtemp
  instead
* Fixes bug 1107950

Change-Id: Ie0cd6fac5403a53a768eb4a0ce7da602b3fef755
Merge "Default lockutils to using a tempdir"
Emit a warning if RPC calls made with lock.

This patch will log a warning every time a RPC call is made while
a lock is held if the caller has requested it. This should help us
track down performance problems such as the security group refresh
problem recently found in nova.

RPC calls can emit a warning if called with check_for_lock=True
and debugging is turned on.

Sneaks up on bug 1063222.

Change-Id: Ice94093efb3cb95dd58b31d6ba817c7d505c15af
Merge "Emit a warning if RPC calls made with lock."
Use oslo-config-2013.1b3

The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Remove the 'deps = pep8==1.3.3' and 'deps = pyflakes' from tox.ini as
it means all the other deps get installed with easy_install which can't
install oslo-config from the URL.

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
Fix Copyright Headers - Rename LLC to Foundation

One code change, rest are in headers

Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
Fix locking issues in Windows

The Windows Storage Cinder plugin through
the Windows Locks implementation
of the InterProcessLock fails in
attaching/detaching operations.

Change-Id: I682205592e152b3222e04ca3221d25594d134dd9
Fixes: bug #1153966
Merge "Fix Copyright Headers - Rename LLC to Foundation"
Removes unused imports in the tests module

Fixes bug #1157596

Change-Id: I36d5484eaa2f0e21188eed6e70cc1ad785233d6a
Merge "Removes unused imports in the tests module"
lockutils: improve the external locks test

Use a separate directory for the lockutils external locks and for the
test's flocks which are used to check that serialization is actually
occurring. By using the same directory, we can't test the code in
lockutils which auto-creates this directory because the dir gets
deleted by a process by lockutils cleanup while another directory
is using it for flocks.

Also, assume the the handles directory has been created in the parent
rather than having each child attempt to create it.

Related, add a try/finally block so that when a child process throws an
exception it immediately exits rather than deleting the temporary
directories created by the parent.

Change-Id: I32d7e8e05fb3f22cf38fa586f8bc97646c83f182
lockutils: add a failing unit test

Add a unit test which fails because of #1107950 - in this case,
lockutils is deleting the lock directory every time the lock is dropped
even though another process might have acquired a lock using that
directory.

Change-Id: Ic82409f9462e570bc102ab469334c53aafc6d7ac
Locking edge case when lock_path does not exist

Fixes bug 1158179

In the case that the lock_path does not exist and there is a contested
resource then the process that was waiting on the lock will not
be locking due to the fact that the directory was deleted.

Change-Id: I75d720d4df499e85386d3e2cc86b927b017e12ac
Merge "lockutils: improve the external locks test"