From: Joe Gordon Date: Tue, 1 Apr 2014 22:06:36 +0000 (-0700) Subject: Use a temp dir for CONF.state_path X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ac2718c4aa7b6eb0c0e82df93cf59d890432d652;p=openstack-build%2Fneutron-build.git Use a temp dir for CONF.state_path external_pids will defaults to $state_path(/var/lib/neutron)/external/pids which isn't accessible when running unit tests so use a tempdir for CONF.state_path. This bug arose when oslo.config 1.3.0 came out which fixed bug #1282250 (I4324bda6f3de3cdf05f8eb3cf16052c04018dec8) and caused this issue. Change-Id: I253c5ea85c51eff94399da0b9462d10a9c509a0f Closes-Bug: #1301027 --- diff --git a/neutron/tests/base.py b/neutron/tests/base.py index a135010d1..9a0e89086 100644 --- a/neutron/tests/base.py +++ b/neutron/tests/base.py @@ -105,6 +105,9 @@ class BaseTestCase(testtools.TestCase): self.useFixture(fixtures.NestedTempfile()) self.useFixture(fixtures.TempHomeDir()) + self.temp_dir = self.useFixture(fixtures.TempDir()).path + cfg.CONF.set_override('state_path', self.temp_dir) + self.addCleanup(mock.patch.stopall) self.addCleanup(CONF.reset)