diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-09-11 09:29:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-11 09:29:36 -0500 |
| commit | b3daa156d016b57b65a4b5f2fb93fd0c3b168217 (patch) | |
| tree | 994ea586ff5f47c571c5dfe52781de26427580c4 /smoketest/scripts/cli | |
| parent | 7a1f2e22c2460299ce75d41b21baff92ba1d96a5 (diff) | |
| parent | cb91488db79634f7c1759a841defdf60c3dcf42c (diff) | |
| download | vyos-1x-b3daa156d016b57b65a4b5f2fb93fd0c3b168217.tar.gz vyos-1x-b3daa156d016b57b65a4b5f2fb93fd0c3b168217.zip | |
Merge pull request #4704 from hedrok/T7297-fix-ospf-redistribute-table
ospf: T7297: fix redistribute-table
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_protocols_ospf.py | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 7a0f087e1..292625afc 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -255,12 +255,26 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): def test_ospf_07_redistribute(self): metric = '15' metric_type = '1' - redistribute = ['babel', 'bgp', 'connected', 'isis', 'kernel', 'nhrp', 'rip', 'static'] + table_id = '21' + redistribute = [ + 'babel', + 'bgp', + 'connected', + 'isis', + 'kernel', + 'nhrp', + 'rip', + 'static', + 'table', + ] for protocol in redistribute: - self.cli_set(base_path + ['redistribute', protocol, 'metric', metric]) - self.cli_set(base_path + ['redistribute', protocol, 'route-map', route_map]) - self.cli_set(base_path + ['redistribute', protocol, 'metric-type', metric_type]) + redistr_base = base_path + ['redistribute', protocol] + if protocol == 'table': + redistr_base += [table_id] + self.cli_set(redistr_base + ['metric', metric]) + self.cli_set(redistr_base + ['route-map', route_map]) + self.cli_set(redistr_base + ['metric-type', metric_type]) # commit changes self.cli_commit() @@ -269,7 +283,14 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): frrconfig = self.getFRRconfig('router ospf', endsection='^exit') self.assertIn(f'router ospf', frrconfig) for protocol in redistribute: - self.assertIn(f' redistribute {protocol} metric {metric} metric-type {metric_type} route-map {route_map}', frrconfig) + if protocol == 'table': + protocolstr = f'table-direct {table_id}' + else: + protocolstr = protocol + self.assertIn( + f' redistribute {protocolstr} metric {metric} metric-type {metric_type} route-map {route_map}', + frrconfig, + ) def test_ospf_08_virtual_link(self): networks = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'] |
