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:
parent
d8b0f10ec7
commit
e38e0580ed
@ -30,6 +30,9 @@ from quantum.openstack.common import cfg
|
|||||||
reldir = os.path.join(os.path.dirname(__file__), '..', '..', '..')
|
reldir = os.path.join(os.path.dirname(__file__), '..', '..', '..')
|
||||||
absdir = os.path.abspath(reldir)
|
absdir = os.path.abspath(reldir)
|
||||||
cfg.CONF.state_path = absdir
|
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):
|
class BaseTest(unittest.TestCase):
|
||||||
|
Loading…
Reference in New Issue
Block a user