Skip to content

Commit

Permalink
tests: Check if as-path prepends work with route-maps and default-ori…
Browse files Browse the repository at this point in the history
…ginate

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Jun 22, 2021
1 parent 85d93b1 commit cc54c07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def _bgp_converge(router):

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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ router bgp 65000
!
route-map default permit 10
set metric 123
set as-path prepend 65000 65000 65000
!
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def _bgp_converge(router):

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)
Expand Down

0 comments on commit cc54c07

Please sign in to comment.