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.

Conflicts:
	neutron/tests/base.py

Change-Id: I253c5ea85c51eff94399da0b9462d10a9c509a0f
Closes-Bug: #1301027
(cherry picked from commit f59e5fff82)
This commit is contained in:
Joe Gordon 2014-04-01 15:06:36 -07:00 committed by Ihar Hrachyshka
parent f52449e60b
commit 8cb9d89567
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,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(CONF.reset)
if os.environ.get('OS_STDOUT_CAPTURE') in TRUE_STRING: