mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 01:16:39 +00:00
Merge pull request #7607 from pguibert6WIND/topo_python3_preparation
Topo python3 preparation
This commit is contained in:
commit
3abf06b722
@ -1065,7 +1065,7 @@ def test_bgp_ipv4():
|
|||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
resultstr = "No template matched.\n"
|
resultstr = "No template matched.\n"
|
||||||
for f in diffresult.iterkeys():
|
for f in diffresult.keys():
|
||||||
resultstr += "template %s: r%s failed SHOW BGP IPv4 check:\n%s\n" % (
|
resultstr += "template %s: r%s failed SHOW BGP IPv4 check:\n%s\n" % (
|
||||||
f,
|
f,
|
||||||
i,
|
i,
|
||||||
@ -1134,7 +1134,7 @@ def test_bgp_ipv6():
|
|||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
resultstr = "No template matched.\n"
|
resultstr = "No template matched.\n"
|
||||||
for f in diffresult.iterkeys():
|
for f in diffresult.keys():
|
||||||
resultstr += "template %s: r%s failed SHOW BGP IPv6 check:\n%s\n" % (
|
resultstr += "template %s: r%s failed SHOW BGP IPv6 check:\n%s\n" % (
|
||||||
f,
|
f,
|
||||||
i,
|
i,
|
||||||
|
@ -102,7 +102,7 @@ def setup_module(module):
|
|||||||
|
|
||||||
# Starting Routers
|
# Starting Routers
|
||||||
router_list = tgen.routers()
|
router_list = tgen.routers()
|
||||||
for rname, router in router_list.iteritems():
|
for rname, router in router_list.items():
|
||||||
router.load_config(
|
router.load_config(
|
||||||
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
|
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1", 'vtysh -c "show bgp next"', "99.0.0.. valid", "wait", "See CE static NH"
|
"r1", 'vtysh -c "show bgp next"', "99.0.0.. valid", "wait", "See CE static NH"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand("ce1", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping")
|
luCommand("ce1", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping")
|
||||||
luCommand("ce2", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping")
|
luCommand("ce2", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"ce1",
|
"ce1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1", 'vtysh -c "add vrf r1-cust1 prefix 99.0.0.1/32"', ".", "none", "IP Address"
|
"r1", 'vtysh -c "add vrf r1-cust1 prefix 99.0.0.1/32"', ".", "none", "IP Address"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand("ce1", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180)
|
luCommand("ce1", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180)
|
||||||
luCommand("ce2", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180)
|
luCommand("ce2", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand, luLast
|
from lib.lutil import luCommand, luLast
|
||||||
from lib import topotest
|
from lib import topotest
|
||||||
|
|
||||||
ret = luCommand(
|
ret = luCommand(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
from customize import l3mdev_accept
|
from customize import l3mdev_accept
|
||||||
|
|
||||||
l3mdev_rtrs = ["r1", "r3", "r4", "ce4"]
|
l3mdev_rtrs = ["r1", "r3", "r4", "ce4"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
from bgprib import bgpribRequireVpnRoutes, bgpribRequireUnicastRoutes
|
from lib.bgprib import bgpribRequireVpnRoutes, bgpribRequireUnicastRoutes
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CE routers: contain routes they originate
|
# CE routers: contain routes they originate
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
rtrs = ["ce1", "ce2", "ce3", "r1", "r2", "r3", "r4"]
|
rtrs = ["ce1", "ce2", "ce3", "r1", "r2", "r3", "r4"]
|
||||||
for rtr in rtrs:
|
for rtr in rtrs:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
ret = luCommand(
|
ret = luCommand(
|
||||||
"ce1",
|
"ce1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
num = 50000
|
num = 50000
|
||||||
b = int(num / (256 * 256))
|
b = int(num / (256 * 256))
|
||||||
|
@ -332,7 +332,7 @@ def test_bgp_routingTable():
|
|||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
resultstr = "No template matched.\n"
|
resultstr = "No template matched.\n"
|
||||||
for f in diffresult.iterkeys():
|
for f in diffresult.keys():
|
||||||
resultstr += (
|
resultstr += (
|
||||||
"template %s: r%s failed Routing Table Check for view %s:\n%s\n"
|
"template %s: r%s failed Routing Table Check for view %s:\n%s\n"
|
||||||
% (f, i, view, diffresult[f])
|
% (f, i, view, diffresult[f])
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
holddownFactorSet = luCommand(
|
holddownFactorSet = luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
holddownFactorSet = luCommand(
|
holddownFactorSet = luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand("r1", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI")
|
luCommand("r1", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI")
|
||||||
luCommand("r2", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI")
|
luCommand("r2", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
holddownFactorSet = luCommand(
|
holddownFactorSet = luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from lutil import luCommand
|
from lib.lutil import luCommand
|
||||||
|
|
||||||
luCommand(
|
luCommand(
|
||||||
"r1",
|
"r1",
|
||||||
|
@ -179,7 +179,7 @@ def setup_module(mod):
|
|||||||
router_list = tgen.routers()
|
router_list = tgen.routers()
|
||||||
|
|
||||||
# For all registered routers, load the zebra configuration file
|
# For all registered routers, load the zebra configuration file
|
||||||
for rname, router in router_list.iteritems():
|
for rname, router in router_list.items():
|
||||||
router.load_config(
|
router.load_config(
|
||||||
TopoRouter.RD_ZEBRA,
|
TopoRouter.RD_ZEBRA,
|
||||||
os.path.join(CWD, '{}/zebra.conf'.format(rname))
|
os.path.join(CWD, '{}/zebra.conf'.format(rname))
|
||||||
|
@ -45,7 +45,7 @@ class BgpRib:
|
|||||||
|
|
||||||
def routes_include_wanted(self, pfxtbl, want, debug):
|
def routes_include_wanted(self, pfxtbl, want, debug):
|
||||||
# helper function to RequireVpnRoutes
|
# helper function to RequireVpnRoutes
|
||||||
for pfx in pfxtbl.iterkeys():
|
for pfx in pfxtbl.keys():
|
||||||
if debug:
|
if debug:
|
||||||
self.log("trying pfx %s" % pfx)
|
self.log("trying pfx %s" % pfx)
|
||||||
if pfx != want["p"]:
|
if pfx != want["p"]:
|
||||||
@ -107,7 +107,7 @@ class BgpRib:
|
|||||||
found = 0
|
found = 0
|
||||||
if debug:
|
if debug:
|
||||||
self.log("want rd %s" % want["rd"])
|
self.log("want rd %s" % want["rd"])
|
||||||
for rd in rds.iterkeys():
|
for rd in rds.keys():
|
||||||
if rd != want["rd"]:
|
if rd != want["rd"]:
|
||||||
continue
|
continue
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -23,7 +23,7 @@ import time
|
|||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import math
|
import math
|
||||||
from topolog import logger
|
from lib.topolog import logger
|
||||||
from mininet.net import Mininet
|
from mininet.net import Mininet
|
||||||
|
|
||||||
|
|
||||||
@ -58,14 +58,14 @@ class lUtil:
|
|||||||
def log(self, str, level=6):
|
def log(self, str, level=6):
|
||||||
if self.l_level > 0:
|
if self.l_level > 0:
|
||||||
if self.fout == "":
|
if self.fout == "":
|
||||||
self.fout = open(self.fout_name, "w", 0)
|
self.fout = open(self.fout_name, "w")
|
||||||
self.fout.write(str + "\n")
|
self.fout.write(str + "\n")
|
||||||
if level <= self.l_level:
|
if level <= self.l_level:
|
||||||
print(str)
|
print(str)
|
||||||
|
|
||||||
def summary(self, str):
|
def summary(self, str):
|
||||||
if self.fsum == "":
|
if self.fsum == "":
|
||||||
self.fsum = open(self.fsum_name, "w", 0)
|
self.fsum = open(self.fsum_name, "w")
|
||||||
self.fsum.write(
|
self.fsum.write(
|
||||||
"\
|
"\
|
||||||
******************************************************************************\n"
|
******************************************************************************\n"
|
||||||
@ -380,7 +380,8 @@ def luInclude(filename, CallOnFail=None):
|
|||||||
LUtil.setCallOnFail(CallOnFail)
|
LUtil.setCallOnFail(CallOnFail)
|
||||||
if filename.endswith(".py"):
|
if filename.endswith(".py"):
|
||||||
LUtil.log("luInclude: execfile " + tstFile)
|
LUtil.log("luInclude: execfile " + tstFile)
|
||||||
execfile(tstFile)
|
with open(tstFile) as infile:
|
||||||
|
exec(infile.read())
|
||||||
else:
|
else:
|
||||||
LUtil.log("luInclude: execTestFile " + tstFile)
|
LUtil.log("luInclude: execTestFile " + tstFile)
|
||||||
LUtil.execTestFile(tstFile)
|
LUtil.execTestFile(tstFile)
|
||||||
|
Loading…
Reference in New Issue
Block a user