From f77089aca8a1b6bbabfe11db39d49d7872715d2d Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Sun, 24 Mar 2019 20:44:27 +0000 Subject: [PATCH] Mock OVSBrdge.clear_minimum_bandwidth_qos in fullstack tests This function will not be executed when the OVS agent is started, in order to keep QoS and Queue registers in OVS BD created by other tests. Change-Id: I054510403a4f46544ff78ee2f6babb1247726553 Closes-Bug: #1819125 (cherry picked from commit 531fdc336b1b6b74de1b148b0dfe9eebd9e5cdc3) --- neutron/tests/fullstack/agents/ovs_agent.py | 5 ++++- neutron/tests/fullstack/test_qos.py | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/tests/fullstack/agents/ovs_agent.py b/neutron/tests/fullstack/agents/ovs_agent.py index d8132855876..c9147acf3a9 100755 --- a/neutron/tests/fullstack/agents/ovs_agent.py +++ b/neutron/tests/fullstack/agents/ovs_agent.py @@ -15,8 +15,10 @@ import sys +import mock from oslo_config import cfg +from neutron.agent.common import ovs_lib from neutron.services.trunk.drivers.openvswitch.agent \ import driver as trunk_driver from neutron.tests.common.agents import ovs_agent @@ -42,7 +44,8 @@ def main(): # ovs-vswitchd processes for each test will be isolated in separate # namespace monkeypatch_init_handler() - ovs_agent.main() + with mock.patch.object(ovs_lib.OVSBridge, 'clear_minimum_bandwidth_qos'): + ovs_agent.main() if __name__ == "__main__": diff --git a/neutron/tests/fullstack/test_qos.py b/neutron/tests/fullstack/test_qos.py index dc39d760805..dce99a1488e 100644 --- a/neutron/tests/fullstack/test_qos.py +++ b/neutron/tests/fullstack/test_qos.py @@ -23,7 +23,6 @@ import testscenarios from neutron.agent.common import ovs_lib from neutron.agent.linux import tc_lib from neutron.common import utils -from neutron.tests import base as tests_base from neutron.tests.common.agents import l2_extensions from neutron.tests.fullstack import base from neutron.tests.fullstack.resources import environment @@ -630,7 +629,6 @@ class _TestMinBwQoS(BaseQoSRuleTestCase): rule['qos_policy_id'] = qos_policy_id qos_policy['rules'].append(rule) - @tests_base.unstable_test('bug 1819125') def test_min_bw_qos_policy_rule_lifecycle(self): new_limit = MIN_BANDWIDTH - 100 @@ -680,7 +678,6 @@ class TestMinBwQoSOvs(_TestMinBwQoS, base.BaseFullStackTestCase): self.fail('"%s" direction not implemented' % constants.INGRESS_DIRECTION) - @tests_base.unstable_test('bug 1819125') def test_bw_limit_qos_port_removed(self): """Test if rate limit config is properly removed when whole port is removed.