diff --git a/tox.ini b/tox.ini index d4a209bc..d63a5b63 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,8 @@ envlist = py3,pep8,docs,releasenotes,cover [testenv] usedevelop = True setenv = +passenv = + OS_VIF_CHECK_PARAMETER_TIMEOUT deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt diff --git a/vif_plug_ovs/tests/functional/base.py b/vif_plug_ovs/tests/functional/base.py index 59eb5415..4ad5f360 100644 --- a/vif_plug_ovs/tests/functional/base.py +++ b/vif_plug_ovs/tests/functional/base.py @@ -9,6 +9,8 @@ # 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 functools +import os from os_vif.tests.functional import base as os_vif_base @@ -28,6 +30,10 @@ class VifPlugOvsBaseFunctionalTestCase(os_vif_base.BaseFunctionalTestCase): def _check_port(self, name, bridge): return self.ovs.port_exists(name, bridge) + @functools.cache + def _get_timeout(self): + return int(os.environ.get('OS_VIF_CHECK_PARAMETER_TIMEOUT', '10')) + def _check_parameter(self, table, port, parameter, expected_value): def get_value(): return self._ovsdb.db_get(table, port, parameter).execute() @@ -36,7 +42,8 @@ class VifPlugOvsBaseFunctionalTestCase(os_vif_base.BaseFunctionalTestCase): val = get_value() return val == expected_value self.assertTrue( - wait_until_true(check_value, timeout=2, sleep=0.5), + wait_until_true( + check_value, timeout=self._get_timeout(), sleep=0.5), f"Parameter {parameter} of {table} {port} is {get_value()} " f"not {expected_value}" ) diff --git a/vif_plug_ovs/tests/functional/ovsdb/test_ovsdb_lib.py b/vif_plug_ovs/tests/functional/ovsdb/test_ovsdb_lib.py index 5b8d8b3d..ab10ca5e 100644 --- a/vif_plug_ovs/tests/functional/ovsdb/test_ovsdb_lib.py +++ b/vif_plug_ovs/tests/functional/ovsdb/test_ovsdb_lib.py @@ -183,6 +183,11 @@ class TestOVSDBLib(testscenarios.WithScenarios, 'Interface', port_bridge_port, 'options', port_opts) def test_create_ovs_vif_port_with_default_qos(self): + if self.interface == 'native': + self.skipTest( + 'test_create_ovs_vif_port_with_default_qos is unstable ' + 'when run with the native driver, see: ' + 'https://bugs.launchpad.net/os-vif/+bug/2087982') port_name = 'qos-port-' + self.interface iface_id = 'iface_id' mac = 'ca:fe:ca:fe:ca:fe'