diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-11-07 16:41:14 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-11-07 16:41:14 +0100 |
| commit | 316b31e304db92d87e63321628be21f9f4cd1387 (patch) | |
| tree | 6aed31cf9f7c58a7603069e69854b3e3dc146959 /smoketest/scripts/cli/test_protocols_static.py | |
| parent | da679f0cf8fe048bae7d648a4f447db47032f3c0 (diff) | |
| download | vyos-1x-316b31e304db92d87e63321628be21f9f4cd1387.tar.gz vyos-1x-316b31e304db92d87e63321628be21f9f4cd1387.zip | |
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.
Diffstat (limited to 'smoketest/scripts/cli/test_protocols_static.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_static.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/smoketest/scripts/cli/test_protocols_static.py b/smoketest/scripts/cli/test_protocols_static.py index 77a45e333..017618cbb 100755 --- a/smoketest/scripts/cli/test_protocols_static.py +++ b/smoketest/scripts/cli/test_protocols_static.py @@ -254,7 +254,7 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.cli_commit() # Verify FRR bgpd configuration - frrconfig = self.getFRRconfig('ip route') + frrconfig = self.getFRRconfig('ip route', end_marker='') # Verify routes for route, route_config in routes.items(): @@ -368,7 +368,7 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.cli_commit() # Verify FRR bgpd configuration - frrconfig = self.getFRRconfig('ip route') + frrconfig = self.getFRRconfig('ip route', end_marker='') for table in tables: # Verify routes @@ -558,7 +558,7 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.cli_commit() # Verify FRR configuration - frrconfig = self.getFRRconfig('ip mroute') + frrconfig = self.getFRRconfig('ip mroute', end_marker='') for route, route_config in multicast_routes.items(): if 'next_hop' in route_config: for next_hop, next_hop_config in route_config['next_hop'].items(): @@ -712,15 +712,12 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.assertIsNotNone(router, 'DHCP router should be available') # Verify FRR configuration contains the static routes with DHCP router - frrconfig = self.getFRRconfig('ip route') + frrconfig = self.getFRRconfig('ip route', end_marker='') for route in dhcp_routes.keys(): expected_route = f'ip route {route} {router} {dhcp_interface}' - self.assertIn( - expected_route, - frrconfig, - f'Static route {route} with dhcp-interface should be in FRR config', - ) + self.assertIn(expected_route, frrconfig, f'Static route {route} '\ + 'with dhcp-interface should be in FRR config') # Test table-based routes with dhcp-interface table_id = '100' @@ -730,7 +727,7 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.cli_commit() # Verify table route in FRR config - frrconfig = self.getFRRconfig('ip route') + frrconfig = self.getFRRconfig('ip route', end_marker='') expected_table_route = ( f'ip route {table_route} {router} {dhcp_interface} table {table_id}' ) |
