From 0ea0cbba71a266a09d277ac0d2eb70dede7ccd0a Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Thu, 17 Jan 2013 18:42:37 +0000 Subject: [PATCH] Config lockutils to use a temp path for tests. * 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quantum/tests/unit/__init__.py b/quantum/tests/unit/__init__.py index 84bd5069f0..203b3cf3f7 100644 --- a/quantum/tests/unit/__init__.py +++ b/quantum/tests/unit/__init__.py @@ -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):