]> git.proxmox.com Git - mirror_frr.git/blame - tests/topotests/bgp_vrf_netns/peer1/exa-send.py
tests: Run python formatter (black) for topotests
[mirror_frr.git] / tests / topotests / bgp_vrf_netns / peer1 / exa-send.py
CommitLineData
12919c42
PG
1#!/usr/bin/env python
2
3"""
4exa-send.py: Send a few testroutes with ExaBGP
5"""
6
787e7624 7from sys import stdout, argv
12919c42
PG
8from time import sleep
9
10sleep(5)
11
12# 1st arg is peer number
13# 2nd arg is number of routes to send
14peer = int(argv[1])
15numRoutes = int(argv[2])
16asnum = 99
17
18# Announce numRoutes equal routes per PE - different neighbor AS
19for i in range(0, numRoutes):
787e7624 20 stdout.write(
21 "announce route 10.201.%s.0/24 med 100 community %i:1 next-hop 10.0.%i.%i\n"
22 % (i, i, (((peer - 1) / 5) + 1), peer + 100)
23 )
12919c42
PG
24 stdout.flush()
25
787e7624 26# Loop endlessly to allow ExaBGP to continue running
12919c42
PG
27while True:
28 sleep(1)