Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: avoid nondeterministic route #17829

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/topotests/ospf_metric_propagation/r1/frr.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
!
hostname r1
!
vrf green
ip route 10.48.48.0/24 10.0.91.2
exit
!
interface r1-eth0
ip address 10.0.1.1/24
ip ospf cost 100
Expand Down Expand Up @@ -61,6 +65,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 All @@ -75,15 +80,15 @@ ip prefix-list min seq 5 permit 10.0.80.0/24
route-map costmax permit 20
set metric-type type-1
set metric +1
set metric-min 713
set min-metric 713
match ip address prefix-list min
exit
!
ip prefix-list max seq 10 permit 10.0.70.0/24
route-map costplus permit 30
set metric-type type-1
set metric +1
set metric-max 13
set max-metric 13
match ip address prefix-list max
exit
!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
{
"10.48.48.0/24":[
{
"prefix":"10.48.48.0/24",
"prefixLen":24,
"protocol":"ospf",
"vrfId":0,
"vrfName":"default",
"distance":20,
"metric":134,
"table":254,
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"r1-eth0",
"active":true,
"weight":1
}
]
},
{
"prefix":"10.48.48.0/24",
"prefixLen":24,
Expand All @@ -29,18 +8,18 @@
"vrfName":"default",
"selected":true,
"destSelected":true,
"distance":20,
"metric":34,
"distance":1,
"metric":1,
"installed":true,
"table":254,
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.10.5",
"ip":"10.0.91.2",
"afi":"ipv4",
"interfaceName":"r1-eth1",
"vrf":"blue",
"interfaceName":"r1-eth2",
"vrf":"green",
"active":true,
"weight":1
}
Expand Down
5 changes: 0 additions & 5 deletions tests/topotests/ospf_metric_propagation/r4/frr.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
!
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 @@ -63,7 +59,6 @@ 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 @@ -190,8 +190,8 @@ def test_all_links_up():
assert result is None, assertmsg


def test_static_remote():
"Test static route at R1 configured on R4"
def test_static():
"Test static route at R1 leaked from VRF green"
tgen = get_topogen()

if tgen.routers_have_failure():
Expand All @@ -201,7 +201,7 @@ def test_static_remote():
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
topotest.router_json_cmp, r1, "show ip route 10.48.48.0/24 json", expected
)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)

Expand Down
Loading