Skip to content

Commit

Permalink
tests: add a test case for static route propagation
Browse files Browse the repository at this point in the history
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Dec 18, 2024
1 parent e814b00 commit cd3ca5c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/topotests/ospf_metric_propagation/r4/frr.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
!
hostname r4
!
vrf green
ip route 10.48.48.0/24 10.0.94.2
exit

interface r4-eth0
ip address 10.0.3.4/24
ip ospf cost 100
Expand Down Expand Up @@ -59,6 +63,7 @@ router bgp 99 vrf green
address-family ipv4 unicast
redistribute connected
redistribute ospf
redistribute static
import vrf route-map rmap
import vrf default
import vrf blue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,24 @@ def test_all_links_up():
assertmsg = "r1 JSON output mismatches"
assert result is None, assertmsg

def test_static_remote():
"Test static route at R1 configured on R4"
tgen = get_topogen()

if tgen.routers_have_failure():
pytest.skip("skipped because of router(s) failure")

r1 = tgen.gears["r1"]
json_file = "{}/r1/show_ip_route_static.json".format(CWD)
expected = json.loads(open(json_file).read())
test_func = partial(
topotest.router_json_cmp, r1, "show ip route 10.48.48.2 json", expected
)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)

assertmsg = "r1 JSON output mismatches"
assert result is None, assertmsg


def test_link_1_down():
"Test path R1 -> R2 -> Ra -> Rb -> R4"
Expand Down

0 comments on commit cd3ca5c

Please sign in to comment.