Skip to content

Commit c5218c9

Browse files
w1ndagshemesh2
authored andcommitted
[bgp-scale-test] Implement bgp scale test cases for sessions flapping, unisolation, nexthop group member change scenarios (sonic-net#16069)
What is the motivation for this PR? With numerous BGP sessions holding a lot routes, any flapping on BGP sessions or routes cloud have more overhead on device, we need test cases to verify the functionality and estimate convergence time, we publish this test plan. How did you do it? Implement sessions flapping test, unisolation test and nexthop group member scale test Signed-off-by: Guy Shemesh <[email protected]>
1 parent 85249dd commit c5218c9

2 files changed

Lines changed: 543 additions & 1 deletion

File tree

ansible/library/announce_routes.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def read_topo(topo_name, path):
150150

151151

152152
def change_routes(action, ptf_ip, port, routes):
153+
logging.debug("action = {}, ptf_ip = {}, port = {}, routes = {}".format(action, ptf_ip, port, routes))
153154
messages = []
154155
for prefix, nexthop, aspath in routes:
155156
if aspath:
@@ -1308,6 +1309,23 @@ def fib_dpu(topo, ptf_ip, action="announce"):
13081309
change_routes(action, ptf_ip, port6, routes_v6)
13091310

13101311

1312+
def adhoc_routes(topo, ptf_ip, peers_routes_to_change, action):
1313+
vms = topo['topology']['VMs']
1314+
1315+
for hostname, routes in peers_routes_to_change.items():
1316+
vm_offset = vms[hostname]['vm_offset']
1317+
port = IPV4_BASE_PORT + vm_offset
1318+
port6 = IPV6_BASE_PORT + vm_offset
1319+
1320+
ipv4_routes = [r for r in routes if '.' in r[0]]
1321+
if ipv4_routes:
1322+
change_routes(action, ptf_ip, port, ipv4_routes)
1323+
1324+
ipv6_routes = [r for r in routes if ':' in r[0]]
1325+
if ipv6_routes:
1326+
change_routes(action, ptf_ip, port6, ipv6_routes)
1327+
1328+
13111329
def get_ipv4_routes(routes):
13121330
return [r for r in routes if ipaddress.ip_network(UNICODE_TYPE(r[0])).version == 4]
13131331

@@ -1345,6 +1363,8 @@ def main():
13451363
default='announce', choices=["announce", "withdraw"]),
13461364
path=dict(required=False, type='str', default=''),
13471365
dut_interfaces=dict(required=False, type='str', default=''),
1366+
adhoc=dict(required=False, type='bool', default=False),
1367+
peers_routes_to_change=dict(required=False, type='dict', default={}),
13481368
log_path=dict(required=False, type='str', default='')
13491369
),
13501370
supports_check_mode=False)
@@ -1357,6 +1377,8 @@ def main():
13571377
action = module.params['action']
13581378
dut_interfaces = module.params['dut_interfaces']
13591379
path = module.params['path']
1380+
adhoc = module.params['adhoc']
1381+
peers_routes_to_change = module.params['peers_routes_to_change']
13601382

13611383
topo = read_topo(topo_name, path)
13621384
if not topo:
@@ -1372,7 +1394,10 @@ def main():
13721394
topo_type = get_topo_type(topo_name)
13731395

13741396
try:
1375-
if topo_type == "t0":
1397+
if adhoc:
1398+
adhoc_routes(topo, ptf_ip, peers_routes_to_change, action)
1399+
module.exit_json(change=True)
1400+
elif topo_type == "t0":
13761401
fib_t0(topo, ptf_ip, no_default_route=is_storage_backend, action=action)
13771402
module.exit_json(changed=True)
13781403
elif topo_type == "t1" or topo_type == "smartswitch-t1":

0 commit comments

Comments
 (0)