net['r%s' % i].loadConf('pbrd', '%s/r%s/pbrd.conf' % (thisDir, i))
net['r%s' % i].startRouter()
- # For debugging after starting Quagga/FRR daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
if (fatal_error != ""):
pytest.skip(fatal_error)
- print("\n\n** Check if FRR/Quagga is running on each Router node")
+ print("\n\n** Check if FRR is running on each Router node")
print("******************************************\n")
sleep(5)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
assert error_logs == "", "Daemons report errors to StdErr"
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
assert failures == 0, "IPv6 Routing table failed for r%s\n%s" % (i, diff)
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
## CLI(net)
def route_get_nhg_id(route_str):
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
def test_route_map():
fatal_error = net['r%s' % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
#
"""
-test_bfd_bgp_cbit_topo3.py: Test the FRR/Quagga BFD daemon with multihop and BGP
+test_bfd_bgp_cbit_topo3.py: Test the FRR BFD daemon with multihop and BGP
unnumbered.
"""
#
"""
-test_bfd_topo1.py: Test the FRR/Quagga BFD daemon.
+test_bfd_topo1.py: Test the FRR BFD daemon.
"""
import os
#
"""
-test_bfd_topo2.py: Test the FRR/Quagga BFD daemon with multihop and BGP
+test_bfd_topo2.py: Test the FRR BFD daemon with multihop and BGP
unnumbered.
"""
#
"""
-test_bfd_vrf_topo1.py: Test the FRR/Quagga BFD daemon.
+test_bfd_vrf_topo1.py: Test the FRR BFD daemon.
"""
import os
#
"""
- test_bgp_evpn.py: Test the FRR/Quagga BGP daemon with BGP IPv6 interface
+ test_bgp_evpn.py: Test the FRR BGP daemon with BGP IPv6 interface
with route advertisements on a separate netns.
"""
#
"""
- test_bgp_ipv6_rtadv.py: Test the FRR/Quagga BGP daemon with BGP IPv6 interface
+ test_bgp_ipv6_rtadv.py: Test the FRR BGP daemon with BGP IPv6 interface
with route advertisements on a separate netns.
"""
#
"""
-customize.py: Simple FRR/Quagga MPLS L3VPN test topology
+customize.py: Simple FRR MPLS L3VPN test topology
|
+----+----+
#
"""
-customize.py: Simple FRR/Quagga MPLS L3VPN test topology
+customize.py: Simple FRR MPLS L3VPN test topology
|
+----+----+
#
"""
-test_bgp_multiview_topo1.py: Simple Quagga/FRR Route-Server Test
+test_bgp_multiview_topo1.py: Simple FRR Route-Server Test
+----------+ +----------+ +----------+ +----------+ +----------+
| peer1 | | peer2 | | peer3 | | peer4 | | peer5 |
print("peer%s" % i),
print("")
- # For debugging after starting Quagga/FRR daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
if fatal_error != "":
pytest.skip(fatal_error)
- print("\n\n** Check if FRR/Quagga is running on each Router node")
+ print("\n\n** Check if FRR is running on each Router node")
print("******************************************\n")
# Starting Routers
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting Quagga/FRR daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
.rstrip()
)
- # Fix inconsitent spaces between 0.99.24 and newer versions of Quagga...
+ # Fix inconsitent spaces between 0.99.24 and newer versions
actual = re.sub("0 0", "0 0", actual)
actual = re.sub(
r"([0-9]) 32768", r"\1 32768", actual
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
#
"""
-customize.py: Simple FRR/Quagga MPLS L3VPN test topology
+customize.py: Simple FRR MPLS L3VPN test topology
+---------+
| r1 |
#
"""
- test_bgp_ipv6_rtadv.py: Test the FRR/Quagga BGP daemon with BGP IPv6 interface
+ test_bgp_ipv6_rtadv.py: Test the FRR BGP daemon with BGP IPv6 interface
with route advertisements on a separate netns.
"""
#
"""
-test_ldp_oc_acl_topo1.py: Simple FRR/Quagga LDP Test
+test_ldp_oc_acl_topo1.py: Simple FRR LDP Test
+---------+
| r1 |
#
"""
-test_ldp_oc_topo1.py: Simple FRR/Quagga LDP Test
+test_ldp_oc_topo1.py: Simple FRR LDP Test
+---------+
| r1 |
#
"""
-test_ldp_topo1.py: Simple FRR/Quagga LDP Test
+test_ldp_topo1.py: Simple FRR LDP Test
+---------+
| r1 |
if fatal_error != "":
break
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
if fatal_error != "":
pytest.skip(fatal_error)
- print("\n\n** Check if FRR/Quagga is running on each Router node")
+ print("\n\n** Check if FRR is running on each Router node")
print("******************************************\n")
sleep(5)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
.cmd('vtysh -c "show ip route" 2> /dev/null | grep "^O"')
.rstrip()
)
- # Drop timers on end of line (older Quagga Versions)
+ # Drop timers on end of line
actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
# Mask out label - all LDP labels should be >= 10 (2-digit)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
tgen_defaults = {
"verbosity": "info",
"frrdir": "/usr/lib/frr",
- "quaggadir": "/usr/lib/quagga",
"routertype": "frr",
"memleak_path": None,
}
options:
* `name`: (optional) select the router name
* `daemondir`: (optional) custom daemon binary directory
- * `routertype`: (optional) `quagga` or `frr`
+ * `routertype`: (optional) `frr`
Returns a TopoRouter.
"""
if name is None:
raise KeyError("router already exists")
params["frrdir"] = self.config.get(self.CONFIG_SECTION, "frrdir")
- params["quaggadir"] = self.config.get(self.CONFIG_SECTION, "quaggadir")
params["memleak_path"] = self.config.get(self.CONFIG_SECTION, "memleak_path")
if not params.has_key("routertype"):
params["routertype"] = self.config.get(self.CONFIG_SECTION, "routertype")
Router abstraction.
"""
- # The default required directories by Quagga/FRR
+ # The default required directories by FRR
PRIVATE_DIRS = [
"/etc/frr",
- "/etc/quagga",
"/var/run/frr",
- "/var/run/quagga",
"/var/log",
]
* cls: router class that will be used to instantiate
* name: router name
* daemondir: daemon binary directory
- * routertype: 'quagga' or 'frr'
+ * routertype: 'frr'
"""
super(TopoRouter, self).__init__()
self.tgen = tgen
except OSError:
pass
- # Allow unprivileged daemon user (frr/quagga) to create log files
+ # Allow unprivileged daemon user (frr) to create log files
try:
# Only allow group, if it exist.
gid = grp.getgrnam(self.routertype)[2]
* Load modules
* Clean up files
* Configure interfaces
- * Start daemons (e.g. FRR/Quagga)
+ * Start daemons (e.g. FRR)
* Configure daemon logging files
"""
self.logger.debug("starting")
def startDaemons(self, daemons):
"""
Start Daemons: to start specific daemon(user defined daemon only)
- * Start daemons (e.g. FRR/Quagga)
+ * Start daemons (e.g. FRR)
* Configure daemon logging files
"""
self.logger.debug('starting')
# Assert that FRR utilities exist
frrdir = config.get("topogen", "frrdir")
- hasfrr = False
if not os.path.isdir(frrdir):
logger.error("could not find {} directory".format(frrdir))
ret = False
else:
- hasfrr = True
try:
pwd.getpwnam("frr")[2]
except KeyError:
os.system("{} -v 2>&1 >/tmp/topotests/frr_zebra.txt".format(path))
- # Assert that Quagga utilities exist
- quaggadir = config.get("topogen", "quaggadir")
- if hasfrr:
- # if we have frr, don't check for quagga
- pass
- elif not os.path.isdir(quaggadir):
- logger.info(
- "could not find {} directory (quagga tests will not run)".format(quaggadir)
- )
- else:
- ret = True
- try:
- pwd.getpwnam("quagga")[2]
- except KeyError:
- logger.info('could not find "quagga" user')
-
- try:
- grp.getgrnam("quagga")[2]
- except KeyError:
- logger.info('could not find "quagga" group')
-
- try:
- if "quagga" not in grp.getgrnam("quaggavty").gr_mem:
- logger.error(
- '"quagga" user and group exist, but user is not under "quaggavty"'
- )
- except KeyError:
- logger.warning('could not find "quaggavty" group')
-
- for fname in [
- "zebra",
- "ospfd",
- "ospf6d",
- "bgpd",
- "ripd",
- "ripngd",
- "isisd",
- "pimd",
- "pbrd"
- ]:
- path = os.path.join(quaggadir, fname)
- if not os.path.isfile(path):
- logger.warning("could not find {} in {}".format(fname, quaggadir))
- ret = False
- else:
- if fname != "zebra":
- continue
-
- os.system("{} -v 2>&1 >/tmp/topotests/quagga_zebra.txt".format(path))
-
# Test MPLS availability
krel = platform.release()
if topotest.version_cmp(krel, "4.5") < 0:
def addRouter(topo, name):
- "Adding a FRRouter (or Quagga) to Topology"
+ "Adding a FRRouter to Topology"
MyPrivateDirs = [
"/etc/frr",
- "/etc/quagga",
"/var/run/frr",
- "/var/run/quagga",
"/var/log",
]
if sys.platform.startswith("linux"):
class Router(Node):
- "A Node with IPv4/IPv6 forwarding enabled and Quagga as Routing Engine"
+ "A Node with IPv4/IPv6 forwarding enabled"
def __init__(self, name, **params):
super(Router, self).__init__(name, **params)
{
"verbosity": "info",
"frrdir": "/usr/lib/frr",
- "quaggadir": "/usr/lib/quagga",
"routertype": "frr",
"memleak_path": None,
}
if not os.path.isfile(zebra_path):
raise Exception("FRR zebra binary doesn't exist at {}".format(zebra_path))
- def _config_quagga(self, **params):
- "Configure Quagga binaries"
- self.daemondir = params.get("quaggadir")
- if self.daemondir is None:
- self.daemondir = self.config_defaults.get("topogen", "quaggadir")
-
- zebra_path = os.path.join(self.daemondir, "zebra")
- if not os.path.isfile(zebra_path):
- raise Exception(
- "Quagga zebra binary doesn't exist at {}".format(zebra_path)
- )
-
# pylint: disable=W0221
# Some params are only meaningful for the parent class.
def config(self, **params):
self.routertype = params.get(
"routertype", self.config_defaults.get("topogen", "routertype")
)
- if self.routertype == "quagga":
- self._config_quagga(**params)
- else:
- self._config_frr(**params)
+ self._config_frr(**params)
else:
# Test the provided path
zpath = os.path.join(self.daemondir, "zebra")
def killRouterDaemons(
self, daemons, wait=True, assertOnError=True, minErrorVersion="5.1"
):
- # Kill Running Quagga or FRR specific
+ # Kill Running FRR
# Daemons(user specified daemon only) using SIGKILL
rundaemons = self.cmd("ls -1 /var/run/%s/*.pid" % self.routertype)
errors = ""
return True
def get_routertype(self):
- "Return the type of Router (frr or quagga)"
+ "Return the type of Router (frr)"
return self.routertype
#
"""
-test_ospf_topo1.py: Test the FRR/Quagga OSPF routing daemon.
+test_ospf_topo1.py: Test the FRR OSPF routing daemon.
"""
import os
#
"""
-test_ospf_topo1.py: Test the FRR/Quagga OSPF routing daemon.
+test_ospf_topo1.py: Test the FRR OSPF routing daemon.
"""
import os
# Default daemons binaries path.
#frrdir = /usr/lib/frr
-#quaggadir = /usr/lib/quagga
# Default router type to use. Possible values are:
-# 'frr' and 'quagga'.
+# 'frr'
#routertype = frr
# Memory leak test reports path
net["r%s" % i].loadConf("ripd", "%s/r%s/ripd.conf" % (thisDir, i))
net["r%s" % i].startRouter()
- # For debugging after starting Quagga/FRR daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
if fatal_error != "":
pytest.skip(fatal_error)
- print("\n\n** Check if FRR/Quagga is running on each Router node")
+ print("\n\n** Check if FRR is running on each Router node")
print("******************************************\n")
# Make sure that all daemons are running
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
.cmd('vtysh -c "show ip route" 2> /dev/null | grep "^R"')
.rstrip()
)
- # Drop timers on end of line (older Quagga Versions)
+ # Drop timers on end of line
actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
# Fix newlines (make them all the same)
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
net["r%s" % i].loadConf("ripngd", "%s/r%s/ripngd.conf" % (thisDir, i))
net["r%s" % i].startRouter()
- # For debugging after starting Quagga/FRR daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
if fatal_error != "":
pytest.skip(fatal_error)
- print("\n\n** Check if FRR/Quagga is running on each Router node")
+ print("\n\n** Check if FRR is running on each Router node")
print("******************************************\n")
# Starting Routers
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)
)
# Mask out Link-Local mac address portion. They are random...
actual = re.sub(r" fe80::[0-9a-f:]+", " fe80::XXXX:XXXX:XXXX:XXXX", actual)
- # Drop timers on end of line (older Quagga Versions)
+ # Drop timers on end of line
actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
# Fix newlines (make them all the same)
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)
fatal_error = net["r%s" % i].checkRouterRunning()
assert fatal_error == "", fatal_error
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
+ # For debugging after starting FRR daemons, uncomment the next line
# CLI(net)