summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_fsm.c2
-rw-r--r--isisd/isis_misc.c8
-rw-r--r--isisd/isisd.c27
-rw-r--r--isisd/isisd.h2
-rw-r--r--lib/libfrr.c30
-rw-r--r--lib/libfrr.h2
-rw-r--r--lib/vty.c2
-rw-r--r--tests/isisd/test_isis_spf.c13
-rw-r--r--tests/topotests/all_protocol_startup/test_all_protocol_startup.py2
-rw-r--r--tests/topotests/babel_topo1/test_babel_topo1.py2
-rwxr-xr-xtests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py1
-rw-r--r--tests/topotests/bgp_6vpe_ebgp_topo1/test_bgp_6vpe_ebgp_topo1.py1
-rw-r--r--tests/topotests/bgp_addpath_paths_limit/test_bgp_addpath_paths_limit.py2
-rw-r--r--tests/topotests/bgp_aigp/test_bgp_aigp.py1
-rw-r--r--tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py3
-rw-r--r--tests/topotests/bgp_auth/bgp_auth_common.py13
-rw-r--r--tests/topotests/bgp_auth/test_bgp_auth1.py4
-rw-r--r--tests/topotests/bgp_auth/test_bgp_auth2.py4
-rw-r--r--tests/topotests/bgp_auth/test_bgp_auth3.py4
-rw-r--r--tests/topotests/bgp_auth/test_bgp_auth4.py4
-rw-r--r--tests/topotests/bgp_bmp/test_bgp_bmp.py1
-rw-r--r--tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py1
-rw-r--r--tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py1
-rw-r--r--tests/topotests/bgp_conditional_advertisement_static_route/test_bgp_conditional_advertisement_static_route.py3
-rw-r--r--tests/topotests/bgp_dampening_per_peer/test_bgp_dampening_per_peer.py1
-rw-r--r--tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py6
-rw-r--r--tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py16
-rw-r--r--tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py12
-rw-r--r--tests/topotests/bgp_default_originate/test_default_orginate_vrf.py18
-rw-r--r--tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py1
-rwxr-xr-xtests/topotests/bgp_distance_change/test_bgp_admin_dist.py9
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_addpath.py3
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_fqdn.py3
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py3
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_orf.py3
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py3
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py2
-rw-r--r--tests/topotests/bgp_ecmp_topo2/test_ibgp_ecmp_topo2.py5
-rw-r--r--tests/topotests/bgp_evpn_maximum_prefix/test_bgp_evpn_maximum_prefix.py3
-rw-r--r--tests/topotests/bgp_evpn_mh/test_evpn_mh.py2
-rwxr-xr-xtests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py2
-rw-r--r--tests/topotests/bgp_evpn_route_map_match/test_bgp_evpn_route_map_match.py4
-rw-r--r--tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py1
-rw-r--r--tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py3
-rw-r--r--tests/topotests/bgp_features/test_bgp_features.py1
-rw-r--r--tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py1
-rw-r--r--tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py2
-rw-r--r--tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py1
-rw-r--r--tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py3
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py5
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py4
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py5
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py7
-rw-r--r--tests/topotests/bgp_gr_functionality_topo3/test_bgp_gr_functionality_topo3.py24
-rw-r--r--tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_per_neighbor_restart_retain_routes.py2
-rw-r--r--tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py2
-rw-r--r--tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py2
-rw-r--r--tests/topotests/bgp_l3vpn_label_export/test_bgp_l3vpn_label_export.py2
-rw-r--r--tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py1
-rw-r--r--tests/topotests/bgp_llgr/test_bgp_llgr.py1
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py1
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py2
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py1
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py1
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py1
-rw-r--r--tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py1
-rw-r--r--tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py1
-rw-r--r--tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py2
-rw-r--r--tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py1
-rw-r--r--tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py6
-rw-r--r--tests/topotests/bgp_nexthop_mp_ipv4_6/test_nexthop_mp_ipv4_6.py1
-rw-r--r--tests/topotests/bgp_node_target_extcommunities/test_bgp_node_target_extcommunities.py2
-rw-r--r--tests/topotests/bgp_oad/test_bgp_oad.py4
-rw-r--r--tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py2
-rwxr-xr-xtests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py2
-rw-r--r--tests/topotests/bgp_redistribute_table/test_bgp_redistribute_table.py2
-rw-r--r--tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py1
-rw-r--r--tests/topotests/bgp_remove_private_as_route_map/test_bgp_remove_private_as_route_map.py3
-rw-r--r--tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py17
-rw-r--r--tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py11
-rw-r--r--tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py2
-rw-r--r--tests/topotests/bgp_route_map_match_source_protocol/test_bgp_route_map_match_source_protocol.py2
-rw-r--r--tests/topotests/bgp_route_map_match_tag_untagged/test_bgp_route_map_match_tag_untagged.py2
-rw-r--r--tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py1
-rw-r--r--tests/topotests/bgp_route_origin_parser/test_bgp_route_origin_parser.py1
-rw-r--r--tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py1
-rwxr-xr-xtests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py1
-rwxr-xr-xtests/topotests/bgp_srv6_sid_reachability/test_bgp_srv6_sid_reachability.py5
-rwxr-xr-xtests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py5
-rwxr-xr-xtests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py3
-rwxr-xr-xtests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py1
-rwxr-xr-xtests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py1
-rw-r--r--tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py1
-rw-r--r--tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py23
-rw-r--r--tests/topotests/bgp_tcp_mss_passive/test_bgp_tcp_mss_passive.py2
-rw-r--r--tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py1
-rw-r--r--tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py1
-rw-r--r--tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py2
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py4
-rw-r--r--tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py4
-rw-r--r--tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py6
-rw-r--r--tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py3
-rw-r--r--tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py2
-rw-r--r--tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py6
-rw-r--r--tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py6
-rw-r--r--tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py6
-rwxr-xr-xtests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py3
-rw-r--r--tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py2
-rw-r--r--tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py1
-rw-r--r--yang/ietf/frr-deviations-ietf-routing.yang3
110 files changed, 132 insertions, 327 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 76624fee9e..b67cf3b874 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1482,7 +1482,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection)
EVENT_OFF(connection->t_connect);
EVENT_OFF(connection->t_holdtime);
EVENT_OFF(connection->t_routeadv);
- EVENT_OFF(peer->connection->t_delayopen);
+ EVENT_OFF(connection->t_delayopen);
/* Clear input and output buffer. */
frr_with_mutex (&connection->io_mtx) {
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c
index e4ef6c8dfa..833d514341 100644
--- a/isisd/isis_misc.c
+++ b/isisd/isis_misc.c
@@ -370,18 +370,20 @@ const char *print_sys_hostname(const uint8_t *sysid)
struct isis_dynhn *dyn;
struct isis *isis = NULL;
struct listnode *node;
+ struct isis_area *area = NULL;
if (!sysid)
return "nullsysid";
/* For our system ID return our host name */
- isis = isis_lookup_by_sysid(sysid);
- if (isis && !CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+ area = isis_area_lookup_by_sysid(sysid);
+ if (area && area->dynhostname && !CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
return cmd_hostname_get();
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
+ area = isis_area_lookup_by_sysid(isis->sysid);
dyn = dynhn_find_by_id(isis, sysid);
- if (dyn)
+ if (area && area->dynhostname && dyn)
return dyn->hostname;
}
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 8db6295b66..e67f5fb1c8 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -272,7 +272,7 @@ void isis_area_del_circuit(struct isis_area *area, struct isis_circuit *circuit)
isis_csm_state_change(ISIS_DISABLE, circuit, area);
}
-static void delete_area_addr(void *arg)
+void isis_area_address_delete(void *arg)
{
struct iso_address *addr = (struct iso_address *)arg;
@@ -330,7 +330,7 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
area->circuit_list = list_new();
area->adjacency_list = list_new();
area->area_addrs = list_new();
- area->area_addrs->del = delete_area_addr;
+ area->area_addrs->del = isis_area_address_delete;
if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
@@ -471,6 +471,29 @@ struct isis_area *isis_area_lookup(const char *area_tag, vrf_id_t vrf_id)
return NULL;
}
+struct isis_area *isis_area_lookup_by_sysid(const uint8_t *sysid)
+{
+ struct isis_area *area;
+ struct listnode *node;
+ struct isis *isis;
+ struct iso_address *addr = NULL;
+
+ isis = isis_lookup_by_sysid(sysid);
+ if (isis == NULL)
+ return NULL;
+
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
+ if (listcount(area->area_addrs) > 0) {
+ addr = listgetdata(listhead(area->area_addrs));
+ if (!memcmp(addr->area_addr + addr->addr_len, sysid,
+ ISIS_SYS_ID_LEN))
+ return area;
+ }
+ }
+
+ return NULL;
+}
+
int isis_area_get(struct vty *vty, const char *area_tag)
{
struct isis_area *area;
diff --git a/isisd/isisd.h b/isisd/isisd.h
index f5042e4ad5..2ed7dd0f10 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -285,10 +285,12 @@ void isis_area_add_circuit(struct isis_area *area,
void isis_area_del_circuit(struct isis_area *area,
struct isis_circuit *circuit);
+void isis_area_address_delete(void *arg);
struct isis_area *isis_area_create(const char *, const char *);
struct isis_area *isis_area_lookup(const char *, vrf_id_t vrf_id);
struct isis_area *isis_area_lookup_by_vrf(const char *area_tag,
const char *vrf_name);
+struct isis_area *isis_area_lookup_by_sysid(const uint8_t *sysid);
int isis_area_get(struct vty *vty, const char *area_tag);
void isis_area_destroy(struct isis_area *area);
void isis_filter_update(struct access_list *access);
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 338a7d0340..328c6ec8b2 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -1051,7 +1051,17 @@ void frr_config_fork(void)
zlog_tls_buffer_init();
}
-void frr_vty_serv_start(void)
+static void frr_check_detach(void)
+{
+ if (nodetach_term || nodetach_daemon)
+ return;
+
+ if (daemon_ctl_sock != -1)
+ close(daemon_ctl_sock);
+ daemon_ctl_sock = -1;
+}
+
+void frr_vty_serv_start(bool check_detach)
{
/* allow explicit override of vty_path in the future
* (not currently set anywhere) */
@@ -1074,6 +1084,9 @@ void frr_vty_serv_start(void)
}
vty_serv_start(di->vty_addr, di->vty_port, di->vty_path);
+
+ if (check_detach)
+ frr_check_detach();
}
void frr_vty_serv_stop(void)
@@ -1084,16 +1097,6 @@ void frr_vty_serv_stop(void)
unlink(di->vty_path);
}
-static void frr_check_detach(void)
-{
- if (nodetach_term || nodetach_daemon)
- return;
-
- if (daemon_ctl_sock != -1)
- close(daemon_ctl_sock);
- daemon_ctl_sock = -1;
-}
-
static void frr_terminal_close(int isexit)
{
int nullfd;
@@ -1179,7 +1182,7 @@ void frr_run(struct event_loop *master)
char instanceinfo[64] = "";
if (!(di->flags & FRR_MANUAL_VTY_START))
- frr_vty_serv_start();
+ frr_vty_serv_start(false);
if (di->instance)
snprintf(instanceinfo, sizeof(instanceinfo), "instance %u ",
@@ -1217,7 +1220,8 @@ void frr_run(struct event_loop *master)
close(nullfd);
}
- frr_check_detach();
+ if (!(di->flags & FRR_MANUAL_VTY_START))
+ frr_check_detach();
}
/* end fixed stderr startup logging */
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 8018672c1a..3248670c83 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -202,7 +202,7 @@ extern void frr_config_fork(void);
extern void frr_run(struct event_loop *master);
extern void frr_detach(void);
-extern void frr_vty_serv_start(void);
+extern void frr_vty_serv_start(bool check_detach);
extern void frr_vty_serv_stop(void);
extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,
diff --git a/lib/vty.c b/lib/vty.c
index ecb5383a53..d0bbf0e61a 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -3502,7 +3502,7 @@ static void vty_mgmt_server_connected(struct mgmt_fe_client *client,
/* Start or stop listening for vty connections */
if (connected)
- frr_vty_serv_start();
+ frr_vty_serv_start(true);
else
frr_vty_serv_stop();
}
diff --git a/tests/isisd/test_isis_spf.c b/tests/isisd/test_isis_spf.c
index 6fe6993fdf..93009a1b84 100644
--- a/tests/isisd/test_isis_spf.c
+++ b/tests/isisd/test_isis_spf.c
@@ -245,12 +245,25 @@ static int test_run(struct vty *vty, const struct isis_topology *topology,
struct isis_area *area;
struct lfa_protected_resource protected_resource = {};
uint8_t fail_id[ISIS_SYS_ID_LEN] = {};
+ static char sysidstr[ISO_SYSID_STRLEN];
+ char net_title[255];
+ uint8_t buff[255];
+ struct iso_address *addr = NULL;
/* Init topology. */
area = isis_area_create("1", NULL);
memcpy(area->isis->sysid, root->sysid, sizeof(area->isis->sysid));
area->is_type = IS_LEVEL_1_AND_2;
area->srdb.enabled = true;
+ area->area_addrs = list_new();
+ area->area_addrs->del = isis_area_address_delete;
+ addr = XMALLOC(MTYPE_ISIS_AREA_ADDR, sizeof(struct iso_address));
+ snprintfrr(sysidstr, sizeof(sysidstr), "%pSY", area->isis->sysid);
+ snprintf(net_title, sizeof(net_title), "49.%s.00", sysidstr);
+ addr->addr_len = dotformat2buff(buff, net_title);
+ memcpy(addr->area_addr, buff, addr->addr_len);
+ addr->addr_len -= (ISIS_SYS_ID_LEN + ISIS_NSEL_LEN);
+ listnode_add(area->area_addrs, addr);
if (test_topology_load(topology, area, area->lspdb) != 0) {
vty_out(vty, "%% Failed to load topology\n");
return CMD_WARNING;
diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
index b4bc1e14ad..902343ce42 100644
--- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
+++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
@@ -38,7 +38,6 @@ from lib.common_config import (
required_linux_kernel_version,
)
-from lib.topolog import logger
import json
fatal_error = ""
@@ -153,7 +152,6 @@ def test_error_messages_vtysh():
print("\n\n** Check for error messages on VTYSH")
print("******************************************\n")
- failures = 0
for i in range(1, 2):
#
# First checking Standard Output
diff --git a/tests/topotests/babel_topo1/test_babel_topo1.py b/tests/topotests/babel_topo1/test_babel_topo1.py
index decf0c2a6f..13bbe5bd4e 100644
--- a/tests/topotests/babel_topo1/test_babel_topo1.py
+++ b/tests/topotests/babel_topo1/test_babel_topo1.py
@@ -15,7 +15,6 @@ test_babel_topo1.py: Testing BABEL
"""
import os
-import re
import sys
import pytest
import json
@@ -130,7 +129,6 @@ def test_zebra_ipv4_routingTable():
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
- failures = 0
router_list = tgen.routers().values()
for router in router_list:
assertmsg = "Zebra IPv4 Routing Table verification failed for router {}".format(
diff --git a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py
index b9e8b73c1d..6919371ac5 100755
--- a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py
+++ b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py
@@ -59,7 +59,6 @@ import os
import sys
import pytest
import json
-from time import sleep
from functools import partial
# Save the Current Working Directory to find configuration files.
diff --git a/tests/topotests/bgp_6vpe_ebgp_topo1/test_bgp_6vpe_ebgp_topo1.py b/tests/topotests/bgp_6vpe_ebgp_topo1/test_bgp_6vpe_ebgp_topo1.py
index cbed8f0896..477cfa206b 100644
--- a/tests/topotests/bgp_6vpe_ebgp_topo1/test_bgp_6vpe_ebgp_topo1.py
+++ b/tests/topotests/bgp_6vpe_ebgp_topo1/test_bgp_6vpe_ebgp_topo1.py
@@ -12,7 +12,6 @@ Test the FRR BGP 6VPE functionality
import os
import sys
import json
-import functools
from functools import partial
import pytest
diff --git a/tests/topotests/bgp_addpath_paths_limit/test_bgp_addpath_paths_limit.py b/tests/topotests/bgp_addpath_paths_limit/test_bgp_addpath_paths_limit.py
index b7a1cfbb27..fb863e454f 100644
--- a/tests/topotests/bgp_addpath_paths_limit/test_bgp_addpath_paths_limit.py
+++ b/tests/topotests/bgp_addpath_paths_limit/test_bgp_addpath_paths_limit.py
@@ -20,7 +20,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_aigp/test_bgp_aigp.py b/tests/topotests/bgp_aigp/test_bgp_aigp.py
index e3b32da164..b81c543297 100644
--- a/tests/topotests/bgp_aigp/test_bgp_aigp.py
+++ b/tests/topotests/bgp_aigp/test_bgp_aigp.py
@@ -29,7 +29,6 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py b/tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py
index c49a2e5384..537ccc9df6 100644
--- a/tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py
+++ b/tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py
@@ -28,7 +28,6 @@ Following tests are covered to test bgp allowas-in functionality:
import os
import sys
import time
-import json
import pytest
# Save the Current Working Directory to find configuration files.
@@ -59,7 +58,7 @@ from lib.bgp import (
create_router_bgp,
verify_bgp_rib,
)
-from lib.topojson import build_topo_from_json, build_config_from_json
+from lib.topojson import build_config_from_json
pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
diff --git a/tests/topotests/bgp_auth/bgp_auth_common.py b/tests/topotests/bgp_auth/bgp_auth_common.py
index 824498ef90..7ba3169caf 100644
--- a/tests/topotests/bgp_auth/bgp_auth_common.py
+++ b/tests/topotests/bgp_auth/bgp_auth_common.py
@@ -34,16 +34,9 @@ for bgp instances
import json
import os
-import platform
-import sys
-from time import sleep
-
-from lib import common_config, topotest
-from lib.common_config import (
- save_initial_config_on_routers,
- reset_with_new_configs,
-)
-from lib.topogen import Topogen, TopoRouter, get_topogen
+
+from lib import common_config
+from lib.topogen import get_topogen
CWD = os.path.dirname(os.path.realpath(__file__))
diff --git a/tests/topotests/bgp_auth/test_bgp_auth1.py b/tests/topotests/bgp_auth/test_bgp_auth1.py
index c19a740a92..b0389474d4 100644
--- a/tests/topotests/bgp_auth/test_bgp_auth1.py
+++ b/tests/topotests/bgp_auth/test_bgp_auth1.py
@@ -32,14 +32,12 @@ for bgp instances
"""
# pylint: disable=C0413
-import json
import os
import platform
import sys
-from time import sleep
import pytest
-from lib import common_config, topotest
+from lib import topotest
from lib.common_config import (
save_initial_config_on_routers,
reset_with_new_configs,
diff --git a/tests/topotests/bgp_auth/test_bgp_auth2.py b/tests/topotests/bgp_auth/test_bgp_auth2.py
index 2551c1c35b..2b8f4673ea 100644
--- a/tests/topotests/bgp_auth/test_bgp_auth2.py
+++ b/tests/topotests/bgp_auth/test_bgp_auth2.py
@@ -32,14 +32,12 @@ for bgp instances
"""
# pylint: disable=C0413
-import json
import os
import platform
import sys
-from time import sleep
import pytest
-from lib import common_config, topotest
+from lib import topotest
from lib.common_config import (
save_initial_config_on_routers,
reset_with_new_configs,
diff --git a/tests/topotests/bgp_auth/test_bgp_auth3.py b/tests/topotests/bgp_auth/test_bgp_auth3.py
index dc4f61d3c9..d103d8075d 100644
--- a/tests/topotests/bgp_auth/test_bgp_auth3.py
+++ b/tests/topotests/bgp_auth/test_bgp_auth3.py
@@ -32,14 +32,12 @@ for bgp instances
"""
# pylint: disable=C0413
-import json
import os
import platform
import sys
-from time import sleep
import pytest
-from lib import common_config, topotest
+from lib import topotest
from lib.common_config import (
save_initial_config_on_routers,
reset_with_new_configs,
diff --git a/tests/topotests/bgp_auth/test_bgp_auth4.py b/tests/topotests/bgp_auth/test_bgp_auth4.py
index afe4441e13..792aa80d50 100644
--- a/tests/topotests/bgp_auth/test_bgp_auth4.py
+++ b/tests/topotests/bgp_auth/test_bgp_auth4.py
@@ -32,14 +32,12 @@ for bgp instances
"""
# pylint: disable=C0413
-import json
import os
import platform
import sys
-from time import sleep
import pytest
-from lib import common_config, topotest
+from lib import topotest
from lib.common_config import (
save_initial_config_on_routers,
reset_with_new_configs,
diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp.py b/tests/topotests/bgp_bmp/test_bgp_bmp.py
index 02de805068..80e291b2bd 100644
--- a/tests/topotests/bgp_bmp/test_bgp_bmp.py
+++ b/tests/topotests/bgp_bmp/test_bgp_bmp.py
@@ -26,7 +26,6 @@ from functools import partial
from ipaddress import ip_network
import json
import os
-import platform
import pytest
import sys
diff --git a/tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py b/tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py
index e0c1b4953e..09091198a8 100644
--- a/tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py
+++ b/tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py
@@ -16,7 +16,6 @@ import os
import sys
import json
import functools
-from functools import partial
import pytest
# Save the Current Working Directory to find configuration files.
diff --git a/tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py b/tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py
index 324f53f3a6..82a67a0b84 100644
--- a/tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py
+++ b/tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py
@@ -171,7 +171,6 @@ def test_bgp_no_export_local_as_communities_p0(request):
)
for comm_type in ["no-export", "local-AS"]:
-
step("Create a route-map on R1 to set community as {}".format(comm_type))
seq_id = 10
diff --git a/tests/topotests/bgp_conditional_advertisement_static_route/test_bgp_conditional_advertisement_static_route.py b/tests/topotests/bgp_conditional_advertisement_static_route/test_bgp_conditional_advertisement_static_route.py
index e9114bdbab..ea0f53cc97 100644
--- a/tests/topotests/bgp_conditional_advertisement_static_route/test_bgp_conditional_advertisement_static_route.py
+++ b/tests/topotests/bgp_conditional_advertisement_static_route/test_bgp_conditional_advertisement_static_route.py
@@ -11,7 +11,6 @@ if we modify the prefix-lists.
"""
import os
-import re
import sys
import json
import pytest
@@ -24,7 +23,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
diff --git a/tests/topotests/bgp_dampening_per_peer/test_bgp_dampening_per_peer.py b/tests/topotests/bgp_dampening_per_peer/test_bgp_dampening_per_peer.py
index 2066d848d3..f8916e1c4d 100644
--- a/tests/topotests/bgp_dampening_per_peer/test_bgp_dampening_per_peer.py
+++ b/tests/topotests/bgp_dampening_per_peer/test_bgp_dampening_per_peer.py
@@ -6,7 +6,6 @@
#
import os
-import re
import sys
import json
import pytest
diff --git a/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py b/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py
index 75e66566b7..f4f874f942 100644
--- a/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py
+++ b/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py
@@ -17,7 +17,6 @@ import sys
import time
import pytest
import datetime
-from copy import deepcopy
from lib.topolog import logger
from time import sleep
@@ -214,7 +213,6 @@ def get_rib_route_uptime(tgen, addr_type, dut, input_dict):
logger.info("Entering lib API: get_rib_route_uptime()")
route_time = []
- out_route_dict = {}
router_list = tgen.routers()
for routerInput in input_dict.keys():
for router, rnode in router_list.items():
@@ -234,7 +232,6 @@ def get_rib_route_uptime(tgen, addr_type, dut, input_dict):
for static_route in static_routes:
if "vrf" in static_route and static_route["vrf"] is not None:
-
logger.info(
"[DUT: {}]: Verifying routes for VRF:"
" {}".format(router, static_route["vrf"])
@@ -307,7 +304,6 @@ def get_best_path_route_in_FIB(tgen, topo, dut, network):
on failure : return error message with boolean False
"""
is_ipv4_best_path_found = False
- is_ipv6_best_path_found = False
rnode = tgen.routers()[dut]
ipv4_show_bgp_json = run_frr_cmd(rnode, "sh ip bgp json ", isjson=True)
ipv6_show_bgp_json = run_frr_cmd(
@@ -1575,7 +1571,7 @@ def test_verify_default_originate_with_2way_ecmp_p2(request):
ipv_dict = get_best_path_route_in_FIB(tgen, topo, dut="r2", network=network)
dut_links = topo["routers"]["r1"]["links"]
active_interface = None
- for key, values in dut_links.items():
+ for key, _ in dut_links.items():
ipv4_address = dut_links[key]["ipv4"].split("/")[0]
ipv6_address = dut_links[key]["ipv6"].split("/")[0]
if ipv_dict["ipv4"] == ipv4_address and ipv_dict["ipv6"] == ipv6_address:
diff --git a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py
index 50a1938ae3..142b3e430f 100644
--- a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py
+++ b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py
@@ -18,8 +18,6 @@ import os
import sys
import time
import pytest
-from time import sleep
-from copy import deepcopy
from lib.topolog import logger
# pylint: disable=C0413
@@ -30,32 +28,18 @@ from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
- verify_graceful_restart,
create_router_bgp,
- verify_router_id,
modify_as_number,
- verify_as_numbers,
- clear_bgp_and_verify,
- clear_bgp,
verify_bgp_rib,
get_prefix_count_route,
get_dut_as_number,
verify_rib_default_route,
- verify_fib_default_route,
- verify_bgp_advertised_routes_from_neighbor,
- verify_bgp_received_routes_from_neighbor,
)
from lib.common_config import (
- interface_status,
verify_prefix_lists,
verify_fib_routes,
- kill_router_daemons,
- start_router_daemons,
- shutdown_bringup_interface,
step,
required_linux_kernel_version,
- stop_router,
- start_router,
create_route_maps,
create_prefix_lists,
get_frr_ipv6_linklocal,
diff --git a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py
index 4e8bda55cf..a6918916df 100644
--- a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py
+++ b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py
@@ -17,8 +17,6 @@ import os
import sys
import time
import pytest
-from time import sleep
-from copy import deepcopy
from lib.topolog import logger
# pylint: disable=C0413
@@ -31,13 +29,8 @@ from lib.bgp import (
verify_bgp_convergence,
verify_graceful_restart,
create_router_bgp,
- verify_router_id,
modify_as_number,
- verify_as_numbers,
- clear_bgp_and_verify,
- clear_bgp,
verify_bgp_rib,
- get_prefix_count_route,
get_dut_as_number,
verify_rib_default_route,
verify_fib_default_route,
@@ -45,16 +38,12 @@ from lib.bgp import (
verify_bgp_received_routes_from_neighbor,
)
from lib.common_config import (
- interface_status,
verify_prefix_lists,
verify_fib_routes,
kill_router_daemons,
start_router_daemons,
- shutdown_bringup_interface,
step,
required_linux_kernel_version,
- stop_router,
- start_router,
create_route_maps,
create_prefix_lists,
get_frr_ipv6_linklocal,
@@ -65,7 +54,6 @@ from lib.common_config import (
reset_config_on_routers,
create_static_routes,
check_router_status,
- delete_route_maps,
)
diff --git a/tests/topotests/bgp_default_originate/test_default_orginate_vrf.py b/tests/topotests/bgp_default_originate/test_default_orginate_vrf.py
index 4dedac5535..1506b02e5d 100644
--- a/tests/topotests/bgp_default_originate/test_default_orginate_vrf.py
+++ b/tests/topotests/bgp_default_originate/test_default_orginate_vrf.py
@@ -10,8 +10,6 @@ import os
import sys
import time
import pytest
-from time import sleep
-from copy import deepcopy
from lib.topolog import logger
# pylint: disable=C0413
@@ -22,32 +20,17 @@ from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
- verify_graceful_restart,
create_router_bgp,
- verify_router_id,
modify_as_number,
- verify_as_numbers,
- clear_bgp_and_verify,
- clear_bgp,
verify_bgp_rib,
get_prefix_count_route,
get_dut_as_number,
- verify_rib_default_route,
- verify_fib_default_route,
- verify_bgp_advertised_routes_from_neighbor,
- verify_bgp_received_routes_from_neighbor,
)
from lib.common_config import (
- interface_status,
verify_prefix_lists,
verify_rib,
- kill_router_daemons,
- start_router_daemons,
- shutdown_bringup_interface,
step,
required_linux_kernel_version,
- stop_router,
- start_router,
create_route_maps,
create_prefix_lists,
get_frr_ipv6_linklocal,
@@ -58,7 +41,6 @@ from lib.common_config import (
reset_config_on_routers,
create_static_routes,
check_router_status,
- delete_route_maps,
)
pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
diff --git a/tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py b/tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py
index f67a431c7e..97a7e62e7c 100644
--- a/tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py
+++ b/tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py
@@ -19,7 +19,6 @@ import os
import sys
import time
import pytest
-from copy import deepcopy
from lib.topolog import logger
# pylint: disable=C0413
diff --git a/tests/topotests/bgp_distance_change/test_bgp_admin_dist.py b/tests/topotests/bgp_distance_change/test_bgp_admin_dist.py
index 0bd3d2814b..0307ee2f4e 100755
--- a/tests/topotests/bgp_distance_change/test_bgp_admin_dist.py
+++ b/tests/topotests/bgp_distance_change/test_bgp_admin_dist.py
@@ -215,7 +215,6 @@ def test_bgp_admin_distance_ebgp_ecmp_p0():
step("Configure static route in R4 and R5, redistribute in bgp")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r4": {
"static_routes": [{"network": NETWORK[addr_type], "next_hop": "Null0"}]
@@ -228,7 +227,6 @@ def test_bgp_admin_distance_ebgp_ecmp_p0():
)
for addr_type in ADDR_TYPES:
-
input_dict = {
"r5": {
"static_routes": [{"network": NETWORK[addr_type], "next_hop": "Null0"}]
@@ -268,7 +266,6 @@ def test_bgp_admin_distance_ebgp_ecmp_p0():
step("Configure the static route in R3 (Dut).")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [
@@ -305,7 +302,6 @@ def test_bgp_admin_distance_ebgp_ecmp_p0():
step(" Configure the admin distance of 254 to static route in R3.")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [
@@ -571,7 +567,6 @@ def test_bgp_admin_distance_ebgp_ecmp_p0():
step("Reconfigure the static route without admin distance")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [
@@ -993,7 +988,6 @@ def test_bgp_admin_distance_ibgp_p0():
step("Configure static route Without any admin distance")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [{"network": NETWORK[addr_type], "next_hop": "Null0"}]
@@ -1009,7 +1003,6 @@ def test_bgp_admin_distance_ibgp_p0():
protocol = "static"
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [{"network": NETWORK[addr_type], "next_hop": "Null0"}]
@@ -1023,7 +1016,6 @@ def test_bgp_admin_distance_ibgp_p0():
step("Configure static route with admin distance of 253")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [
@@ -1086,7 +1078,6 @@ def test_bgp_admin_distance_ibgp_p0():
step("Delete the static route.")
for addr_type in ADDR_TYPES:
-
input_dict = {
"r3": {
"static_routes": [
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_addpath.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_addpath.py
index 4d7d46c3e8..91df89b1b5 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_addpath.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_addpath.py
@@ -14,7 +14,6 @@ T4: Disable Addpath capability and check if it's exchanged dynamically
"""
import os
-import re
import sys
import json
import pytest
@@ -27,7 +26,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
def setup_module(mod):
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_fqdn.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_fqdn.py
index 26fae17c5e..bf05ce8edd 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_fqdn.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_fqdn.py
@@ -10,7 +10,6 @@ Test if fqdn capability is exchanged dynamically.
"""
import os
-import re
import sys
import json
import pytest
@@ -23,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
index d67bfea45e..514b29cd70 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
@@ -12,7 +12,6 @@ via BGP dynamic capability.
"""
import os
-import re
import sys
import json
import pytest
@@ -25,7 +24,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_orf.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_orf.py
index 9e1f26f21e..39e7ded1e6 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_orf.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_orf.py
@@ -10,7 +10,6 @@ Test if ORF capability is adjusted dynamically.
"""
import os
-import re
import sys
import json
import pytest
@@ -23,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
index f6c1e25fd6..7d36634728 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
@@ -10,7 +10,6 @@ Test if role capability is exchanged dynamically.
"""
import os
-import re
import sys
import json
import pytest
@@ -23,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
index 128283bbc3..591fc5a817 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
@@ -23,7 +23,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
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 b347042dcf..5991f2e7ca 100644
--- a/tests/topotests/bgp_ecmp_topo2/test_ibgp_ecmp_topo2.py
+++ b/tests/topotests/bgp_ecmp_topo2/test_ibgp_ecmp_topo2.py
@@ -106,7 +106,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module :Failed \n Error:" " {}".format(
BGP_CONVERGENCE
@@ -153,7 +153,6 @@ def teardown_module():
def static_or_nw(tgen, topo, tc_name, test_type, dut):
-
if test_type == "redist_static":
input_dict_static = {
dut: {
@@ -363,7 +362,6 @@ def test_ecmp_remove_redistribute_static(request):
reset_config_on_routers(tgen)
static_or_nw(tgen, topo, tc_name, "redist_static", "r2")
for addr_type in ADDR_TYPES:
-
# Verifying RIB routes
dut = "r3"
protocol = "bgp"
@@ -406,7 +404,6 @@ def test_ecmp_remove_redistribute_static(request):
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
for addr_type in ADDR_TYPES:
-
# Verifying RIB routes
dut = "r3"
protocol = "bgp"
diff --git a/tests/topotests/bgp_evpn_maximum_prefix/test_bgp_evpn_maximum_prefix.py b/tests/topotests/bgp_evpn_maximum_prefix/test_bgp_evpn_maximum_prefix.py
index 5469eff144..876c205f19 100644
--- a/tests/topotests/bgp_evpn_maximum_prefix/test_bgp_evpn_maximum_prefix.py
+++ b/tests/topotests/bgp_evpn_maximum_prefix/test_bgp_evpn_maximum_prefix.py
@@ -6,7 +6,6 @@
#
import os
-import re
import sys
import json
import pytest
@@ -17,7 +16,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_evpn_mh/test_evpn_mh.py b/tests/topotests/bgp_evpn_mh/test_evpn_mh.py
index b033e9c2eb..ba2fb62661 100644
--- a/tests/topotests/bgp_evpn_mh/test_evpn_mh.py
+++ b/tests/topotests/bgp_evpn_mh/test_evpn_mh.py
@@ -455,7 +455,7 @@ def check_remote_es(esi, vtep_ips, dut_name, down_vteps):
else:
tor_ips_rack = tor_ips_rack_1
- for tor_name, tor_ip in tor_ips_rack.items():
+ for _, tor_ip in tor_ips_rack.items():
remote_ips.append(tor_ip)
# remove down VTEPs from the remote check list
diff --git a/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py b/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
index 603f069fe3..d441a256fd 100755
--- a/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
+++ b/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
@@ -241,7 +241,7 @@ def evpn_gateway_ip_show_op_check(trigger=" "):
expected_op = json.loads(open(expected_op_file).read())
test_func = partial(topotest.router_json_cmp, pe, command, expected_op)
- ret, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+ _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
assertmsg = '"{0}" JSON output mismatch for {1}'.format(name, command)
if result is not None:
return result, assertmsg
diff --git a/tests/topotests/bgp_evpn_route_map_match/test_bgp_evpn_route_map_match.py b/tests/topotests/bgp_evpn_route_map_match/test_bgp_evpn_route_map_match.py
index 2df0fd0e6c..36c79d6b2b 100644
--- a/tests/topotests/bgp_evpn_route_map_match/test_bgp_evpn_route_map_match.py
+++ b/tests/topotests/bgp_evpn_route_map_match/test_bgp_evpn_route_map_match.py
@@ -10,7 +10,6 @@ Test if route-map match by EVPN route-type works.
"""
import os
-import re
import sys
import json
import pytest
@@ -23,8 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
+from lib.topogen import Topogen, get_topogen
def setup_module(mod):
diff --git a/tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py b/tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py
index 5f6eb17261..e4d330e13c 100644
--- a/tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py
+++ b/tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py
@@ -25,7 +25,6 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.topolog import logger
from lib import topotest
diff --git a/tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py b/tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py
index e7058f5392..e9006b81c9 100644
--- a/tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py
+++ b/tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py
@@ -6,7 +6,6 @@
#
import os
-import re
import sys
import json
import pytest
@@ -17,7 +16,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_features/test_bgp_features.py b/tests/topotests/bgp_features/test_bgp_features.py
index 43f4905d41..0f5d9dea42 100644
--- a/tests/topotests/bgp_features/test_bgp_features.py
+++ b/tests/topotests/bgp_features/test_bgp_features.py
@@ -18,7 +18,6 @@ import functools
import os
import sys
import pytest
-import re
import time
# Save the Current Working Directory to find configuration files.
diff --git a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py
index 5e2b2f37b2..2e2c8119a2 100644
--- a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py
+++ b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py
@@ -102,7 +102,6 @@ from lib.bgp import (
verify_graceful_restart,
create_router_bgp,
verify_r_bit,
- verify_f_bit,
verify_bgp_convergence,
verify_bgp_convergence_from_running_config,
)
diff --git a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py
index 13c5ba538c..9f79c52e3a 100644
--- a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py
+++ b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py
@@ -117,8 +117,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- shutdown_bringup_interface,
- step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
)
diff --git a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py
index 1a8f8302ff..0873c24b7f 100644
--- a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py
+++ b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py
@@ -117,7 +117,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- shutdown_bringup_interface,
step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
diff --git a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py
index de4b94032c..710514b056 100644
--- a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py
+++ b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py
@@ -104,8 +104,6 @@ from lib.bgp import (
verify_bgp_rib,
verify_graceful_restart,
create_router_bgp,
- verify_r_bit,
- verify_f_bit,
verify_bgp_convergence,
verify_bgp_convergence_from_running_config,
)
@@ -120,7 +118,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- shutdown_bringup_interface,
step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py
index cb6bf56967..01ab10b82f 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py
@@ -94,13 +94,10 @@ from lib.bgp import (
verify_bgp_rib,
verify_graceful_restart,
create_router_bgp,
- verify_r_bit,
verify_eor,
- verify_f_bit,
verify_bgp_convergence,
verify_gr_address_family,
modify_bgp_config_when_bgpd_down,
- verify_graceful_restart_timers,
verify_bgp_convergence_from_running_config,
)
@@ -169,7 +166,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
BGP_CONVERGENCE
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py
index cf9a474a81..989d2d554a 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py
@@ -95,7 +95,6 @@ from lib.bgp import (
verify_graceful_restart,
create_router_bgp,
verify_r_bit,
- verify_eor,
verify_f_bit,
verify_bgp_convergence,
verify_gr_address_family,
@@ -114,7 +113,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
)
@@ -169,7 +167,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
BGP_CONVERGENCE
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
index 4746d71a32..05fb8bf796 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
@@ -98,9 +98,7 @@ from lib.bgp import (
verify_eor,
verify_f_bit,
verify_bgp_convergence,
- verify_gr_address_family,
modify_bgp_config_when_bgpd_down,
- verify_graceful_restart_timers,
verify_bgp_convergence_from_running_config,
)
@@ -114,7 +112,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
)
@@ -169,7 +166,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
BGP_CONVERGENCE
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
index 1c41df98e1..950733c3af 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
@@ -96,13 +96,9 @@ from lib.bgp import (
verify_bgp_rib,
verify_graceful_restart,
create_router_bgp,
- verify_r_bit,
verify_eor,
- verify_f_bit,
verify_bgp_convergence,
- verify_gr_address_family,
modify_bgp_config_when_bgpd_down,
- verify_graceful_restart_timers,
verify_bgp_convergence_from_running_config,
)
@@ -116,7 +112,6 @@ from lib.common_config import (
check_address_types,
write_test_footer,
check_router_status,
- step,
get_frr_ipv6_linklocal,
required_linux_kernel_version,
)
@@ -171,7 +166,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
BGP_CONVERGENCE
diff --git a/tests/topotests/bgp_gr_functionality_topo3/test_bgp_gr_functionality_topo3.py b/tests/topotests/bgp_gr_functionality_topo3/test_bgp_gr_functionality_topo3.py
index 593a8d6417..e24f31d862 100644
--- a/tests/topotests/bgp_gr_functionality_topo3/test_bgp_gr_functionality_topo3.py
+++ b/tests/topotests/bgp_gr_functionality_topo3/test_bgp_gr_functionality_topo3.py
@@ -12,7 +12,6 @@ import time
import pytest
from time import sleep
-import traceback
import ipaddress
# Save the Current Working Directory to find configuration files.
@@ -34,37 +33,21 @@ from lib.bgp import (
verify_bgp_rib,
verify_graceful_restart,
create_router_bgp,
- verify_r_bit,
- verify_eor,
- verify_f_bit,
verify_bgp_convergence,
- verify_gr_address_family,
- modify_bgp_config_when_bgpd_down,
- verify_graceful_restart_timers,
verify_bgp_convergence_from_running_config,
)
# Import common_config to use commomnly used APIs
from lib.common_config import (
- create_common_configuration,
- InvalidCLIError,
- retry,
generate_ips,
- FRRCFG_FILE,
- find_interface_with_greater_ip,
check_address_types,
validate_ip_address,
run_frr_cmd,
- get_frr_ipv6_linklocal,
)
from lib.common_config import (
write_test_header,
- reset_config_on_routers,
start_topology,
- kill_router_daemons,
- start_router_daemons,
- verify_rib,
check_address_types,
write_test_footer,
check_router_status,
@@ -154,9 +137,6 @@ def verify_stale_routes_list(tgen, addr_type, dut, input_dict):
"""
logger.debug("Entering lib API: verify_stale_routes_list()")
router_list = tgen.routers()
- additional_nexthops_in_required_nhs = []
- list1 = []
- list2 = []
found_hops = []
for routerInput in input_dict.keys():
for router, rnode in router_list.items():
@@ -266,7 +246,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
BGP_CONVERGENCE
@@ -442,7 +422,7 @@ def test_bgp_gr_stale_routes(request):
)
assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
- for iteration in range(5):
+ for _ in range(5):
step("graceful-restart-disable:True at R3")
input_dict = {
"r3": {
diff --git a/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_per_neighbor_restart_retain_routes.py b/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_per_neighbor_restart_retain_routes.py
index 2354c0cd3d..e61efefa5a 100644
--- a/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_per_neighbor_restart_retain_routes.py
+++ b/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_per_neighbor_restart_retain_routes.py
@@ -22,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step, stop_router
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py b/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py
index abf737ff34..d7ae43338a 100644
--- a/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py
+++ b/tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py
@@ -21,7 +21,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step, stop_router
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py
index 395ef2d919..803b51c043 100644
--- a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py
+++ b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py
@@ -23,7 +23,7 @@ sys.path.append(os.path.join(CWD, "../../"))
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import (
write_test_header,
diff --git a/tests/topotests/bgp_l3vpn_label_export/test_bgp_l3vpn_label_export.py b/tests/topotests/bgp_l3vpn_label_export/test_bgp_l3vpn_label_export.py
index 84a9c8b723..a0871a4922 100644
--- a/tests/topotests/bgp_l3vpn_label_export/test_bgp_l3vpn_label_export.py
+++ b/tests/topotests/bgp_l3vpn_label_export/test_bgp_l3vpn_label_export.py
@@ -146,7 +146,7 @@ def check_mpls_table(label, protocol):
if label == "auto" and protocol:
output_copy = deepcopy(output)
- for key, data in output_copy.items():
+ for _, data in output_copy.items():
for nexthop in data.get("nexthops", []):
if nexthop.get("type", None) != protocol:
continue
diff --git a/tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py b/tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py
index d1d384182c..009b39eef0 100644
--- a/tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py
+++ b/tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py
@@ -22,7 +22,6 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_llgr/test_bgp_llgr.py b/tests/topotests/bgp_llgr/test_bgp_llgr.py
index 2a3753e26c..547c998c2b 100644
--- a/tests/topotests/bgp_llgr/test_bgp_llgr.py
+++ b/tests/topotests/bgp_llgr/test_bgp_llgr.py
@@ -32,7 +32,6 @@ from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.common_config import (
kill_router_daemons,
- start_router_daemons,
step,
)
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py
index c84fce6a9d..214b24eed8 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py
@@ -25,7 +25,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py
index 8a1157052e..ce448329eb 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py
@@ -21,7 +21,6 @@ import os
import sys
import time
import pytest
-import platform
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -31,7 +30,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py
index 25c9bee93c..ff1a81472d 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py
@@ -39,7 +39,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py
index 0c10c6409f..5d290ce427 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py
@@ -31,7 +31,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py
index ea6ab59b3f..0c7e7cf5c1 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py
@@ -26,7 +26,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py b/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py
index b1204bf583..5a0f34132a 100644
--- a/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py
+++ b/tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py
@@ -24,7 +24,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py
index cfaab9bbe2..453f058223 100644
--- a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py
+++ b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py
@@ -38,7 +38,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py
index 6937a61c33..d52ed4c334 100644
--- a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py
+++ b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py
@@ -34,7 +34,6 @@ import os
import sys
import time
import pytest
-import platform
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -44,7 +43,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py
index bacef47664..4ee112ebbf 100644
--- a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py
+++ b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py
@@ -52,7 +52,6 @@ sys.path.append(os.path.join(CWD, "../lib/"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
from lib.common_config import (
start_topology,
diff --git a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
index 40a28fbcf4..012b643dde 100644
--- a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
+++ b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
@@ -1845,7 +1845,7 @@ def test_vrf_vlan_routing_table_p1(request):
dut = "r3"
vrf = "RED_A"
- for c_link, c_data in topo["routers"][dut]["links"].items():
+ for _, c_data in topo["routers"][dut]["links"].items():
if c_data["vrf"] != vrf:
continue
@@ -2634,7 +2634,7 @@ def test_delete_and_re_add_vrf_p1(request):
vrfs = ["RED_A", "BLUE_A"]
for vrf in vrfs:
- for c_link, c_data in topo["routers"][dut]["links"].items():
+ for _, c_data in topo["routers"][dut]["links"].items():
if c_data["vrf"] != vrf:
continue
@@ -3584,7 +3584,7 @@ def test_vrf_name_significance_p1(request):
vrfs = ["GREY_A", "PINK_A"]
for vrf in vrfs:
- for c_link, c_data in topo_modify["routers"][dut]["links"].items():
+ for _, c_data in topo_modify["routers"][dut]["links"].items():
if c_data["vrf"] != vrf:
continue
diff --git a/tests/topotests/bgp_nexthop_mp_ipv4_6/test_nexthop_mp_ipv4_6.py b/tests/topotests/bgp_nexthop_mp_ipv4_6/test_nexthop_mp_ipv4_6.py
index 911a6d757f..e1c28084de 100644
--- a/tests/topotests/bgp_nexthop_mp_ipv4_6/test_nexthop_mp_ipv4_6.py
+++ b/tests/topotests/bgp_nexthop_mp_ipv4_6/test_nexthop_mp_ipv4_6.py
@@ -12,7 +12,6 @@ Test BGP nexthop conformity with IPv4,6 MP-BGP over IPv4 peering
import os
import sys
import json
-import functools
from functools import partial
import pytest
diff --git a/tests/topotests/bgp_node_target_extcommunities/test_bgp_node_target_extcommunities.py b/tests/topotests/bgp_node_target_extcommunities/test_bgp_node_target_extcommunities.py
index b53673ad0f..32f78c44f9 100644
--- a/tests/topotests/bgp_node_target_extcommunities/test_bgp_node_target_extcommunities.py
+++ b/tests/topotests/bgp_node_target_extcommunities/test_bgp_node_target_extcommunities.py
@@ -24,7 +24,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_oad/test_bgp_oad.py b/tests/topotests/bgp_oad/test_bgp_oad.py
index bb779462db..6dd46fbdaa 100644
--- a/tests/topotests/bgp_oad/test_bgp_oad.py
+++ b/tests/topotests/bgp_oad/test_bgp_oad.py
@@ -11,7 +11,6 @@ EBGP-OAD is configured.
"""
import os
-import re
import sys
import json
import pytest
@@ -24,8 +23,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
+from lib.topogen import Topogen, get_topogen
def setup_module(mod):
diff --git a/tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py b/tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py
index bd8cd8e18a..adc92f59fe 100644
--- a/tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py
+++ b/tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py
@@ -23,7 +23,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
from lib.common_config import step
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py b/tests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py
index d6b94329e4..cf0c9fea2e 100755
--- a/tests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py
+++ b/tests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py
@@ -90,7 +90,7 @@ def test_r1_rib():
logger.info('[+] check {} "{}" {}'.format(name, cmd, expected_file))
tgen = get_topogen()
func = functools.partial(_check, name, cmd, expected_file)
- success, result = topotest.run_and_expect(func, None, count=10, wait=0.5)
+ _, result = topotest.run_and_expect(func, None, count=10, wait=0.5)
assert result is None, "Failed"
check("r1", "show bgp ipv6 vpn 2001:1::/64 json", "r1/vpnv6_rib_entry1.json")
diff --git a/tests/topotests/bgp_redistribute_table/test_bgp_redistribute_table.py b/tests/topotests/bgp_redistribute_table/test_bgp_redistribute_table.py
index 08b70ae0da..614610ccd6 100644
--- a/tests/topotests/bgp_redistribute_table/test_bgp_redistribute_table.py
+++ b/tests/topotests/bgp_redistribute_table/test_bgp_redistribute_table.py
@@ -86,7 +86,7 @@ def _router_json_cmp_exact_filter(router, cmd, expected):
json_output = json.loads(output)
# filter out tableVersion, version, nhVrfId and vrfId
- for route, attrs in json_output.items():
+ for _, attrs in json_output.items():
for attr in attrs:
if "table" in attr:
attr.pop("table")
diff --git a/tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py b/tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py
index 2d8864c34a..8b965a1614 100644
--- a/tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py
+++ b/tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py
@@ -32,7 +32,6 @@ All conditions are tested against an eBGP peer in a public ASN.
import os
import sys
import json
-import time
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
diff --git a/tests/topotests/bgp_remove_private_as_route_map/test_bgp_remove_private_as_route_map.py b/tests/topotests/bgp_remove_private_as_route_map/test_bgp_remove_private_as_route_map.py
index e3e4567aeb..10896e2b22 100644
--- a/tests/topotests/bgp_remove_private_as_route_map/test_bgp_remove_private_as_route_map.py
+++ b/tests/topotests/bgp_remove_private_as_route_map/test_bgp_remove_private_as_route_map.py
@@ -10,7 +10,6 @@ Test if private AS is removed from AS_PATH attribute when route-map is used (pre
"""
import os
-import re
import sys
import json
import pytest
@@ -23,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
def build_topo(tgen):
diff --git a/tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py b/tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py
index 29ff1065fd..9223cbd759 100644
--- a/tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py
+++ b/tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py
@@ -24,8 +24,7 @@ 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 lib.topogen import Topogen, TopoRouter
pytestmark = [pytest.mark.bgpd]
@@ -38,7 +37,7 @@ def tgen(request):
tgen = Topogen(topodef, request.module.__name__)
tgen.start_topology()
router_list = tgen.routers()
- for rname, router in router_list.items():
+ for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_BGP, "bgpd.conf")
tgen.start_router()
@@ -82,9 +81,7 @@ def test_correct_pair(tgen):
check_r2_established = functools.partial(
check_session_established, router, neighbor_ip
)
- success, _ = topotest.run_and_expect(
- check_r2_established, True, count=20, wait=3
- )
+ success, _ = topotest.run_and_expect(check_r2_established, True, count=20, wait=3)
assert success, "Session with r2 is not Established"
neighbor_status = find_neighbor_status(router, neighbor_ip)
@@ -111,9 +108,7 @@ def test_single_role_advertising(tgen):
check_r4_established = functools.partial(
check_session_established, router, neighbor_ip
)
- success, _ = topotest.run_and_expect(
- check_r4_established, True, count=20, wait=3
- )
+ success, _ = topotest.run_and_expect(check_r4_established, True, count=20, wait=3)
assert success, "Session with r4 is not Established"
neighbor_status = find_neighbor_status(router, neighbor_ip)
@@ -129,9 +124,7 @@ def test_single_role_receiving(tgen):
check_r1_established = functools.partial(
check_session_established, router, neighbor_ip
)
- success, _ = topotest.run_and_expect(
- check_r1_established, True, count=20, wait=3
- )
+ success, _ = topotest.run_and_expect(check_r1_established, True, count=20, wait=3)
assert success, "Session with r1 is not Established"
neighbor_status = find_neighbor_status(router, neighbor_ip)
diff --git a/tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py b/tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py
index a43518bc8a..ffbf454ded 100644
--- a/tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py
+++ b/tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py
@@ -16,7 +16,6 @@ test_bgp_roles_filtering: test leaks prevention and mitigation with roles
import json
import os
import sys
-import functools
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -24,9 +23,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.bgp import verify_bgp_convergence_from_running_config
-from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.topolog import logger
+from lib.topogen import Topogen, TopoRouter
pytestmark = [pytest.mark.bgpd]
@@ -39,7 +36,7 @@ def tgen(request):
tgen = Topogen(topodef, request.module.__name__)
tgen.start_topology()
router_list = tgen.routers()
- for rname, router in router_list.items():
+ for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_BGP, "bgpd.conf")
tgen.start_router()
@@ -69,9 +66,7 @@ def test_r10_routes(tgen):
]
return output == expected
- success, _ = topotest.run_and_expect(
- _routes_half_converged, True, count=20, wait=3
- )
+ success, _ = topotest.run_and_expect(_routes_half_converged, True, count=20, wait=3)
assert success, "Routes did not converged"
routes_with_otc = list()
diff --git a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
index d50d67b60e..94bf092c76 100644
--- a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
+++ b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
@@ -119,7 +119,7 @@ def setup_module(mod):
# Api call verify whether BGP is converged
ADDR_TYPES = check_address_types()
- for addr_type in ADDR_TYPES:
+ for _ in ADDR_TYPES:
BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
assert BGP_CONVERGENCE is True, "setup_module :Failed \n Error:" " {}".format(
BGP_CONVERGENCE
diff --git a/tests/topotests/bgp_route_map_match_source_protocol/test_bgp_route_map_match_source_protocol.py b/tests/topotests/bgp_route_map_match_source_protocol/test_bgp_route_map_match_source_protocol.py
index c766f5c1a8..7116deaea4 100644
--- a/tests/topotests/bgp_route_map_match_source_protocol/test_bgp_route_map_match_source_protocol.py
+++ b/tests/topotests/bgp_route_map_match_source_protocol/test_bgp_route_map_match_source_protocol.py
@@ -22,7 +22,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_route_map_match_tag_untagged/test_bgp_route_map_match_tag_untagged.py b/tests/topotests/bgp_route_map_match_tag_untagged/test_bgp_route_map_match_tag_untagged.py
index 7dd63fdac0..6ffa078f0c 100644
--- a/tests/topotests/bgp_route_map_match_tag_untagged/test_bgp_route_map_match_tag_untagged.py
+++ b/tests/topotests/bgp_route_map_match_tag_untagged/test_bgp_route_map_match_tag_untagged.py
@@ -17,7 +17,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py b/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py
index 5ce8b17f24..a6641348f7 100644
--- a/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py
+++ b/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py
@@ -24,7 +24,6 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_route_origin_parser/test_bgp_route_origin_parser.py b/tests/topotests/bgp_route_origin_parser/test_bgp_route_origin_parser.py
index 673efc2c73..16afda8bcc 100644
--- a/tests/topotests/bgp_route_origin_parser/test_bgp_route_origin_parser.py
+++ b/tests/topotests/bgp_route_origin_parser/test_bgp_route_origin_parser.py
@@ -11,7 +11,6 @@
import os
import sys
-import json
import pytest
import functools
diff --git a/tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py b/tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py
index 9984abaa85..5022a4a4a3 100644
--- a/tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py
+++ b/tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py
@@ -132,7 +132,6 @@ def test_zebra_ipv4_routingTable():
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
- failures = 0
router_list = tgen.routers().values()
for router in router_list:
output = router.vtysh_cmd("show ip route json", isjson=True)
diff --git a/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py b/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
index 0131e12579..09eef51338 100755
--- a/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
+++ b/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
@@ -325,7 +325,6 @@ def router_interface_get_ifindex(router, interface):
def generate_vrf_ifindex_oid(vrf, ifindex):
-
intoid = snmp_uint32_to_oid(int(ifindex))
vrfoid = snmp_str_to_oid(vrf)
oid = "{}.{}".format(vrfoid, intoid)
diff --git a/tests/topotests/bgp_srv6_sid_reachability/test_bgp_srv6_sid_reachability.py b/tests/topotests/bgp_srv6_sid_reachability/test_bgp_srv6_sid_reachability.py
index 92315bce04..f8385401c5 100755
--- a/tests/topotests/bgp_srv6_sid_reachability/test_bgp_srv6_sid_reachability.py
+++ b/tests/topotests/bgp_srv6_sid_reachability/test_bgp_srv6_sid_reachability.py
@@ -8,10 +8,7 @@
#
import os
-import re
import sys
-import json
-import functools
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -19,9 +16,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
# Import topogen and topotest helpers
-from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.topolog import logger
from lib.common_config import required_linux_kernel_version
from lib.checkping import check_ping
diff --git a/tests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py b/tests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py
index 14b9ba8498..0b52c87d27 100755
--- a/tests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py
+++ b/tests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py
@@ -9,10 +9,7 @@
#
import os
-import re
import sys
-import json
-import functools
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -20,9 +17,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
# Import topogen and topotest helpers
-from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.topolog import logger
from lib.common_config import required_linux_kernel_version
from lib.checkping import check_ping
diff --git a/tests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py b/tests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py
index f0c9144248..4bd5fdf165 100755
--- a/tests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py
+++ b/tests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py
@@ -6,10 +6,8 @@
#
import os
-import re
import sys
import json
-import functools
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -20,7 +18,6 @@ sys.path.append(os.path.join(CWD, "../"))
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-from lib.common_config import required_linux_kernel_version
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py b/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
index 787707cc0f..8d303a774b 100755
--- a/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
+++ b/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py
@@ -20,7 +20,6 @@
#
import os
-import re
import sys
import json
import functools
diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py
index 3e21875503..c47980744a 100755
--- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py
+++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py
@@ -9,7 +9,6 @@
#
import os
-import re
import sys
import json
import functools
diff --git a/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py b/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py
index fa8a88297f..f7ac827e26 100644
--- a/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py
+++ b/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py
@@ -15,7 +15,6 @@ import sys
import json
import pytest
from functools import partial
-from time import sleep
from lib.topolog import logger
CWD = os.path.dirname(os.path.realpath(__file__))
diff --git a/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py b/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py
index aeb9bf529d..4a03cb0a6d 100644
--- a/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py
+++ b/tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py
@@ -17,12 +17,7 @@ Need to verify if the tcp-mss value is reflected in the TCP session and in VRF.
import os
import sys
-import json
import pytest
-import functools
-import platform
-import socket
-import subprocess
# add after imports, before defining classes or functions:
pytestmark = [pytest.mark.bgpd]
@@ -31,43 +26,27 @@ 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.topogen import Topogen, get_topogen
from lib.topojson import build_config_from_json
-from lib.topolog import logger
import time
from lib.bgp import (
clear_bgp,
- clear_bgp_and_verify,
create_router_bgp,
- modify_as_number,
- verify_as_numbers,
verify_bgp_convergence,
verify_bgp_rib,
- verify_bgp_timers_and_functionality,
- verify_router_id,
verify_tcp_mss,
)
from lib.common_config import (
kill_router_daemons,
start_router_daemons,
- addKernelRoute,
apply_raw_config,
check_address_types,
check_router_status,
- create_prefix_lists,
- create_route_maps,
create_static_routes,
required_linux_kernel_version,
- reset_config_on_routers,
start_topology,
step,
- verify_admin_distance_for_static_routes,
- verify_bgp_community,
- verify_fib_routes,
- verify_rib,
write_test_footer,
- write_test_header,
)
# Global variables
diff --git a/tests/topotests/bgp_tcp_mss_passive/test_bgp_tcp_mss_passive.py b/tests/topotests/bgp_tcp_mss_passive/test_bgp_tcp_mss_passive.py
index a2eacc7ab2..44336efed2 100644
--- a/tests/topotests/bgp_tcp_mss_passive/test_bgp_tcp_mss_passive.py
+++ b/tests/topotests/bgp_tcp_mss_passive/test_bgp_tcp_mss_passive.py
@@ -21,7 +21,7 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topogen import Topogen, get_topogen
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py b/tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py
index 4d4e29b2f8..09b13e6a2f 100644
--- a/tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py
+++ b/tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py
@@ -27,7 +27,6 @@ pytestmark = [pytest.mark.bgpd]
def build_topo(tgen):
-
tgen.add_router("r1")
tgen.add_router("r2")
diff --git a/tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py b/tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py
index 695cfc3d25..08d6e140a1 100644
--- a/tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py
+++ b/tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py
@@ -22,7 +22,6 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
-from lib.common_config import step
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py b/tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py
index 8e2e4017df..5467cf4d84 100644
--- a/tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py
+++ b/tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py
@@ -312,7 +312,7 @@ def check_show_bgp_vpn_ok(router, vpnv4_entries):
return "{0}, {1}, route distinguisher not present".format(
router.name, prefix
)
- for rd, pathes in dump.items():
+ for _, pathes in dump.items():
for path in pathes["paths"]:
if "remoteLabel" not in path.keys():
return "{0}, {1}, remoteLabel not present".format(
diff --git a/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py b/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
index 037dd40390..6237decfc3 100644
--- a/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
+++ b/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
@@ -141,7 +141,7 @@ def router_json_cmp_exact_filter(router, cmd, expected):
# filter out tableVersion, version and nhVrfID
json_output.pop("tableVersion")
for rd, data in json_output["routes"]["routeDistinguishers"].items():
- for prefix, attrs in data.items():
+ for _, attrs in data.items():
for attr in attrs:
if "nhVrfId" in attr:
attr.pop("nhVrfId")
@@ -171,7 +171,7 @@ def router_vrf_json_cmp_exact_filter(router, cmd, expected):
data.pop("tableVersion")
if "routes" not in data:
continue
- for route, attrs in data["routes"].items():
+ for _, attrs in data["routes"].items():
for attr in attrs:
if "nhVrfId" in attr:
attr.pop("nhVrfId")
diff --git a/tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py b/tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py
index b017880545..cf1d3cb2b8 100644
--- a/tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py
+++ b/tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py
@@ -183,7 +183,7 @@ def bgp_vpnv4_table_check(router, group, label_list=None, label_value_expected=N
assert dump, "{0}, {1}, route distinguisher not present".format(
router.name, prefix
)
- for rd, pathes in dump.items():
+ for _, pathes in dump.items():
for path in pathes["paths"]:
assert (
"remoteLabel" in path.keys()
@@ -305,7 +305,7 @@ def mpls_table_check(router, blacklist=None, label_list=None, whitelist=None):
test_func = functools.partial(
check_show_mpls_table, router, blacklist, label_list, whitelist
)
- success, _ = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert success, "{}, MPLS labels check fail: {}".format(router.name, result)
diff --git a/tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py b/tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py
index 3879687aac..f8d26427eb 100644
--- a/tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py
+++ b/tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py
@@ -179,7 +179,7 @@ def bgp_vpnv6_table_check(router, group, label_list=None, label_value_expected=N
)
dump = router.vtysh_cmd("show bgp ipv6 vpn {} json".format(prefix), isjson=True)
- for rd, pathes in dump.items():
+ for _, pathes in dump.items():
for path in pathes["paths"]:
assert (
"remoteLabel" in path.keys()
@@ -300,7 +300,7 @@ def mpls_table_check(router, blacklist=None, label_list=None, whitelist=None):
test_func = functools.partial(
check_show_mpls_table, router, blacklist, label_list, whitelist
)
- success, _ = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert success, "{}, MPLS labels check fail: {}".format(router.name, result)
@@ -798,7 +798,7 @@ def test_reconfigure_allocation_mode_nexthop():
test_func = functools.partial(
check_show_mpls_table_entry_label_not_found, router, 17
)
- success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ success, _ = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert success, "r1, mpls entry with label 17 still present"
# Check vpnv6 routes from r1
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py b/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py
index 32643c27b8..8d73e5f8ac 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py
@@ -18,7 +18,6 @@ Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
import os
import sys
-import json
import time
import pytest
import platform
@@ -58,7 +57,7 @@ from lib.bgp import (
verify_best_path_as_per_bgp_attribute,
verify_bgp_rib,
)
-from lib.topojson import build_topo_from_json, build_config_from_json
+from lib.topojson import build_config_from_json
pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
index 726afcb6ae..25a73b58c7 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
@@ -23,7 +23,6 @@ import sys
import time
import pytest
import platform
-from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -49,7 +48,6 @@ from lib.common_config import (
create_static_routes,
create_prefix_lists,
create_bgp_community_lists,
- get_frr_ipv6_linklocal,
)
from lib.topolog import logger
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
index 45d7b0309e..53f0239c4d 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
@@ -24,7 +24,6 @@ import sys
import time
import pytest
import platform
-from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -46,18 +45,13 @@ from lib.common_config import (
reset_config_on_routers,
verify_rib,
step,
- create_route_maps,
create_static_routes,
- create_prefix_lists,
- create_bgp_community_lists,
- get_frr_ipv6_linklocal,
)
from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
create_router_bgp,
- verify_bgp_community,
verify_bgp_rib,
)
from lib.topojson import build_config_from_json
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
index d29edf59b8..7b0eac3f74 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
@@ -24,7 +24,6 @@ import sys
import time
import pytest
import platform
-from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -46,18 +45,13 @@ from lib.common_config import (
reset_config_on_routers,
verify_rib,
step,
- create_route_maps,
create_static_routes,
- create_prefix_lists,
- create_bgp_community_lists,
- get_frr_ipv6_linklocal,
)
from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
create_router_bgp,
- verify_bgp_community,
verify_bgp_rib,
)
from lib.topojson import build_config_from_json
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
index c118ffc090..ec7b25c7cc 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
@@ -24,7 +24,6 @@ import sys
import time
import pytest
import platform
-from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -46,18 +45,13 @@ from lib.common_config import (
reset_config_on_routers,
verify_rib,
step,
- create_route_maps,
create_static_routes,
- create_prefix_lists,
- create_bgp_community_lists,
- get_frr_ipv6_linklocal,
)
from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
create_router_bgp,
- verify_bgp_community,
verify_bgp_rib,
)
from lib.topojson import build_config_from_json
diff --git a/tests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py b/tests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py
index b20819264d..3539d06ac3 100755
--- a/tests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py
+++ b/tests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py
@@ -6,10 +6,8 @@
#
import os
-import re
import sys
import json
-import functools
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -20,7 +18,6 @@ sys.path.append(os.path.join(CWD, "../"))
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-from lib.common_config import required_linux_kernel_version
pytestmark = [pytest.mark.bgpd]
diff --git a/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py b/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py
index f3521969d3..3790446dc9 100644
--- a/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py
+++ b/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py
@@ -49,9 +49,7 @@ from lib.topolog import logger
from lib.bgp import (
verify_bgp_convergence,
create_router_bgp,
- verify_bgp_community,
verify_bgp_rib,
- clear_bgp,
verify_best_path_as_per_bgp_attribute,
)
from lib.topojson import build_config_from_json
diff --git a/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py b/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py
index 3cb31809fe..262cacd147 100644
--- a/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py
+++ b/tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py
@@ -19,7 +19,6 @@ import sys
import time
import pytest
import platform
-from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
diff --git a/yang/ietf/frr-deviations-ietf-routing.yang b/yang/ietf/frr-deviations-ietf-routing.yang
index 15ceb6b929..5c0ae30bea 100644
--- a/yang/ietf/frr-deviations-ietf-routing.yang
+++ b/yang/ietf/frr-deviations-ietf-routing.yang
@@ -6,6 +6,9 @@ module frr-deviations-ietf-routing {
import ietf-routing {
prefix ietf-routing;
}
+ import ietf-rip {
+ prefix ietf-rip;
+ }
organization
"FRRouting";