Browse Source

Fix Tempest and Unit tests

This patch is a squash of two commits that fix both tempest and
unit tests:

1. Port Groups: Fix bug when updating a port to trusted

When a normal port with port security enabled (ie. belonging to
default drop Port Group) gets updated to a trusted port (ie.
router port), the existing code won't remove the port from the
Port Group so all traffic gets dropped.

This patch fixes the issue by checking this condition in the
update_port method of the ovn_client module.

2. UT: Fix unit tests failures

After 3316b45665 got merged in
Neutron, our gate is blocked due to unit tests failing.
After some debugging, it looks like no longer importing
neutron.db.api is the culprit. This patch is importing it
from our unit tests to unbreak the gate while the actual
root case is determined.

Change-Id: I3d30ec18f0c9df256c8f5846b52ab619835b5e32
Closes-Bug: #1802373
Partial-Bug: #1802369
Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
Daniel Alvarez 6 months ago
parent
commit
605ad27f05

+ 5
- 3
networking_ovn/common/ovn_client.py View File

@@ -453,9 +453,11 @@ class OVNClient(object):
453 453
                         utils.is_port_security_enabled(port)):
454 454
                     self._add_port_to_drop_port_group(port['id'], txn)
455 455
                 # If the port doesn't belong to any security group and
456
-                # port_security is disabled, allow all traffic
457
-                elif (not new_sg_ids and
458
-                      not utils.is_port_security_enabled(port)):
456
+                # port_security is disabled, or it's a trusted port, then
457
+                # allow all traffic.
458
+                elif ((not new_sg_ids and
459
+                      not utils.is_port_security_enabled(port)) or
460
+                      utils.is_lsp_trusted(port)):
459 461
                     self._del_port_from_drop_port_group(port['id'], txn)
460 462
             else:
461 463
                 # Refresh ACLs for changed security groups or fixed IPs.

+ 1
- 0
networking_ovn/tests/unit/ml2/test_mech_driver.py View File

@@ -34,6 +34,7 @@ from oslo_db import exception as os_db_exc
34 34
 from oslo_serialization import jsonutils
35 35
 from oslo_utils import timeutils
36 36
 
37
+from neutron.db import api  # noqa
37 38
 from neutron.db import provisioning_blocks
38 39
 from neutron.plugins.ml2.drivers import type_geneve  # noqa
39 40
 from neutron.tests import tools

Loading…
Cancel
Save