diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-04-11 19:36:17 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-04-12 21:16:19 +0200 |
commit | 262d119196c4366f5f330fffe85ac7399b13db7a (patch) | |
tree | f9ae5dafd19d5a99e183f9e43b178cc8bfd58a30 /smoketest/scripts/cli/test_protocols_static.py | |
parent | 5d9238f1d7f8d19893537a8076031903e8fea271 (diff) | |
download | vyos-1x-262d119196c4366f5f330fffe85ac7399b13db7a.tar.gz vyos-1x-262d119196c4366f5f330fffe85ac7399b13db7a.zip |
static: T3328: route-map to zebra/kernel can not be removed
Removing the Zebra/Linux Kernel route-map added by "set protocols static route-map"
was not removed once applied. This was because the removal must happen within
the zebra daemon and not staticd.
Diffstat (limited to 'smoketest/scripts/cli/test_protocols_static.py')
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_static.py | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_protocols_static.py b/smoketest/scripts/cli/test_protocols_static.py index 75d3e6a42..0d3228cc7 100755 --- a/smoketest/scripts/cli/test_protocols_static.py +++ b/smoketest/scripts/cli/test_protocols_static.py @@ -82,7 +82,7 @@ routes = { tables = ['80', '81', '82'] -class StaticRouteTest(VyOSUnitTestSHIM.TestCase): +class TestProtocolsStatic(VyOSUnitTestSHIM.TestCase): def setUp(self): # This is our "target" VRF when leaking routes: self.cli_set(['vrf', 'name', 'black', 'table', '43210']) @@ -100,7 +100,7 @@ class StaticRouteTest(VyOSUnitTestSHIM.TestCase): tmp = self.getFRRconfig('', end='') self.cli_commit() - def test_protocols_static(self): + def test_01_static(self): for route, route_config in routes.items(): route_type = 'route' if is_ipv6(route): @@ -187,7 +187,7 @@ class StaticRouteTest(VyOSUnitTestSHIM.TestCase): self.assertIn(tmp, frrconfig) - def test_protocols_static_table(self): + def test_02_static_table(self): for table in tables: for route, route_config in routes.items(): route_type = 'route' @@ -281,7 +281,7 @@ class StaticRouteTest(VyOSUnitTestSHIM.TestCase): self.assertIn(tmp, frrconfig) - def test_protocols_vrf_static(self): + def test_03_static_vrf(self): # Create VRF instances and apply the static routes from above to FRR. # Re-read the configured routes and match them if they are programmed # properly. This also includes VRF leaking @@ -392,5 +392,31 @@ class StaticRouteTest(VyOSUnitTestSHIM.TestCase): self.cli_delete(['vrf']) + def test_04_static_zebra_route_map(self): + # Implemented because of T3328 + self.debug = True + route_map = 'foo-static-in' + self.cli_set(['policy', 'route-map', route_map, 'rule', '10', 'action', 'permit']) + + self.cli_set(base_path + ['route-map', route_map]) + # commit changes + self.cli_commit() + + # Verify FRR configuration + zebra_route_map = f'ip protocol static route-map {route_map}' + frrconfig = self.getFRRconfig(zebra_route_map) + self.assertIn(zebra_route_map, frrconfig) + + # Remove the route-map again + self.cli_delete(base_path + ['route-map']) + # commit changes + self.cli_commit() + + # Verify FRR configuration + frrconfig = self.getFRRconfig(zebra_route_map) + self.assertNotIn(zebra_route_map, frrconfig) + + self.cli_delete(['policy', 'route-map', route_map]) + if __name__ == '__main__': unittest.main(verbosity=2) |