summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py12
-rwxr-xr-xtests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py12
-rwxr-xr-xtests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py1
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/__init__.py0
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r1/bgpd.conf5
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r1/zebra.conf9
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r2/bgpd.conf5
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r2/zebra.conf12
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r3/bgpd.conf3
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/r3/zebra.conf6
-rw-r--r--tests/topotests/bgp_show_ip_bgp_fqdn/test_bgp_show_ip_bgp_fqdn.py133
-rw-r--r--tests/topotests/lib/bgp.py50
-rw-r--r--tests/topotests/lib/common_config.py18
-rw-r--r--tests/topotests/lib/topojson.py8
-rw-r--r--tests/topotests/lib/topotest.py8
-rw-r--r--tests/topotests/zebra_rib/r1/v4_route_1_static_override.json2
16 files changed, 64 insertions, 220 deletions
diff --git a/tests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py b/tests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py
index 087ba21e5e..948f641afb 100755
--- a/tests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py
+++ b/tests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py
@@ -63,7 +63,7 @@ from lib.common_config import (
reset_config_on_routers,
)
from lib.topolog import logger
-from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
+from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
from lib.topojson import build_topo_from_json, build_config_from_json
# Reading the data from JSON File for topology and configuration creation
@@ -295,7 +295,7 @@ def test_modify_ecmp_max_paths(request, ecmp_num, test_type):
addr_type,
dut,
input_dict_1,
- next_hop=NEXT_HOPS[addr_type][:int(ecmp_num)],
+ next_hop=NEXT_HOPS[addr_type][: int(ecmp_num)],
protocol=protocol,
)
assert result is True, "Testcase {} : Failed \n Error: {}".format(
@@ -336,8 +336,12 @@ def test_ecmp_after_clear_bgp(request, test_type):
tc_name, result
)
- # Clear bgp
- result = clear_bgp_and_verify(tgen, topo, dut)
+ # Clear BGP
+ for addr_type in ADDR_TYPES:
+ clear_bgp(tgen, addr_type, dut)
+
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
for addr_type in ADDR_TYPES:
diff --git a/tests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py b/tests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py
index 94409ff3e1..5b997fdd16 100755
--- a/tests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py
+++ b/tests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py
@@ -63,7 +63,7 @@ from lib.common_config import (
reset_config_on_routers,
)
from lib.topolog import logger
-from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
+from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
from lib.topojson import build_topo_from_json, build_config_from_json
# Reading the data from JSON File for topology and configuration creation
@@ -296,7 +296,7 @@ def test_modify_ecmp_max_paths(request, ecmp_num, test_type):
addr_type,
dut,
input_dict_1,
- next_hop=NEXT_HOPS[addr_type][:int(ecmp_num)],
+ next_hop=NEXT_HOPS[addr_type][: int(ecmp_num)],
protocol=protocol,
)
assert result is True, "Testcase {} : Failed \n Error: {}".format(
@@ -337,8 +337,12 @@ def test_ecmp_after_clear_bgp(request, test_type):
tc_name, result
)
- # Clear bgp
- result = clear_bgp_and_verify(tgen, topo, dut)
+ # Clear BGP
+ for addr_type in ADDR_TYPES:
+ clear_bgp(tgen, addr_type, dut)
+
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
for addr_type in ADDR_TYPES:
diff --git a/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py b/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
index b0ff3ac437..607b036c6a 100755
--- a/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
+++ b/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
@@ -56,7 +56,6 @@ import pdb
import json
import time
import inspect
-import ipaddress
from time import sleep
import pytest
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/__init__.py b/tests/topotests/bgp_show_ip_bgp_fqdn/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/__init__.py
+++ /dev/null
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r1/bgpd.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r1/bgpd.conf
deleted file mode 100644
index f0df56e947..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r1/bgpd.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-router bgp 65000
- no bgp ebgp-requires-policy
- neighbor 192.168.255.2 remote-as 65001
- address-family ipv4 unicast
- redistribute connected
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r1/zebra.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r1/zebra.conf
deleted file mode 100644
index 0a283c06d5..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r1/zebra.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-!
-interface lo
- ip address 172.16.255.254/32
-!
-interface r1-eth0
- ip address 192.168.255.1/24
-!
-ip forwarding
-!
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r2/bgpd.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r2/bgpd.conf
deleted file mode 100644
index 422a7345f9..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r2/bgpd.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-router bgp 65001
- no bgp ebgp-requires-policy
- bgp default show-hostname
- neighbor 192.168.255.1 remote-as 65000
- neighbor 192.168.254.1 remote-as 65001
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r2/zebra.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r2/zebra.conf
deleted file mode 100644
index e9e2e4391f..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r2/zebra.conf
+++ /dev/null
@@ -1,12 +0,0 @@
-!
-interface lo
- ip address 172.16.255.253/32
-!
-interface r2-eth0
- ip address 192.168.255.2/24
-!
-interface r2-eth1
- ip address 192.168.254.2/24
-!
-ip forwarding
-!
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r3/bgpd.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r3/bgpd.conf
deleted file mode 100644
index 8fcf6a736d..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r3/bgpd.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-router bgp 65001
- bgp default show-hostname
- neighbor 192.168.254.2 remote-as 65001
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/r3/zebra.conf b/tests/topotests/bgp_show_ip_bgp_fqdn/r3/zebra.conf
deleted file mode 100644
index a8b8bc38c5..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/r3/zebra.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-!
-interface r3-eth0
- ip address 192.168.254.1/24
-!
-ip forwarding
-!
diff --git a/tests/topotests/bgp_show_ip_bgp_fqdn/test_bgp_show_ip_bgp_fqdn.py b/tests/topotests/bgp_show_ip_bgp_fqdn/test_bgp_show_ip_bgp_fqdn.py
deleted file mode 100644
index e8ad180935..0000000000
--- a/tests/topotests/bgp_show_ip_bgp_fqdn/test_bgp_show_ip_bgp_fqdn.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/env python
-
-#
-# test_bgp_show_ip_bgp_fqdn.py
-# Part of NetDEF Topology Tests
-#
-# Copyright (c) 2019 by
-# Donatas Abraitis <donatas.abraitis@gmail.com>
-#
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
-
-"""
-test_bgp_show_ip_bgp_fqdn.py:
-Test if FQND is visible in `show [ip] bgp` output if
-`bgp default show-hostname` is toggled.
-
-Topology:
-r1 <-- eBGP --> r2 <-- iBGP --> r3
-
-1. Check if both hostname and ip are added to JSON output
-for 172.16.255.254/32 on r2.
-2. Check if only ip is added to JSON output for 172.16.255.254/32 on r3.
-"""
-
-import os
-import sys
-import json
-import time
-import pytest
-import functools
-
-CWD = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(os.path.join(CWD, "../"))
-
-# pylint: disable=C0413
-from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.topolog import logger
-from mininet.topo import Topo
-
-
-class TemplateTopo(Topo):
- def build(self, *_args, **_opts):
- tgen = get_topogen(self)
-
- for routern in range(1, 4):
- tgen.add_router("r{}".format(routern))
-
- switch = tgen.add_switch("s1")
- switch.add_link(tgen.gears["r1"])
- switch.add_link(tgen.gears["r2"])
-
- switch = tgen.add_switch("s2")
- switch.add_link(tgen.gears["r2"])
- switch.add_link(tgen.gears["r3"])
-
-
-def setup_module(mod):
- tgen = Topogen(TemplateTopo, mod.__name__)
- tgen.start_topology()
-
- router_list = tgen.routers()
-
- for i, (rname, router) in enumerate(router_list.iteritems(), 1):
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
- )
-
- tgen.start_router()
-
-
-def teardown_module(mod):
- tgen = get_topogen()
- tgen.stop_topology()
-
-
-def test_bgp_show_ip_bgp_hostname():
- tgen = get_topogen()
-
- if tgen.routers_have_failure():
- pytest.skip(tgen.errors)
-
- def _bgp_converge(router):
- output = json.loads(router.vtysh_cmd("show ip bgp 172.16.255.254/32 json"))
- expected = {"prefix": "172.16.255.254/32"}
- return topotest.json_cmp(output, expected)
-
- def _bgp_show_nexthop_hostname_and_ip(router):
- output = json.loads(router.vtysh_cmd("show ip bgp json"))
- for nh in output["routes"]["172.16.255.254/32"][0]["nexthops"]:
- if "hostname" in nh and "ip" in nh:
- return True
- return False
-
- def _bgp_show_nexthop_ip_only(router):
- output = json.loads(router.vtysh_cmd("show ip bgp json"))
- for nh in output["routes"]["172.16.255.254/32"][0]["nexthops"]:
- if "ip" in nh and not "hostname" in nh:
- return True
- return False
-
- test_func = functools.partial(_bgp_converge, tgen.gears["r2"])
- success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
-
- test_func = functools.partial(_bgp_converge, tgen.gears["r3"])
- success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
-
- assert result is None, 'Failed bgp convergence in "{}"'.format(tgen.gears["r2"])
- assert _bgp_show_nexthop_hostname_and_ip(tgen.gears["r2"]) == True
-
- assert result is None, 'Failed bgp convergence in "{}"'.format(tgen.gears["r3"])
- assert _bgp_show_nexthop_ip_only(tgen.gears["r3"]) == True
-
-
-if __name__ == "__main__":
- args = ["-s"] + sys.argv[1:]
- sys.exit(pytest.main(args))
diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py
index 38e4e1fce5..971bbd0f3b 100644
--- a/tests/topotests/lib/bgp.py
+++ b/tests/topotests/lib/bgp.py
@@ -21,7 +21,7 @@
from copy import deepcopy
from time import sleep
import traceback
-import ipaddr
+import ipaddress
import os
import sys
from lib import topotest
@@ -44,7 +44,6 @@ from lib.common_config import (
LOGDIR = "/tmp/topotests/"
TMPDIR = None
-
def create_router_bgp(tgen, topo, input_dict=None, build=False, load_config=True):
"""
API to configure bgp on router
@@ -381,10 +380,10 @@ def __create_bgp_unicast_neighbor(
del_action = advertise_network_dict.setdefault("delete", False)
# Generating IPs for verification
- prefix = str(ipaddr.IPNetwork(unicode(network[0])).prefixlen)
+ prefix = str(ipaddress.ip_network(unicode(network[0])).prefixlen)
network_list = generate_ips(network, no_of_network)
for ip in network_list:
- ip = str(ipaddr.IPNetwork(unicode(ip)).network)
+ ip = str(ipaddress.ip_network(unicode(ip)).network_address)
cmd = "network {}/{}".format(ip, prefix)
if del_action:
@@ -859,7 +858,7 @@ def verify_router_id(tgen, topo, input_dict):
logger.info("Checking router %s router-id", router)
show_bgp_json = run_frr_cmd(rnode, "show bgp summary json", isjson=True)
router_id_out = show_bgp_json["ipv4Unicast"]["routerId"]
- router_id_out = ipaddr.IPv4Address(unicode(router_id_out))
+ router_id_out = ipaddress.IPv4Address(unicode(router_id_out))
# Once router-id is deleted, highest interface ip should become
# router-id
@@ -867,7 +866,7 @@ def verify_router_id(tgen, topo, input_dict):
router_id = find_interface_with_greater_ip(topo, router)
else:
router_id = input_dict[router]["bgp"]["router_id"]
- router_id = ipaddr.IPv4Address(unicode(router_id))
+ router_id = ipaddress.IPv4Address(unicode(router_id))
if router_id == router_id_out:
logger.info("Found expected router-id %s for router %s", router_id, router)
@@ -882,7 +881,7 @@ def verify_router_id(tgen, topo, input_dict):
return True
-@retry(attempts=44, wait=3, return_is_str=True)
+@retry(attempts=50, wait=3, return_is_str=True)
def verify_bgp_convergence(tgen, topo, dut=None):
"""
API will verify if BGP is converged with in the given time frame.
@@ -1052,11 +1051,13 @@ def verify_bgp_convergence(tgen, topo, dut=None):
if nh_state == "Established":
no_of_peer += 1
- if no_of_peer == total_peer:
- logger.info("[DUT: %s] VRF: %s, BGP is Converged", router, vrf)
- else:
- errormsg = "[DUT: %s] VRF: %s, BGP is not converged" % (router, vrf)
- return errormsg
+ if no_of_peer == total_peer:
+ logger.info("[DUT: %s] VRF: %s, BGP is Converged for %s address-family",
+ router, vrf, addr_type)
+ else:
+ errormsg = ("[DUT: %s] VRF: %s, BGP is not converged for %s address-family" %
+ (router, vrf, addr_type))
+ return errormsg
logger.debug("Exiting API: verify_bgp_convergence()")
return True
@@ -1326,7 +1327,7 @@ def verify_as_numbers(tgen, topo, input_dict):
return True
-@retry(attempts=44, wait=3, return_is_str=True)
+@retry(attempts=50, wait=3, return_is_str=True)
def verify_bgp_convergence_from_running_config(tgen, dut=None):
"""
API to verify BGP convergence b/w loopback and physical interface.
@@ -1467,9 +1468,10 @@ def clear_bgp_and_verify(tgen, topo, router):
rnode = tgen.routers()[router]
peer_uptime_before_clear_bgp = {}
+ sleeptime = 3
+
# Verifying BGP convergence before bgp clear command
- for retry in range(44):
- sleeptime = 3
+ for retry in range(50):
# Waiting for BGP to converge
logger.info(
"Waiting for %s sec for BGP to converge on router" " %s...",
@@ -1536,8 +1538,8 @@ def clear_bgp_and_verify(tgen, topo, router):
)
else:
errormsg = (
- "TIMEOUT!! BGP is not converged in 30 seconds for"
- " router {}".format(router)
+ "TIMEOUT!! BGP is not converged in {} seconds for"
+ " router {}".format(retry * sleeptime, router)
)
return errormsg
@@ -1551,8 +1553,8 @@ def clear_bgp_and_verify(tgen, topo, router):
peer_uptime_after_clear_bgp = {}
# Verifying BGP convergence after bgp clear command
- for retry in range(44):
- sleeptime = 3
+ for retry in range(50):
+
# Waiting for BGP to converge
logger.info(
"Waiting for %s sec for BGP to converge on router" " %s...",
@@ -1615,8 +1617,8 @@ def clear_bgp_and_verify(tgen, topo, router):
)
else:
errormsg = (
- "TIMEOUT!! BGP is not converged in 30 seconds for"
- " router {}".format(router)
+ "TIMEOUT!! BGP is not converged in {} seconds for"
+ " router {}".format(retry * sleeptime, router)
)
return errormsg
@@ -2102,7 +2104,7 @@ def verify_best_path_as_per_bgp_attribute(
routes = generate_ips(_network, no_of_ip)
for route in routes:
- route = str(ipaddr.IPNetwork(unicode(route)))
+ route = str(ipaddress.ip_network(unicode(route)))
if route in sh_ip_bgp_json["routes"]:
route_attributes = sh_ip_bgp_json["routes"][route]
@@ -2411,7 +2413,7 @@ def verify_bgp_rib(tgen, addr_type, dut, input_dict, next_hop=None, aspath=None)
ip_list = generate_ips(network, no_of_ip)
for st_rt in ip_list:
- st_rt = str(ipaddr.IPNetwork(unicode(st_rt)))
+ st_rt = str(ipaddress.ip_network(unicode(st_rt)))
_addr_type = validate_ip_address(st_rt)
if _addr_type != addr_type:
@@ -2547,7 +2549,7 @@ def verify_bgp_rib(tgen, addr_type, dut, input_dict, next_hop=None, aspath=None)
ip_list = generate_ips(network, no_of_network)
for st_rt in ip_list:
- st_rt = str(ipaddr.IPNetwork(unicode(st_rt)))
+ st_rt = str(ipaddress.ip_network(unicode(st_rt)))
_addr_type = validate_ip_address(st_rt)
if _addr_type != addr_type:
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py
index 21ed47fc4b..d72d0aa223 100644
--- a/tests/topotests/lib/common_config.py
+++ b/tests/topotests/lib/common_config.py
@@ -36,7 +36,7 @@ import sys
import ConfigParser
import traceback
import socket
-import ipaddr
+import ipaddress
from lib.topolog import logger, logger_config
from lib.topogen import TopoRouter, get_topogen
@@ -690,6 +690,12 @@ def start_topology(tgen):
router_list = tgen.routers()
for rname in ROUTER_LIST:
router = router_list[rname]
+
+ # It will help in debugging the failures, will give more details on which
+ # specific kernel version tests are failing
+ linux_ver = router.run("uname -a")
+ logger.info("Logging platform related details: \n %s \n", linux_ver)
+
try:
os.chdir(TMPDIR)
@@ -1066,10 +1072,10 @@ def generate_ips(network, no_of_ips):
addr_type = validate_ip_address(start_ip)
if addr_type == "ipv4":
- start_ip = ipaddr.IPv4Address(unicode(start_ip))
+ start_ip = ipaddress.IPv4Address(unicode(start_ip))
step = 2 ** (32 - mask)
if addr_type == "ipv6":
- start_ip = ipaddr.IPv6Address(unicode(start_ip))
+ start_ip = ipaddress.IPv6Address(unicode(start_ip))
step = 2 ** (128 - mask)
next_ip = start_ip
@@ -1077,7 +1083,7 @@ def generate_ips(network, no_of_ips):
while count < no_of_ips:
ipaddress_list.append("{}/{}".format(next_ip, mask))
if addr_type == "ipv6":
- next_ip = ipaddr.IPv6Address(int(next_ip) + step)
+ next_ip = ipaddress.IPv6Address(int(next_ip) + step)
else:
next_ip += step
count += 1
@@ -2273,7 +2279,7 @@ def verify_rib(
nh_found = False
for st_rt in ip_list:
- st_rt = str(ipaddr.IPNetwork(unicode(st_rt)))
+ st_rt = str(ipaddress.ip_network(unicode(st_rt)))
_addr_type = validate_ip_address(st_rt)
if _addr_type != addr_type:
@@ -2469,7 +2475,7 @@ def verify_rib(
nh_found = False
for st_rt in ip_list:
- st_rt = str(ipaddr.IPNetwork(unicode(st_rt)))
+ st_rt = str(ipaddress.ip_network(unicode(st_rt)))
_addr_type = validate_ip_address(st_rt)
if _addr_type != addr_type:
diff --git a/tests/topotests/lib/topojson.py b/tests/topotests/lib/topojson.py
index 24b61981d6..9c2baedde4 100644
--- a/tests/topotests/lib/topojson.py
+++ b/tests/topotests/lib/topojson.py
@@ -21,7 +21,7 @@
from collections import OrderedDict
from json import dumps as json_dumps
from re import search as re_search
-import ipaddr
+import ipaddress
import pytest
# Import topogen and topotest helpers
@@ -65,12 +65,12 @@ def build_topo_from_json(tgen, topo):
listRouters.append(routerN)
if "ipv4base" in topo:
- ipv4Next = ipaddr.IPv4Address(topo["link_ip_start"]["ipv4"])
+ ipv4Next = ipaddress.IPv4Address(topo["link_ip_start"]["ipv4"])
ipv4Step = 2 ** (32 - topo["link_ip_start"]["v4mask"])
if topo["link_ip_start"]["v4mask"] < 32:
ipv4Next += 1
if "ipv6base" in topo:
- ipv6Next = ipaddr.IPv6Address(topo["link_ip_start"]["ipv6"])
+ ipv6Next = ipaddress.IPv6Address(topo["link_ip_start"]["ipv6"])
ipv6Step = 2 ** (128 - topo["link_ip_start"]["v6mask"])
if topo["link_ip_start"]["v6mask"] < 127:
ipv6Next += 1
@@ -181,7 +181,7 @@ def build_topo_from_json(tgen, topo):
destRouter_link_json["ipv6"] = "{}/{}".format(
ipv6Next + 1, topo["link_ip_start"]["v6mask"]
)
- ipv6Next = ipaddr.IPv6Address(int(ipv6Next) + ipv6Step)
+ ipv6Next = ipaddress.IPv6Address(int(ipv6Next) + ipv6Step)
logger.debug(
"Generated link data for router: %s\n%s",
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 22ed4b4d0f..bffb8208e7 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -1180,9 +1180,11 @@ class Router(Node):
def startRouterDaemons(self, daemons=None):
"Starts all FRR daemons for this router."
- bundle_data = subprocess.check_output(
- ["cat /etc/frr/support_bundle_commands.conf"], shell=True
- )
+ bundle_data = ''
+
+ if os.path.exists('/etc/frr/support_bundle_commands.conf'):
+ bundle_data = subprocess.check_output(
+ ["cat /etc/frr/support_bundle_commands.conf"], shell=True)
self.cmd(
"echo '{}' > /etc/frr/support_bundle_commands.conf".format(bundle_data)
)
diff --git a/tests/topotests/zebra_rib/r1/v4_route_1_static_override.json b/tests/topotests/zebra_rib/r1/v4_route_1_static_override.json
index aa9522aff6..22e199f9aa 100644
--- a/tests/topotests/zebra_rib/r1/v4_route_1_static_override.json
+++ b/tests/topotests/zebra_rib/r1/v4_route_1_static_override.json
@@ -10,7 +10,7 @@
"installed":true,
"table":254,
"internalStatus":16,
- "internalFlags":72,
+ "internalFlags":73,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthops":[