forked from Mirror/frr
Merge pull request #17829 from Jafaral/static-metric
tests: avoid nondeterministic route
This commit is contained in:
commit
a962ff7833
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -75,7 +80,7 @@ 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
|
||||
!
|
||||
|
@ -83,7 +88,7 @@ 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
|
||||
!
|
||||
|
|
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue