diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-04-09 15:23:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-09 15:23:54 +0100 |
| commit | 79f9bb8b6f73c2674891b1d4a768a7b0c4cd0f1e (patch) | |
| tree | 1e757b049a35c6cedaccb9c9ce5e4fbb2a8bb054 /smoketest/scripts/cli/test_protocols_static.py | |
| parent | 570b79e1899f69a320f4aff61402ca4fbb8bab81 (diff) | |
| parent | 3a21052c3167777354a6e4f4bb4a225b1294b3e7 (diff) | |
| download | vyos-1x-79f9bb8b6f73c2674891b1d4a768a7b0c4cd0f1e.tar.gz vyos-1x-79f9bb8b6f73c2674891b1d4a768a7b0c4cd0f1e.zip | |
Merge pull request #5116 from hedrok/T8465-fix_test_protocols_static_vrf
T8465: Fix test_06_dhcp_default_route_for_vrf
Diffstat (limited to 'smoketest/scripts/cli/test_protocols_static.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_static.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/smoketest/scripts/cli/test_protocols_static.py b/smoketest/scripts/cli/test_protocols_static.py index a049020a4..892a46d7b 100755 --- a/smoketest/scripts/cli/test_protocols_static.py +++ b/smoketest/scripts/cli/test_protocols_static.py @@ -648,17 +648,32 @@ class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): self.cli_set(interface_path + ['vrf', vrf]) self.cli_commit() - # Wait for dhclient to receive IP address and default gateway - sleep(5) - router = get_dhcp_router(interface) - frrconfig = self.getFRRconfig(f'vrf {vrf}', stop_section='^exit-vrf') - self.assertIn(rf'ip route 0.0.0.0/0 {router} {interface} tag 210 {default_distance}', frrconfig) + route_str = ( + rf'ip route 0.0.0.0/0 {router} {interface} tag 210 {default_distance}' + ) + + def check_default_route(): + frrconfig = self.getFRRconfig(f'vrf {vrf}', stop_section='^exit-vrf') + if route_str in frrconfig: + return True + return frrconfig + + result, config = self.wait_for_result( + check_default_route, True, pause=1, timeout=10 + ) + # First clean interfaces from VRF so that VRF can be deleted self.cli_delete(interface_path + ['address']) self.cli_delete(interface_path + ['vrf']) self.cli_commit() + # now we can assert + self.assertTrue( + result, + f"Expected '{route_str}' in FRR config, vrf section of FRR config:\n {config}", + ) + # Wait for dhclient to stop while process_named_running('dhclient', cmdline=interface, timeout=10): sleep(0.250) |
