From 316b31e304db92d87e63321628be21f9f4cd1387 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 7 Nov 2025 16:41:14 +0100 Subject: smoketest: T7966: perform full regex match with ^ and $ Commit 9775bb49e ("frr: T7664: drop BASH/SED implementation in smoketest getFRRconfig()") changed how we searched strings using a regex. In the past we searched at the beginning of a line ^ till the end $. THis logic was dropped in commit 9775bb49e marking some tests failing as they matched, when they should not match. Example: getFRRconfig('vrf red') showed output for both VRF red and red15 as both started with "red". This has been fixed. --- smoketest/scripts/cli/test_system_ip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'smoketest/scripts/cli/test_system_ip.py') diff --git a/smoketest/scripts/cli/test_system_ip.py b/smoketest/scripts/cli/test_system_ip.py index fadbdec47..3784d4630 100755 --- a/smoketest/scripts/cli/test_system_ip.py +++ b/smoketest/scripts/cli/test_system_ip.py @@ -86,14 +86,16 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase): protocols = ['any', 'babel', 'bgp', 'connected', 'eigrp', 'isis', 'kernel', 'ospf', 'rip', 'static', 'table'] + rule_num = '10' + for protocol in protocols: - self.cli_set(['policy', 'route-map', f'route-map-{protocol}', 'rule', '10', 'action', 'permit']) + self.cli_set(['policy', 'route-map', f'route-map-{protocol}', 'rule', rule_num, 'action', 'permit']) self.cli_set(base_path + ['protocol', protocol, 'route-map', f'route-map-{protocol}']) self.cli_commit() # Verify route-map properly applied to FRR - frrconfig = self.getFRRconfig('ip protocol', stop_section='^end') + frrconfig = self.getFRRconfig('ip protocol', end_marker='', stop_section='^end') for protocol in protocols: self.assertIn(f'ip protocol {protocol} route-map route-map-{protocol}', frrconfig) -- cgit v1.2.3