Fix occasional py27 test failures

test_ryu_base_app.TestRyuDFAdapter.test_switch_features_handler test
fails occasionally on the following error:

File "dragonflow/controller/datapath_layout.py", line 56, in get_datapath_layout
  with open(path) as f:
      No such file or diectory: '/etc/neutron/dragonflow_datapath_layout.yaml'

Closes-Bug #1781161
Change-Id: I4fdf835c688e46b42b540b70efd22331845e6c86
This commit is contained in:
Shachar Snapiri 2018-07-10 13:44:41 +03:00 committed by Shachar Snapiri
parent 5ee412bb04
commit b4c3010c5f
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@
import mock
import testtools
from dragonflow import conf as cfg
from dragonflow.controller import ryu_base_app
from dragonflow.tests import base as tests_base
@ -29,6 +30,11 @@ class TestRyuDFAdapter(tests_base.BaseTestCase):
"""
def setUp(self):
super(TestRyuDFAdapter, self).setUp()
cfg.CONF.set_override(
'datapath_layout_path',
'etc/dragonflow_datapath_layout.yaml',
group='df',
)
self.ryu_df_adapter = ryu_base_app.RyuDFAdapter(
vswitch_api=mock.Mock(),
nb_api=mock.Mock(),