From ce29a2dc6f446596d2fa9fb5015b706f689f4926 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Wed, 24 Sep 2025 11:11:15 +0200 Subject: [PATCH] Adapt class OvnUnsupportedDhcpOptionReader to typo fixed in neutron test_extra_dhcp_opts_logs_unsupported_options started failing after https://review.opendev.org/961725 was merged. Due to backward compatibility, the test should support neutron code pre and post that patch. Change-Id: Ifecad8e65070fcf76a7bf4fc37aa4df87b3f7ddd Signed-off-by: Eduardo Olivares --- tobiko/openstack/neutron/neutron_log_reader.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tobiko/openstack/neutron/neutron_log_reader.py b/tobiko/openstack/neutron/neutron_log_reader.py index 18f811f3b..53b48d554 100644 --- a/tobiko/openstack/neutron/neutron_log_reader.py +++ b/tobiko/openstack/neutron/neutron_log_reader.py @@ -134,16 +134,23 @@ class UnsupportedDhcpOptionMessage(typing.NamedTuple): @_agent.skip_unless_is_ovn() class OvnUnsupportedDhcpOptionReader(NeutronNovaCommonReader): groups = ['controller'] - message_pattern = ( - 'The DHCP option .* on port .* is not suppported by OVN, ignoring it') + # TODO(eolivare): remove the "(pp|ppp)" part, which is needed for + # backward compatibility with neutron versions without: + # https://review.opendev.org/961725 + message_pattern = ('The DHCP option .* on port .* is not ' + 'su(pp|ppp)orted by OVN, ignoring it') responses: tobiko.Selection[UnsupportedDhcpOptionMessage] + # NOTE: this method is too dependent on messages from neutron code, which + # could change (as it has happened with https://review.opendev.org/961725) + # but it is hard to do something different when tests have to check + # expected log messages def read_responses(self) \ -> tobiko.Selection[UnsupportedDhcpOptionMessage]: # pylint: disable=no-member def _get_port_uuid(line): - port_pattern = 'on port (.*) is not suppported by OVN' - return re.findall(port_pattern, line)[0] + port_pattern = 'on port (.*) is not su(pp|ppp)orted by OVN' + return re.findall(port_pattern, line)[0][0] def _get_dhcp_option(line): dhcp_opt_pattern = 'The DHCP option (.*) on port'