Makes sure tests don't leave lockfiles around
Makes sure tests don't leave lockfiles around

Our new lockfile code works fine if the locks already exist, but
it is annoying to pollute the source tree with lockfiles in the
tests.

This modifies the lockfile code slightly to use a tempdir if
lock_path is none. Note that a tempdir will not work in production
but it is fine for testing. We set the lock_path to None in the
testing flags.

Also removes the explicit cleanup in run_tests.sh. The new solution
works with tox and will work even if we add new locks.

Fixes bug 1035426

Change-Id: I613926e4288442e79df50ea5f5bd8f9eafdfe7e7

citrix-openstack-build/oslo.versionedobjects,openstack/oslo.versionedobjects