Skip to content

Commit 9abe0cb

Browse files
authored
Merge pull request #227 from stackhpc/upstream/2025.1-2025-09-15
Synchronise 2025.1 with upstream
2 parents e2c1c20 + 0c38e52 commit 9abe0cb

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ def _unbind_port_on_dvr_subnet(self, port, lvm):
805805
self.context, self.host, sub_uuid))
806806
local_aap_macs = set()
807807
for lport in local_compute_ports:
808-
if lport.id != port.vif_id:
808+
if lport['id'] != port.vif_id:
809809
local_aap_macs.update({
810810
aap["mac_address"] for aap in lport.get(
811811
"allowed_address_pairs", [])})

neutron/tests/fullstack/test_l3_agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,9 @@ def is_one_host_active_for_router():
566566
netcat_udp.stop_processes()
567567

568568
# With the default advert_int of 2s the keepalived master timeout is
569-
# about 6s. Assert less than 90 lost packets (9 seconds)
570-
threshold = 90
569+
# about 6s. Assert less than 90 lost packets (9 seconds) plus 30 to
570+
# account for CI infrastructure variability
571+
threshold = 120
571572

572573
lost = pinger.sent - pinger.received
573574
message = (f'Sent {pinger.sent} packets, received {pinger.received} '

neutron/tests/functional/agent/l3/test_dvr_router.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from neutron.agent.linux import ip_lib
3333
from neutron.agent.linux import iptables_manager
3434
from neutron.common import utils
35+
from neutron.tests import base as test_base
3536
from neutron.tests.common import l3_test_common
3637
from neutron.tests.common import machine_fixtures
3738
from neutron.tests.common import net_helpers
@@ -2180,6 +2181,7 @@ def test_connection_from_diff_address_scope(self):
21802181
test_machine1.assert_no_ping(test_machine2.ip)
21812182
test_machine2.assert_no_ping(test_machine1.ip)
21822183

2184+
@test_base.unstable_test('bug 2115026')
21832185
def test_fip_connection_for_address_scope(self):
21842186
self.agent.conf.agent_mode = 'dvr_snat'
21852187
(machine_same_scope, machine_diff_scope,

neutron/tests/functional/agent/ovsdb/native/test_connection.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import threading
1717

18+
from oslo_utils import uuidutils
1819
from ovsdbapp import event
1920

2021
from neutron.agent.common import ovs_lib
@@ -25,7 +26,7 @@ class WaitForBridgesEvent(event.RowEvent):
2526
event_name = 'WaitForBridgesEvent'
2627
ONETIME = True
2728

28-
def __init__(self, bridges, timeout=5):
29+
def __init__(self, bridges, timeout=20):
2930
self.bridges_not_seen = set(bridges)
3031
self.timeout = timeout
3132
self.event = threading.Event()
@@ -52,9 +53,17 @@ def _delete_bridges(self, bridges):
5253
self.ovs.delete_bridge(bridge)
5354

5455
def test_create_bridges(self):
55-
bridges_to_monitor = ['br01', 'br02', 'br03']
56-
bridges_to_create = ['br01', 'br02', 'br03', 'br04', 'br05']
56+
bridges_to_create = [
57+
'br_' + uuidutils.generate_uuid()[:12],
58+
'br_' + uuidutils.generate_uuid()[:12],
59+
'br_' + uuidutils.generate_uuid()[:12],
60+
'br_' + uuidutils.generate_uuid()[:12],
61+
'br_' + uuidutils.generate_uuid()[:12],
62+
]
63+
bridges_to_monitor = bridges_to_create[:3]
5764
self.ovs = ovs_lib.BaseOVS()
65+
self._delete_bridges(bridges_to_create)
66+
5867
self.ovs.ovsdb.idl_monitor.start_bridge_monitor(bridges_to_monitor)
5968
self.addCleanup(self._delete_bridges, bridges_to_create)
6069
event = WaitForBridgesEvent(bridges_to_monitor)

neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4083,6 +4083,7 @@ def _test_treat_devices_removed_for_dvr(
40834083
self, device_owner, ip_version=n_const.IP_VERSION_4, aaps=False):
40844084
self._setup_for_dvr_test()
40854085
port_obj = {"id": "fake-port-uuid"}
4086+
local_port_obj = {"id": "fake-port-uuid"}
40864087
aap_mac = 'aa:bb:cc:dd:ee:ff'
40874088
aap_mac2 = 'aa:bb:cc:dd:ee:fe'
40884089
aap_mac3 = 'aa:bb:cc:dd:ee:fd'
@@ -4107,7 +4108,7 @@ def _test_treat_devices_removed_for_dvr(
41074108
'mac_address': aap_mac},
41084109
{'ip_address': '2001:100::11',
41094110
'mac_address': aap_mac2},
4110-
{'ip_address': '2001:100::0/0',
4111+
{'ip_address': '::/0',
41114112
'mac_address': aap_mac3}
41124113
]
41134114
self._port.dvr_mac = self.agent.dvr_agent.dvr_mac_address
@@ -4185,6 +4186,9 @@ def _test_treat_devices_removed_for_dvr(
41854186
self._compute_port.vif_id],
41864187
'failed_devices_up': [],
41874188
'failed_devices_down': []}),\
4189+
mock.patch.object(self.agent.dvr_agent.plugin_rpc,
4190+
'get_ports_on_host_by_subnet',
4191+
return_value=[local_port_obj]),\
41884192
mock.patch.object(self.agent.dvr_agent.plugin_rpc,
41894193
'get_ports',
41904194
return_value=[port_obj]),\
@@ -4223,6 +4227,11 @@ def test_treat_devices_removed_for_dvr_with_compute_ports(self):
42234227
device_owner=DEVICE_OWNER_COMPUTE)
42244228
self._test_treat_devices_removed_for_dvr(
42254229
device_owner=DEVICE_OWNER_COMPUTE, ip_version=n_const.IP_VERSION_6)
4230+
self._test_treat_devices_removed_for_dvr(
4231+
device_owner=DEVICE_OWNER_COMPUTE, aaps=True)
4232+
self._test_treat_devices_removed_for_dvr(
4233+
device_owner=DEVICE_OWNER_COMPUTE, ip_version=n_const.IP_VERSION_6,
4234+
aaps=True)
42264235

42274236
def test_treat_devices_removed_for_dvr_with_dhcp_ports(self):
42284237
self._test_treat_devices_removed_for_dvr(

0 commit comments

Comments
 (0)