summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2018-11-29 15:29:08 +0100
committerGitHub <noreply@github.com>2018-11-29 15:29:08 +0100
commitf2ce6a57a86a87b2d38fd5e01bc4ddff3c055005 (patch)
treec3d881be5c70f643269704c6d3a7b626ae589b5d /tests/topotests/bgp_multiview_topo1/peer3/exa-send.py
parentd5215d5e169957de399334c2150116ca2fbd0d63 (diff)
parent096694da4793bfc199b1a3698b932d0b59de6956 (diff)
Merge pull request #3384 from donaldsharp/topotests
Topotests
Diffstat (limited to 'tests/topotests/bgp_multiview_topo1/peer3/exa-send.py')
-rwxr-xr-xtests/topotests/bgp_multiview_topo1/peer3/exa-send.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py
new file mode 100755
index 0000000000..2de2bce40a
--- /dev/null
+++ b/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+"""
+exa-send.py: Send a few testroutes with ExaBGP
+"""
+
+from sys import stdout,argv
+from time import sleep
+
+sleep(5)
+
+# 1st arg is peer number
+# 2nd arg is number of routes to send
+peer = int(argv[1])
+numRoutes = int(argv[2])
+
+# Announce numRoutes different routes per PE
+for i in range(0, numRoutes):
+ stdout.write('announce route 10.%s.%s.0/24 med 100 community %i:1 next-hop 172.16.1.%i\n' % ((peer+100), i, peer, peer))
+ stdout.flush()
+
+# Announce 1 overlapping route per peer
+stdout.write('announce route 10.0.1.0/24 next-hop 172.16.1.%i\n' % peer)
+stdout.flush()
+
+#Loop endlessly to allow ExaBGP to continue running
+while True:
+ sleep(1)