neutron/neutron/tests/unit/plugins/ml2/drivers
Rodolfo Alonso Hernandez 233bc1ed11 [OVS] Handle added/removed ports in the same polling iteration
The OVS agent processes the port events in a polling loop. It could
happen (and more frequently in a loaded OVS agent) that the "removed"
and "added" events can happen in the same polling iteration. Because
of this, the same port is detected as "removed" and "added".

When the virtual machine is restarted, the port event sequence is
"removed" and then "added". When both events are captured in the same
iteration, the port is already present in the bridge and the port is
discharted from the "removed" list.

Because the port was removed first and the added, the QoS policies do
not apply anymore (QoS and Queue registers, OF rules). If the QoS
policy does not change, the QoS agent driver will detect it and won't
call the QoS driver methods (based on the OVS agent QoS cache, storing
port and QoS rules). This will lead to an unconfigured port.

This patch solves this issue by detecting this double event and
registering it as "removed_and_added". When the "added" port is
handled, the QoS deletion method is called first (if needed) to remove
the unneded artifacts (OVS registers, OF rules) and remove the QoS
cache (port/QoS policy). Then the QoS policy is applied again on the
port.

NOTE: this is going to be quite difficult to be tested in a fullstack
test.

Conflicts:
      neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py

Change-Id: I51eef168fa8c18a3e4cee57c9ff86046ea9203fd
Closes-Bug: #1845161
(cherry picked from commit 50ffa5173d)
(cherry picked from commit 3eceb6d2ae)
(cherry picked from commit 6376391b45)
(cherry picked from commit ab8ad6f06d)
2020-02-10 17:53:20 +00:00
..
agent consume common constants from lib 2017-10-13 11:45:18 -06:00
l2pop More accurate agent restart state transfer 2019-03-29 22:07:57 +08:00
linuxbridge Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
macvtap Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
mech_sriov SRIOV agent: wait VFs initialization on embedded switch create 2019-06-10 07:13:01 +00:00
openvswitch [OVS] Handle added/removed ports in the same polling iteration 2020-02-10 17:53:20 +00:00
__init__.py Reorganize unit test tree 2015-04-06 23:28:31 +00:00
base_type_tunnel.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
ext_test.py Revert "Revert "objects: get, update and delete converted to Subnet OVO usage"" 2017-12-01 16:45:50 +07:00
mech_fake_agent.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
mech_faulty_agent.py Exit on failure to load mechanism drivers 2017-04-11 09:56:08 -05:00
mechanism_logger.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
mechanism_test.py use ml2 driver api from neutron-lib 2017-11-10 08:41:28 -07:00
test_helpers.py Spin off context module 2017-03-06 16:25:29 +00:00
test_type_flat.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
test_type_geneve.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
test_type_gre.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
test_type_local.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
test_type_vlan.py Fix creation of vlan network with segmentation_id set to 0 2019-09-17 07:00:34 +00:00
test_type_vxlan.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00