From 1d9cf31e849b862063200309734bab6620f57f1d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 8 May 2021 21:21:21 +0200 Subject: vrf: bgp: T3523: bugfix Kernel route-map deployment Commit 4f9aa30f ("vrf: bgp: T3523: add route-map support for kernel routes") added the possibility to also filter BGP routes towards the OS kernel, but the smoketests failed. Reason was a non working CLI command applied to bgpd. Thus the VRF route-map and the BGP configuration is now split into two templates, one to be used for each daemon (zebra and bgpd). Nevertheless one more bug was found in vyos.frr which currently does not suppoort calling modify_section() inside a configuration "block". See [1] for more info. [1]: https://phabricator.vyos.net/T3529 --- smoketest/scripts/cli/test_protocols_bgp.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'smoketest') diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index 08697eebf..0ed66657c 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -144,6 +144,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): def tearDown(self): self.cli_delete(['policy']) + self.cli_delete(['vrf']) self.cli_delete(base_path) self.cli_commit() @@ -624,6 +625,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): self.cli_set(vrf_base + ['table', table]) self.cli_set(vrf_base + ['protocols', 'bgp', 'local-as', ASN]) self.cli_set(vrf_base + ['protocols', 'bgp', 'parameters', 'router-id', router_id]) + self.cli_set(vrf_base + ['protocols', 'bgp', 'route-map', route_map_in]) table = str(int(table) + 1000) self.cli_commit() @@ -631,9 +633,16 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase): for vrf in vrfs: # Verify FRR bgpd configuration frrconfig = self.getFRRconfig(f'router bgp {ASN} vrf {vrf}') - self.assertIn(f'router bgp {ASN} vrf {vrf}', frrconfig) self.assertIn(f' bgp router-id {router_id}', frrconfig) + # CCC: Currently this is not working as FRR() class does not support + # route-maps for multiple vrfs because the modify_section() only works + # on lines and not text blocks. + # + # vrfconfig = self.getFRRconfig(f'vrf {vrf}') + # zebra_route_map = f' ip protocol bgp route-map {route_map_in}' + # self.assertIn(zebra_route_map, vrfconfig) + if __name__ == '__main__': unittest.main(verbosity=2) \ No newline at end of file -- cgit v1.2.3