Skip to content

Commit ae05e01

Browse files
committed
Use (optional) reduced OSPF timers in BGP integration tests
This change tries to use the short OSPF timers in BGP integration tests (guarded with _adjust entry that checks the device capability) and can reduce the runtime of an integration test by ~10 seconds.
1 parent 8338e80 commit ae05e01

File tree

6 files changed

+63
-9
lines changed

6 files changed

+63
-9
lines changed

tests/integration/bgp/02-ibgp-ebgp-session.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ message: |
44
and next-hop-self on IBGP sessions.
55
66
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
7+
defaults.paths.prepend.plugin: [ "topology:../plugin" ]
78

89
module: [ bgp, ospf ]
9-
plugin: [ bgp.session ]
10+
plugin: [ bgp.session, adjust_test ]
11+
12+
bgp.as: 65000
13+
ospf.timers.hello: 1
14+
ospf.timers.dead: 3
1015

11-
defaults.bgp.as: 65000
1216
defaults.interfaces.mtu: 1500
1317

18+
_adjust:
19+
- nodes: [ dut ]
20+
features: [ ospf.timers ]
21+
remove:
22+
- nodes:ospf.timers
23+
1424
groups:
1525
probes:
1626
device: frr

tests/integration/bgp/03-ibgp-rr.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@ message: |
55
reflected route).
66
77
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
8+
defaults.paths.prepend.plugin: [ "topology:../plugin" ]
89

910
module: [ bgp, ospf ]
10-
plugin: [ bgp.session ]
11+
plugin: [ bgp.session, adjust_test ]
1112

1213
groups:
1314
probes:
1415
members: [ r1, r2, rr2, x1 ]
1516
device: frr
1617
provider: clab
1718

18-
defaults.bgp.as: 65000
19+
bgp.as: 65000
20+
ospf.timers.hello: 1
21+
ospf.timers.dead: 3
22+
23+
_adjust:
24+
- nodes: [ dut ]
25+
features: [ ospf.timers ]
26+
remove:
27+
- nodes:ospf.timers
28+
1929
defaults.interfaces.mtu: 1500
2030

2131
nodes:

tests/integration/bgp/04-originate.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ groups:
1515
provider: clab
1616
members: [ x1, x2, r1 ]
1717

18-
defaults.bgp.as: 65000
18+
bgp.as: 65000
19+
ospf.timers.hello: 1
20+
ospf.timers.dead: 3
21+
1922
defaults.interfaces.mtu: 1500
2023

2124
prefix:
@@ -64,6 +67,10 @@ _adjust:
6467
remove:
6568
- nodes.dut.bgp.advertise
6669
- validate.adv_ipv4
70+
- nodes: [ dut ]
71+
features: [ ospf.timers ]
72+
remove:
73+
- nodes:ospf.timers
6774

6875
validate:
6976
ospf_adj:

tests/integration/bgp/05-community.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ message: |
99
one, an extended one, and a long one (standard communitiy using 4-octet AS)
1010
1111
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
12-
plugin: [ files ]
12+
defaults.paths.prepend.plugin: [ "topology:../plugin" ]
13+
plugin: [ files, adjust_test ]
1314

1415
module: [ bgp, ospf ]
1516

@@ -19,9 +20,18 @@ groups:
1920
device: frr
2021
provider: clab
2122

22-
defaults.bgp.as: 65000
23+
bgp.as: 65000
24+
ospf.timers.hello: 1
25+
ospf.timers.dead: 3
26+
2327
defaults.interfaces.mtu: 1500
2428

29+
_adjust:
30+
- nodes: [ dut ]
31+
features: [ ospf.timers ]
32+
remove:
33+
- nodes:ospf.timers
34+
2535
nodes:
2636
dut:
2737
bgp.rr: True

tests/integration/bgp/08-ibgp-localas.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ message: |
1111
local-as IBGP neighbor.
1212
1313
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
14+
defaults.paths.prepend.plugin: [ "topology:../plugin" ]
15+
plugin: [ adjust_test ]
1416

1517
module: [ bgp, ospf ]
1618

@@ -23,7 +25,16 @@ groups:
2325
members: [ x1 ]
2426
module: [ bgp ]
2527

26-
defaults.bgp.as: 65000
28+
bgp.as: 65000
29+
ospf.timers.hello: 1
30+
ospf.timers.dead: 3
31+
32+
_adjust:
33+
- nodes: [ dut ]
34+
features: [ ospf.timers ]
35+
remove:
36+
- nodes:ospf.timers
37+
2738
defaults.interfaces.mtu: 1500
2839

2940
nodes:

tests/integration/plugin/adjust_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ def adjust_topology(a_entry: Box, topology: Box) -> None:
108108

109109
for rm_item in get_a_list(a_entry,'remove'):
110110
log.print_verbose(f'Removing {rm_item}')
111-
topology.pop(rm_item,None)
111+
if ":" not in rm_item:
112+
topology.pop(rm_item,None)
113+
continue
114+
115+
(object,item) = rm_item.split(":",1)
116+
for data in topology.get(object,{}).values():
117+
data.pop(item,None)
112118

113119
for rp_item in get_a_list(a_entry,'replace'):
114120
rp_key = rp_item.get('key',None)

0 commit comments

Comments
 (0)