]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp_direct_to_bgp_vpn: enable mpls forwarding, add more details on adjacencies
authorLou Berger <lberger@labn.net>
Tue, 9 Jan 2018 15:07:43 +0000 (10:07 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_direct_to_bgp_vpn/customize.py
tests/topotests/bgp_direct_to_bgp_vpn/scripts/adjacencies.py

index 175970e6a3b973e8a58a986ac69d771be7e2b5ad..8d613b292183548b76f547720eb37f6ecc2044a6 100644 (file)
@@ -128,6 +128,34 @@ class ThisTestTopo(Topo):
         switch[1].add_link(tgen.gears['r2'], nodeif='r2-eth2')
         switch[1].add_link(tgen.gears['r3'], nodeif='r3-eth1')
 
+def doCmd(tgen, rtr, cmd):
+    output = tgen.net[rtr].cmd(cmd).strip()
+    if len(output):
+        logger.info('command output: ' + output)
+
+def autogenPreRouterStartHook():
+    tgen = get_topogen()
+    logger.info('pre router-start hook')
+    #configure r2 mpls interfaces
+    intfs = ['lo', 'r2-eth0', 'r2-eth1', 'r2-eth2']
+    for intf in intfs:
+        doCmd(tgen, 'r2', 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf))
+    #configure MPLS
+    rtrs = ['r1', 'r3', 'r4']
+    cmds = ['echo 1 > /proc/sys/net/mpls/conf/lo/input']
+    for rtr in rtrs:
+        for cmd in cmds:
+            doCmd(tgen, rtr, cmd)
+        intfs = ['lo', rtr+'-eth0', rtr+'-eth4']
+        for intf in intfs:
+            doCmd(tgen, rtr, 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf))
+    logger.info('setup mpls input')
+    return;
+
+def autogenPostRouterStartHook():
+    logger.info('post router-start hook')
+    return;
+
 def versionCheck(vstr, rname='r1', compstr='<',cli=False):
     tgen = get_topogen()
 
index 2645d28f309e154f2844d511595a30fd802127ef..63addc8544be095a843e16910e9d8b86ce7871f7 100644 (file)
@@ -1,5 +1,12 @@
 from lutil import luCommand
-luCommand('r1','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up', 60)
-luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
-luCommand('r3','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
-luCommand('r4','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
+luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0.* 00:0','wait','Core adjacencies up',90)
+luCommand('r1','vtysh -c "show bgp summary"',' 00:0','pass','Core adjacencies up')
+luCommand('r3','vtysh -c "show bgp summary"',' 00:0','pass','Core adjacencies up')
+luCommand('r4','vtysh -c "show bgp summary"',' 00:0','pass','Core adjacencies up')
+
+luCommand('ce1','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up',90)
+luCommand('ce2','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up')
+luCommand('ce3','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up')
+luCommand('r1','vtysh -c "show bgp vrf all summary"',' 00:0.* 00:0','pass','All adjacencies up')
+luCommand('r3','vtysh -c "show bgp vrf all summary"',' 00:0.* 00:0','pass','All adjacencies up')
+luCommand('r4','vtysh -c "show bgp vrf all summary"',' 00:0.* 00:0','pass','All adjacencies up')