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
|
hostname r1
|
||||||
!
|
!
|
||||||
|
vrf green
|
||||||
|
ip route 10.48.48.0/24 10.0.91.2
|
||||||
|
exit
|
||||||
|
!
|
||||||
interface r1-eth0
|
interface r1-eth0
|
||||||
ip address 10.0.1.1/24
|
ip address 10.0.1.1/24
|
||||||
ip ospf cost 100
|
ip ospf cost 100
|
||||||
|
@ -61,6 +65,7 @@ router bgp 99 vrf green
|
||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
redistribute connected
|
redistribute connected
|
||||||
redistribute ospf
|
redistribute ospf
|
||||||
|
redistribute static
|
||||||
import vrf route-map rmap
|
import vrf route-map rmap
|
||||||
import vrf default
|
import vrf default
|
||||||
import vrf blue
|
import vrf blue
|
||||||
|
@ -75,7 +80,7 @@ ip prefix-list min seq 5 permit 10.0.80.0/24
|
||||||
route-map costmax permit 20
|
route-map costmax permit 20
|
||||||
set metric-type type-1
|
set metric-type type-1
|
||||||
set metric +1
|
set metric +1
|
||||||
set metric-min 713
|
set min-metric 713
|
||||||
match ip address prefix-list min
|
match ip address prefix-list min
|
||||||
exit
|
exit
|
||||||
!
|
!
|
||||||
|
@ -83,7 +88,7 @@ ip prefix-list max seq 10 permit 10.0.70.0/24
|
||||||
route-map costplus permit 30
|
route-map costplus permit 30
|
||||||
set metric-type type-1
|
set metric-type type-1
|
||||||
set metric +1
|
set metric +1
|
||||||
set metric-max 13
|
set max-metric 13
|
||||||
match ip address prefix-list max
|
match ip address prefix-list max
|
||||||
exit
|
exit
|
||||||
!
|
!
|
||||||
|
|
|
@ -1,26 +1,5 @@
|
||||||
{
|
{
|
||||||
"10.48.48.0/24":[
|
"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",
|
"prefix":"10.48.48.0/24",
|
||||||
"prefixLen":24,
|
"prefixLen":24,
|
||||||
|
@ -29,18 +8,18 @@
|
||||||
"vrfName":"default",
|
"vrfName":"default",
|
||||||
"selected":true,
|
"selected":true,
|
||||||
"destSelected":true,
|
"destSelected":true,
|
||||||
"distance":20,
|
"distance":1,
|
||||||
"metric":34,
|
"metric":1,
|
||||||
"installed":true,
|
"installed":true,
|
||||||
"table":254,
|
"table":254,
|
||||||
"nexthops":[
|
"nexthops":[
|
||||||
{
|
{
|
||||||
"flags":3,
|
"flags":3,
|
||||||
"fib":true,
|
"fib":true,
|
||||||
"ip":"10.0.10.5",
|
"ip":"10.0.91.2",
|
||||||
"afi":"ipv4",
|
"afi":"ipv4",
|
||||||
"interfaceName":"r1-eth1",
|
"interfaceName":"r1-eth2",
|
||||||
"vrf":"blue",
|
"vrf":"green",
|
||||||
"active":true,
|
"active":true,
|
||||||
"weight":1
|
"weight":1
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
!
|
!
|
||||||
hostname r4
|
hostname r4
|
||||||
!
|
!
|
||||||
vrf green
|
|
||||||
ip route 10.48.48.0/24 10.0.94.2
|
|
||||||
exit
|
|
||||||
|
|
||||||
interface r4-eth0
|
interface r4-eth0
|
||||||
ip address 10.0.3.4/24
|
ip address 10.0.3.4/24
|
||||||
ip ospf cost 100
|
ip ospf cost 100
|
||||||
|
@ -63,7 +59,6 @@ router bgp 99 vrf green
|
||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
redistribute connected
|
redistribute connected
|
||||||
redistribute ospf
|
redistribute ospf
|
||||||
redistribute static
|
|
||||||
import vrf route-map rmap
|
import vrf route-map rmap
|
||||||
import vrf default
|
import vrf default
|
||||||
import vrf blue
|
import vrf blue
|
||||||
|
|
|
@ -190,8 +190,8 @@ def test_all_links_up():
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
|
|
||||||
def test_static_remote():
|
def test_static():
|
||||||
"Test static route at R1 configured on R4"
|
"Test static route at R1 leaked from VRF green"
|
||||||
tgen = get_topogen()
|
tgen = get_topogen()
|
||||||
|
|
||||||
if tgen.routers_have_failure():
|
if tgen.routers_have_failure():
|
||||||
|
@ -201,7 +201,7 @@ def test_static_remote():
|
||||||
json_file = "{}/r1/show_ip_route_static.json".format(CWD)
|
json_file = "{}/r1/show_ip_route_static.json".format(CWD)
|
||||||
expected = json.loads(open(json_file).read())
|
expected = json.loads(open(json_file).read())
|
||||||
test_func = partial(
|
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)
|
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue