Skip to content

Commit

Permalink
Merge pull request #16363 from Jafaral/fix-metric-prop
Browse files Browse the repository at this point in the history
tests: tweak timers to avoid frequent failures on slow CI hardware
  • Loading branch information
ton31337 authored Jul 14, 2024
2 parents 5203914 + ad7a1f9 commit 701c3d6
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 134 deletions.
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/r1/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ interface r1-eth0
ip address 10.0.1.1/24
ip ospf cost 100
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r1-eth1 vrf blue
ip address 10.0.10.1/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
!
interface r1-eth2 vrf green
ip address 10.0.91.1/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
!
router ospf
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":34,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.10.5",
"afi":"ipv4",
"interfaceName":"r1-eth1",
"vrf":"blue",
"active":true,
"weight":1
"vrf":"blue"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":136,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"r1-eth0",
"vrf":"default",
"active":true,
"weight":1
"vrf":"default"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":1138,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"r1-eth0",
"vrf":"default",
"active":true,
"weight":1
"vrf":"default"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":1218,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"r1-eth0",
"vrf":"default",
"active":true,
"weight":1
"vrf":"default"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":238,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"r1-eth0",
"vrf":"default",
"active":true,
"weight":1
"vrf":"default"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions tests/topotests/ospf_metric_propagation/r1/show_ip_route-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@
"10.0.94.0/24":[
{
"prefix":"10.0.94.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfName":"green",
"selected":true,
"destSelected":true,
"distance":20,
"metric":136,
"installed":true,
"table":12,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthopGroupId":"*",
"installedNexthopGroupId":"*",
"uptime":"*",
"nexthops":[
{
"flags":3,
"fib":true,
"ip":"10.0.10.5",
"afi":"ipv4",
"interfaceName":"r1-eth1",
"vrf":"blue",
"active":true,
"weight":1
"vrf":"blue"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/r2/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ interface r2-eth0
ip address 10.0.1.2/24
ip ospf cost 100
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r2-eth1 vrf blue
ip address 10.0.20.2/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r2-eth2 vrf green
ip address 10.0.70.2/24
ip ospf cost 1000
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.2
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/r3/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ interface r3-eth0
ip address 10.0.3.3/24
ip ospf cost 100
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r3-eth1 vrf blue
ip address 10.0.30.3/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r3-eth2 vrf green
ip address 10.0.80.3/24
ip ospf cost 1000
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.3
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/r4/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ interface r4-eth0
ip address 10.0.3.4/24
ip ospf cost 100
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r4-eth1 vrf blue
ip address 10.0.40.4/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface r4-eth2 vrf green
ip address 10.0.94.4/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.4
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/ra/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ ip forwarding
interface ra-eth0
ip address 10.0.50.5/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface ra-eth1
ip address 10.0.10.5/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface ra-eth2
ip address 10.0.20.5/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.5
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/ospf_metric_propagation/rb/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ ip forwarding
interface rb-eth0
ip address 10.0.50.6/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface rb-eth1
ip address 10.0.30.6/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface rb-eth2
ip address 10.0.40.6/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.6
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/ospf_metric_propagation/rc/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ ip forwarding
interface rc-eth0
ip address 10.0.70.7/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
interface rc-eth1
ip address 10.0.80.7/24
ip ospf hello-interval 1
ip ospf dead-interval 30
ip ospf dead-interval 40
!
router ospf
ospf router-id 10.0.255.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def test_link_1_2_3_4_down():
assert result is None, assertmsg


def test_link_1_2_4_down():
def test_link_1_2_4_down_3_up():
"Test path R1 -> R2 -> Rc -> R3 -> R4"
tgen = get_topogen()

Expand All @@ -304,7 +304,7 @@ def test_link_1_2_4_down():
assert result is None, assertmsg


def test_link_1_4_down():
def test_link_1_4_down_2_up():
"Test path R1 -> R2 -> Ra -> Rb -> R3 -> R4"
tgen = get_topogen()

Expand All @@ -320,13 +320,13 @@ def test_link_1_4_down():
test_func = partial(
topotest.router_json_cmp, r1, "show ip route vrf green 10.0.94.2 json", expected
)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
_, result = topotest.run_and_expect(test_func, None, count=120, wait=2)

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


def test_link_4_down():
def test_link_4_down_1_up():
"Test path R1 -> Ra -> Rb -> R3 -> R4"
tgen = get_topogen()

Expand All @@ -342,7 +342,7 @@ def test_link_4_down():
test_func = partial(
topotest.router_json_cmp, r1, "show ip route vrf green 10.0.94.2 json", expected
)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
_, result = topotest.run_and_expect(test_func, None, count=120, wait=2)

assertmsg = "r1 JSON output mismatches"
assert result is None, assertmsg
Expand All @@ -364,7 +364,7 @@ def test_link_1_2_3_4_up():
test_func = partial(
topotest.router_json_cmp, r1, "show ip route vrf green 10.0.94.2 json", expected
)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
_, result = topotest.run_and_expect(test_func, None, count=120, wait=2)

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

0 comments on commit 701c3d6

Please sign in to comment.