]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Check if as-path prepends work with route-maps and default-originate
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 15 Jun 2021 12:49:24 +0000 (15:49 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 29 Jul 2021 12:35:40 +0000 (15:35 +0300)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tests/topotests/bgp_default_route_route_map_match_set/r1/bgpd.conf
tests/topotests/bgp_default_route_route_map_match_set/test_bgp_default-originate_route-map_match_set.py
tests/topotests/bgp_default_route_route_map_set/r1/bgpd.conf
tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py

index 6ef8b1c0f48062b36d8750efcc0ce0a25195bd1a..32ac7c517b7eb2bf4ac8184fe8b46262b16dbe08 100644 (file)
@@ -12,6 +12,7 @@ bgp community-list standard default seq 5 permit 65000:1
 route-map default permit 10
   match community default
   set metric 123
+  set as-path prepend 65000 65000 65000
 !
 route-map internal permit 10
   set community 65000:1
index d9ea5db2789c85194c2ef05360b94a8eb885998e..12d1d01bfb6ea26b7c8516b63b5496ff2d8e9288 100644 (file)
@@ -94,7 +94,9 @@ def test_bgp_default_originate_route_map():
 
     def _bgp_default_route_has_metric(router):
         output = json.loads(router.vtysh_cmd("show ip bgp 0.0.0.0/0 json"))
-        expected = {"paths": [{"metric": 123}]}
+        expected = {
+            "paths": [{"aspath": {"string": "65000 65000 65000 65000"}, "metric": 123}]
+        }
         return topotest.json_cmp(output, expected)
 
     test_func = functools.partial(_bgp_converge, router)
index cb07ea9fdfb4d4b98e7fcada1f863cb824de1949..6f6d39440235fd08b19ad5034fe91188626a697a 100644 (file)
@@ -8,4 +8,5 @@ router bgp 65000
 !
 route-map default permit 10
   set metric 123
+  set as-path prepend 65000 65000 65000
 !
index 9a22c58b16d6da3134f547aaea0e45e29d083ff9..2622c33f5bf9cd4605cd2d37f89a3c73d8c08059 100644 (file)
@@ -93,7 +93,9 @@ def test_bgp_default_originate_route_map():
 
     def _bgp_default_route_has_metric(router):
         output = json.loads(router.vtysh_cmd("show ip bgp 0.0.0.0/0 json"))
-        expected = {"paths": [{"metric": 123}]}
+        expected = {
+            "paths": [{"aspath": {"string": "65000 65000 65000 65000"}, "metric": 123}]
+        }
         return topotest.json_cmp(output, expected)
 
     test_func = functools.partial(_bgp_converge, router)