From 1c1f17688216f221abbcb6b2f598d0f5c0e1a877 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Thu, 11 Apr 2019 09:37:46 +0000 Subject: [PATCH] Avoid fullstack QoS tests to handle other test ports In order to isolate the concurrent execution of fullstack QoS tests, the function QosAgentExtension._process_reset_port() is mocked to avoid any port reset created by other test. Change-Id: Ib78098387e90b6c315d3e969004f5786ace8696e Closes-Bug: #1824138 --- neutron/tests/fullstack/agents/ovs_agent.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/neutron/tests/fullstack/agents/ovs_agent.py b/neutron/tests/fullstack/agents/ovs_agent.py index c9147acf3a9..32b440f0c0d 100755 --- a/neutron/tests/fullstack/agents/ovs_agent.py +++ b/neutron/tests/fullstack/agents/ovs_agent.py @@ -19,6 +19,7 @@ import mock from oslo_config import cfg from neutron.agent.common import ovs_lib +from neutron.agent.l2.extensions import qos as qos_extension from neutron.services.trunk.drivers.openvswitch.agent \ import driver as trunk_driver from neutron.tests.common.agents import ovs_agent @@ -38,14 +39,21 @@ def monkeypatch_init_handler(): trunk_driver.init_handler = new_init_handler +def monkeypatch_qos(): + mock.patch.object(ovs_lib.OVSBridge, 'clear_minimum_bandwidth_qos').start() + if "qos" in cfg.CONF.service_plugins: + mock.patch.object(qos_extension.QosAgentExtension, + '_process_reset_port').start() + + def main(): # TODO(slaweq): this monkepatch will not be necessary when # https://review.openstack.org/#/c/506722/ will be merged and ovsdb-server # ovs-vswitchd processes for each test will be isolated in separate # namespace monkeypatch_init_handler() - with mock.patch.object(ovs_lib.OVSBridge, 'clear_minimum_bandwidth_qos'): - ovs_agent.main() + monkeypatch_qos() + ovs_agent.main() if __name__ == "__main__":