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
This commit is contained in:
Maru Newby 2013-01-17 18:42:37 +00:00
parent bb435fe01b
commit 0ea0cbba71

View 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):