]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Config lockutils to use a temp path for tests.
authorMaru Newby <mnewby@internap.com>
Thu, 17 Jan 2013 18:42:37 +0000 (18:42 +0000)
committerMaru Newby <mnewby@internap.com>
Thu, 17 Jan 2013 18:42:37 +0000 (18:42 +0000)
 * Tests for iptables_manager were leaving lockfiles in the source
   tree due to the default lock path being in the openstack common
   tree.  This patch sets the lock_path option to an empty string
   for unit tests to ensure that a temporary location is used
   instead.

Change-Id: I5d36dca8cfeba991dfe0803e536d3d74dd2ffe7f

quantum/tests/unit/__init__.py

index 84bd5069f0008ba2dfacdd3d6e88b05c191f6981..203b3cf3f798da53bbdad3a763e4354fe5ab2d5e 100644 (file)
@@ -30,6 +30,9 @@ from quantum.openstack.common import cfg
 reldir = os.path.join(os.path.dirname(__file__), '..', '..', '..')
 absdir = os.path.abspath(reldir)
 cfg.CONF.state_path = absdir
+# An empty lock path forces lockutils.synchronized to use a temporary
+# location for lock files that will be cleaned up automatically.
+cfg.CONF.lock_path = ''
 
 
 class BaseTest(unittest.TestCase):