Increase timeouts for OVSDB in functional tests
Increased timeouts for OVSDB connection:
- ovsdb_timeout = 30
This patch will mitigate the intermittent timeouts the CI is
experiencing while running the functional tests.
Change-Id: I97a1d170926bb8a69dc6f7bb78a785bdea80936a
Closes-Bug: #1815142
(cherry picked from commit 30e901242f
)
changes/22/682022/1
parent
053e9b662c
commit
42d9106ee5
@ -0,0 +1,59 @@
|
||||
# Copyright 2019 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron.tests import base
|
||||
from neutron.tests.functional import base as functional_base
|
||||
|
||||
|
||||
NEW_CONFIG_GROUP = cfg.OptGroup('testgroup',
|
||||
title='Test wrapping cfg register')
|
||||
SOME_OPTIONS = [
|
||||
cfg.StrOpt('str_opt', default='default_value'),
|
||||
cfg.StrOpt('int_opt', default=1),
|
||||
cfg.BoolOpt('bool_opt', default=True)
|
||||
]
|
||||
|
||||
|
||||
def register_some_options(cfg=cfg.CONF):
|
||||
cfg.register_opts(SOME_OPTIONS, 'testgroup')
|
||||
|
||||
|
||||
class ConfigDecoratorTestCase(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ConfigDecoratorTestCase, self).setUp()
|
||||
cfg.CONF.register_group(NEW_CONFIG_GROUP)
|
||||
|
||||
def test_no_config_decorator(self):
|
||||
register_some_options()
|
||||
self.assertEqual('default_value', cfg.CONF.testgroup.str_opt)
|
||||
self.assertEqual('1', cfg.CONF.testgroup.int_opt)
|
||||
self.assertTrue(cfg.CONF.testgroup.bool_opt)
|
||||
|
||||
def test_override_variables(self):
|
||||
opts = [('str_opt', 'another_value', 'testgroup'),
|
||||
('int_opt', 123, 'testgroup'),
|
||||
('bool_opt', False, 'testgroup')]
|
||||
cfg_decorator = functional_base.config_decorator(register_some_options,
|
||||
opts)
|
||||
mock.patch('neutron.tests.unit.tests.functional.test_base.'
|
||||
'register_some_options', new=cfg_decorator).start()
|
||||
register_some_options()
|
||||
self.assertEqual('another_value', cfg.CONF.testgroup.str_opt)
|
||||
self.assertEqual('123', cfg.CONF.testgroup.int_opt)
|
||||
self.assertFalse(cfg.CONF.testgroup.bool_opt)
|
Loading…
Reference in New Issue