2 # SPDX-License-Identifier: ISC
5 # Copyright (c) 2021 by VMware, Inc. ("VMware")
6 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
7 # ("NetDEF") in this file.
11 """RFC5549 Automation."""
16 from copy
import deepcopy
18 # Save the Current Working Directory to find configuration files.
19 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
20 sys
.path
.append(os
.path
.join(CWD
, "../"))
21 sys
.path
.append(os
.path
.join(CWD
, "../../"))
23 # pylint: disable=C0413
24 # Import topogen and topotest helpers
25 from lib
.topogen
import Topogen
, get_topogen
27 from lib
.common_config
import (
35 reset_config_on_routers
,
38 get_frr_ipv6_linklocal
,
40 from lib
.topolog
import logger
42 verify_bgp_convergence
,
46 from lib
.topojson
import build_config_from_json
48 pytestmark
= [pytest
.mark
.bgpd
, pytest
.mark
.staticd
]
61 "ipv6": ["1::1/128", "1::2/128", "1::3/128", "1::4/128", "1::5/128"],
63 MASK
= {"ipv4": "32", "ipv6": "128"}
65 "ipv4": ["10.0.0.1", "10.0.1.1", "10.0.2.1", "10.0.3.1", "10.0.4.1"],
66 "ipv6": ["Null0", "Null0", "Null0", "Null0", "Null0"],
68 NETWORK_CMD_IP
= "1.0.1.17/32"
71 Please view in a fixed-width font such as Courier.
80 +----+ 5links +----+ +--+-+ +----+
81 |R0 +----------+ R1 | | R2 | ipv6 nbr |R3 |
82 | +----------+ +------------+ +-------------+ |
83 +----+ +----+ ipv6 nbr +----+ +----+
87 1. Verify IPv4 and IPv6 routes advertise using "redistribute static"
88 and "network command" are received on IBGP peer with IPv6 nexthop
89 2. Verify IPv4 routes are advertised and withdrawn when IPv6 IBGP session
90 established using loopback interface
91 3. Verify IPv4 routes are advertised to peer when static routes are
92 configured with ADMIN distance and tag option
93 4. Verify IPv4 routes advertised to peer when BGP session established
94 using link-local address
98 def setup_module(mod
):
99 """Set up the pytest environment."""
102 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
103 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
104 logger
.info("=" * 40)
106 logger
.info("Running setup_module to create topology")
108 # This function initiates the topology build with Topogen...
109 json_file
= "{}/rfc5549_ibgp_nbr.json".format(CWD
)
110 tgen
= Topogen(json_file
, mod
.__name
__)
112 topo
= tgen
.json_topo
114 # Starting topology, create tmp files which are loaded to routers
115 # to start daemons and then start routers
118 # Creating configuration from JSON
119 build_config_from_json(tgen
, topo
)
120 # Don't run this test if we have any failure.
121 if tgen
.routers_have_failure():
122 pytest
.skip(tgen
.errors
)
124 BGP_CONVERGENCE
= verify_bgp_convergence(tgen
, topo
)
125 assert BGP_CONVERGENCE
is True, "setup_module :Failed \n Error:" " {}".format(
128 logger
.info("Running setup_module() done")
131 def teardown_module():
132 """Teardown the pytest environment."""
133 logger
.info("Running teardown_module to delete topology")
137 # Stop toplogy and Remove tmp files
141 def get_llip(onrouter
, intf
):
143 API to get the link local ipv6 address of a particular interface
147 * `fromnode`: Source node
148 * `tonode` : interface for which link local ip needs to be returned.
152 result = get_llip('r1', 'r2-link0')
156 1) link local ipv6 address from the interface.
157 2) errormsg - when link local ip not found.
160 intf
= topo
["routers"][onrouter
]["links"][intf
]["interface"]
161 llip
= get_frr_ipv6_linklocal(tgen
, onrouter
, intf
)
164 logger
.info("llip ipv6 address to be set as NH is %s", llip
)
169 def get_glipv6(onrouter
, intf
):
171 API to get the global ipv6 address of a particular interface
175 * `onrouter`: Source node
176 * `intf` : interface for which link local ip needs to be returned.
180 result = get_glipv6('r1', 'r2-link0')
184 1) global ipv6 address from the interface.
185 2) errormsg - when link local ip not found.
187 glipv6
= (topo
["routers"][onrouter
]["links"][intf
]["ipv6"]).split("/")[0]
189 logger
.info("Global ipv6 address to be set as NH is %s", glipv6
)
194 # ##################################
195 # Test cases start here.
196 # ##################################
199 def test_ext_nh_cap_red_static_network_ibgp_peer_p1(request
):
202 Test extended capability nexthop with ibgp peer.
204 Verify IPv4 and IPv6 routes advertise using "redistribute static"
205 and "network command" are received on IBGP peer with IPv6 nexthop
207 tc_name
= request
.node
.name
208 write_test_header(tc_name
)
210 # Don't run this test if we have any failure.
211 if tgen
.routers_have_failure():
212 pytest
.skip(tgen
.errors
)
213 reset_config_on_routers(tgen
)
215 "Configure IPv6 EBGP session between R1 and R2 with global IPv6"
216 " address Enable capability extended-nexthop on the nbr from both"
220 "Change ebgp to ibgp nbrs between r1 and r2 , Activate same IPv6"
221 " nbr from IPv4 unicast family "
225 " Configure 5 IPv4 static routes"
226 " on R1 nexthop for static route exists on different link of R0"
229 for rte
in range(0, NO_OF_RTES
):
230 # Create Static routes
235 "network": NETWORK
["ipv4"][rte
],
237 "next_hop": NEXT_HOP
["ipv4"][rte
],
242 result
= create_static_routes(tgen
, input_dict
)
243 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
247 "Advertise static routes from IPv4 unicast family and IPv6 unicast"
248 " family respectively from R1.Configure loopback on R1 with IPv4 addr"
249 " & Advertise loopback from IPv4 unicast family using network cmd "
252 # this test case needs ipv6 routes to be configured
253 configure_bgp_on_r1
= {
259 "redistribute": [{"redist_type": "static"}],
260 "advertise_networks": [
261 {"network": NETWORK_CMD_IP
, "no_of_network": 1}
265 "ipv6": {"unicast": {"redistribute": [{"redist_type": "static"}]}},
270 result
= create_router_bgp(tgen
, topo
, configure_bgp_on_r1
)
271 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
273 glip
= get_llip("r1", "r2-link0")
274 assert glip
is not None, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
277 "IPv4 and IPv6 routes advertised using static & network command are"
278 "received on R2 BGP and routing table , verify using show ip bgp"
279 "show ip route for IPv4 routes and show bgp, show ipv6 routes"
285 # verify the routes with nh as ext_nh
286 verify_nh_for_static_rtes
= {
290 "network": NETWORK
["ipv4"][0],
291 "no_of_ip": NO_OF_RTES
,
297 bgp_rib
= verify_bgp_rib(
298 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=glip
300 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
302 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=glip
, protocol
=protocol
304 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
307 "Verify IPv4 routes are installed with IPv6 global nexthop of R1"
308 "R1 to R2 connected link"
310 verify_nh_for_nw_cmd_rtes
= {
314 "network": NETWORK_CMD_IP
,
321 bgp_rib
= verify_bgp_rib(
322 tgen
, "ipv4", dut
, verify_nh_for_nw_cmd_rtes
, next_hop
=glip
324 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
326 tgen
, "ipv4", dut
, verify_nh_for_nw_cmd_rtes
, next_hop
=glip
, protocol
=protocol
328 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
330 write_test_footer(tc_name
)
333 def test_ext_nh_cap_admin_dist_tag_ibgp_peer_p1(request
):
336 Test extended capability nexthop with admin distance and route tag.
338 Verify IPv4 routes are advertised to peer when static routes
339 are configured with ADMIN distance and tag option
341 tc_name
= request
.node
.name
342 write_test_header(tc_name
)
344 # Don't run this test if we have any failure.
345 if tgen
.routers_have_failure():
346 pytest
.skip(tgen
.errors
)
347 reset_config_on_routers(tgen
)
349 "Configure IPv6 EBGP session between R1 and R2 with global IPv6"
350 " address Enable capability extended-nexthop on the nbr from both"
354 "Change ebgp to ibgp nbrs between r1 and r2 , Activate same IPv6"
355 " nbr from IPv4 unicast family "
358 " Configure 5 IPv4 static routes"
359 " on R1 nexthop for static route exists on different link of R0"
362 for rte
in range(0, NO_OF_RTES
):
364 # Create Static routes
369 "network": NETWORK
["ipv4"][rte
],
371 "next_hop": NEXT_HOP
["ipv4"][rte
],
372 "admin_distance": 100 + count
,
378 result
= create_static_routes(tgen
, input_dict
)
379 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
383 "Advertise static routes from IPv4 unicast family & IPv6 unicast"
384 " family respectively from R1.Configure loopback on R1 with IPv4 "
385 "address & Advertise loopback from IPv4 unicast family "
386 "using network cmd from R1"
388 configure_bgp_on_r1
= {
392 "ipv4": {"unicast": {"redistribute": [{"redist_type": "static"}]}}
397 result
= create_router_bgp(tgen
, topo
, configure_bgp_on_r1
)
398 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
400 glip
= get_llip("r1", "r2-link0")
401 assert glip
is not None, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
404 "IPv4 and IPv6 routes advertised using static & network cmd are"
405 "received on R2 BGP and routing table , verify using show ip bgp"
406 "show ip route for IPv4 routes and show bgp, show ipv6 routes"
413 # verify the routes with nh as ext_nh
414 verify_nh_for_static_rtes
= {
418 "network": NETWORK
["ipv4"][0],
419 "no_of_ip": NO_OF_RTES
,
421 "admin_distance": 100 + count
,
427 bgp_rib
= verify_bgp_rib(
428 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=glip
430 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
432 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=glip
, protocol
=protocol
434 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
436 for rte
in range(0, NO_OF_RTES
):
446 "network": NETWORK
["ipv4"][rte
],
453 result
= create_prefix_lists(tgen
, input_dict_2
)
454 assert result
is True, "Testcase {} : Failed \n " "Error: {}".format(
462 "rmap_match_tag_1_{}".format("ipv4"): [
466 "ipv4": {"prefix_lists": "pf_list_1_{}".format("ipv4")}
473 result
= create_route_maps(tgen
, input_dict_6
)
474 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
478 # Configure neighbor for route map
491 "name": "rmap_match_tag_1_ipv4",
506 result
= create_router_bgp(tgen
, topo
, input_dict_7
)
507 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
511 write_test_footer(tc_name
)
514 def test_ibgp_loopback_nbr_p1(request
):
516 Verify Extended capability nexthop with loopback interface.
518 Verify IPv4 routes are advertised and withdrawn when IPv6 IBGP
519 session established using loopback interface
521 tc_name
= request
.node
.name
522 write_test_header(tc_name
)
524 # Don't run this test if we have any failure.
525 if tgen
.routers_have_failure():
526 pytest
.skip(tgen
.errors
)
528 topo1
= deepcopy(topo
)
529 reset_config_on_routers(tgen
)
530 step("Configure IPv6 global address between R1 and R2")
532 "Configure loopback on R1 and R2 and establish EBGP session "
533 "between R1 and R2 over loopback global ip"
535 step("Configure static route on R1 and R2 for loopback reachability")
536 step("Enable cap ext nh on r1 and r2 and activate in ipv4 addr family")
538 for routerN
in ["r1", "r2"]:
539 for addr_type
in ["ipv6"]:
540 for bgp_neighbor
in topo1
["routers"][routerN
]["bgp"]["address_family"][
542 ]["unicast"]["neighbor"].keys():
543 # Adding ['source_link'] = 'lo' key:value pair
544 if bgp_neighbor
== "r1" or bgp_neighbor
== "r2":
545 topo1
["routers"][routerN
]["bgp"]["address_family"][addr_type
][
547 ]["neighbor"][bgp_neighbor
]["dest_link"] = {
551 "capability": "extended-nexthop",
555 # Creating configuration from JSON
556 build_config_from_json(tgen
, topo1
, save_bkup
=False)
558 configure_bgp_on_r1
= {
566 "dest_link": {"r1-link0": {"deactivate": "ipv6"}}
575 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
576 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
578 configure_bgp_on_r2
= {
586 "dest_link": {"r2-link0": {"deactivate": "ipv6"}}
595 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r2
)
596 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
598 configure_bgp_on_r1
= {
606 "dest_link": {"r1-link0": {"deactivate": "ipv4"}}
615 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
616 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
618 configure_bgp_on_r2
= {
626 "dest_link": {"r2-link0": {"deactivate": "ipv4"}}
635 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r2
)
636 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
637 r2_lo_v4
= topo
["routers"]["r2"]["links"]["lo"]["ipv4"]
638 r2_lo_v6
= topo
["routers"]["r2"]["links"]["lo"]["ipv6"]
639 r1_lo_v4
= topo
["routers"]["r1"]["links"]["lo"]["ipv4"]
640 r1_lo_v6
= topo
["routers"]["r1"]["links"]["lo"]["ipv6"]
641 r1_r2_intf
= topo
["routers"]["r1"]["links"]["r2-link0"]["interface"]
642 r2_r1_intf
= topo
["routers"]["r2"]["links"]["r1-link0"]["interface"]
644 r1_r2_v6_nh
= topo
["routers"]["r1"]["links"]["r2-link0"]["ipv6"].split("/")[0]
645 r2_r1_v6_nh
= topo
["routers"]["r2"]["links"]["r1-link0"]["ipv6"].split("/")[0]
647 ipv4_list
= [("r1", r1_r2_intf
, [r2_lo_v4
]), ("r2", r2_r1_intf
, [r1_lo_v4
])]
650 ("r1", r1_r2_intf
, [r2_lo_v6
], r2_r1_v6_nh
),
651 ("r2", r2_r1_intf
, [r1_lo_v6
], r1_r2_v6_nh
),
654 for dut
, intf
, loop_addr
in ipv4_list
:
655 result
= addKernelRoute(tgen
, dut
, intf
, loop_addr
)
656 # assert result is True, "Testcase {}:Failed \n Error: {}". \
657 # format(tc_name, result)
659 for dut
, intf
, loop_addr
, next_hop
in ipv6_list
:
660 result
= addKernelRoute(tgen
, dut
, intf
, loop_addr
, next_hop
)
661 # assert result is True, "Testcase {}:Failed \n Error: {}". \
662 # format(tc_name, result)
664 r2_lo_v4
= topo
["routers"]["r2"]["links"]["lo"]["ipv4"]
665 r2_lo_v6
= topo
["routers"]["r2"]["links"]["lo"]["ipv6"]
666 r1_lo_v4
= topo
["routers"]["r1"]["links"]["lo"]["ipv4"]
667 r1_lo_v6
= topo
["routers"]["r1"]["links"]["lo"]["ipv6"]
668 r1_r2_intf
= topo
["routers"]["r1"]["links"]["r2-link0"]["interface"]
669 r2_r1_intf
= topo
["routers"]["r2"]["links"]["r1-link0"]["interface"]
671 r1_r2_v6_nh
= topo
["routers"]["r1"]["links"]["r2-link0"]["ipv6"].split("/")[0]
672 r2_r1_v6_nh
= topo
["routers"]["r2"]["links"]["r1-link0"]["ipv6"].split("/")[0]
674 r1_r2_v4_nh
= topo
["routers"]["r1"]["links"]["r2-link0"]["ipv4"].split("/")[0]
675 r2_r1_v4_nh
= topo
["routers"]["r2"]["links"]["r1-link0"]["ipv4"].split("/")[0]
680 {"network": r2_lo_v4
, "next_hop": r2_r1_v4_nh
},
681 {"network": r2_lo_v6
, "next_hop": r2_r1_v6_nh
},
686 {"network": r1_lo_v4
, "next_hop": r1_r2_v4_nh
},
687 {"network": r1_lo_v6
, "next_hop": r1_r2_v6_nh
},
691 result
= create_static_routes(tgen
, input_dict
)
692 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
694 # Api call verify whether BGP is converged
695 result
= verify_bgp_convergence(tgen
, topo1
)
696 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
698 step("Enable cap ext nh on r1 and r2 and activate in ipv4 addr family")
699 configure_bgp_on_r1
= {
701 "default_ipv4_unicast": False,
711 "capability": "extended-nexthop",
722 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
723 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
725 configure_bgp_on_r2
= {
727 "default_ipv4_unicast": False,
737 "capability": "extended-nexthop",
748 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r2
)
749 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
751 step("Verify bgp convergence.")
752 bgp_convergence
= verify_bgp_convergence(tgen
, topo1
)
753 assert bgp_convergence
is True, "Testcase {} : Failed \n Error: {}".format(
754 tc_name
, bgp_convergence
757 step("Configure 2 IPv4 static" " routes on R1, Nexthop as different links of R0")
759 for rte
in range(0, NO_OF_RTES
):
760 # Create Static routes
765 "network": NETWORK
["ipv4"][rte
],
767 "next_hop": NEXT_HOP
["ipv4"][rte
],
772 result
= create_static_routes(tgen
, input_dict
)
773 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
778 "Advertise static routes from IPv4 unicast family and IPv6 "
779 "unicast family respectively from R1 using red static cmd "
780 "Advertise loopback from IPv4 unicast family using network command "
784 configure_bgp_on_r1
= {
790 "redistribute": [{"redist_type": "static"}],
791 "advertise_networks": [
792 {"network": NETWORK_CMD_IP
, "no_of_network": 1}
800 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
801 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
804 "IPv4 routes advertised using static and network command are "
805 " received on R2 BGP and routing table , "
806 "verify using show ip bgp, show ip route for IPv4 routes ."
809 gllip
= (topo1
["routers"]["r1"]["links"]["lo"]["ipv6"].split("/")[0]).lower()
810 assert gllip
is not None, "Testcase {} : Failed \n Error: {}".format(
816 verify_nh_for_static_rtes
= {
820 "network": NETWORK
["ipv4"][0],
821 "no_of_ip": NO_OF_RTES
,
827 bgp_rib
= verify_bgp_rib(
828 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=gllip
830 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
832 tgen
, "ipv4", dut
, verify_nh_for_static_rtes
, next_hop
=gllip
, protocol
=protocol
834 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
836 verify_nh_for_nw_rtes
= {
839 {"network": NETWORK_CMD_IP
, "no_of_ip": 1, "next_hop": gllip
}
843 bgp_rib
= verify_bgp_rib(tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
)
844 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
846 tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
, protocol
=protocol
848 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
851 "Remove IPv4 routes advertised using network command"
852 " from R1 and advertise again"
855 configure_bgp_on_r1
= {
861 "redistribute": [{"redist_type": "static"}],
862 "advertise_networks": [
864 "network": NETWORK_CMD_IP
,
875 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
876 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
878 configure_bgp_on_r1
= {
884 "redistribute": [{"redist_type": "static"}],
885 "advertise_networks": [
887 "network": NETWORK_CMD_IP
,
897 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
898 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
900 "After removing IPv4 routes from network command , routes which are "
901 "advertised using redistribute static are still present in the on "
902 "R2 , verify using show ip bgp and show ip route"
905 verify_nh_for_nw_rtes
= {
908 {"network": NETWORK_CMD_IP
, "no_of_ip": 1, "next_hop": gllip
}
912 bgp_rib
= verify_bgp_rib(tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
)
913 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
915 tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
, protocol
=protocol
917 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
920 "Remove IPv4 routes advertised using redistribute static"
921 " command from R1 and advertise again"
924 configure_bgp_on_r1
= {
930 "redistribute": [{"redist_type": "static", "delete": True}]
937 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
938 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
940 configure_bgp_on_r1
= {
944 "ipv4": {"unicast": {"redistribute": [{"redist_type": "static"}]}}
949 result
= create_router_bgp(tgen
, topo1
, configure_bgp_on_r1
)
950 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
952 "After removing IPv4 routes from redistribute static , routes which"
953 " are advertised using network are still present in the on R2 , "
954 "verify using show ip bgp and show ip route"
957 verify_nh_for_nw_rtes
= {
960 {"network": NETWORK_CMD_IP
, "no_of_ip": 1, "next_hop": gllip
}
964 bgp_rib
= verify_bgp_rib(tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
)
965 assert bgp_rib
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, bgp_rib
)
967 tgen
, "ipv4", dut
, verify_nh_for_nw_rtes
, next_hop
=gllip
, protocol
=protocol
969 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
970 write_test_footer(tc_name
)
973 if __name__
== "__main__":
974 args
= ["-s"] + sys
.argv
[1:]
975 sys
.exit(pytest
.main(args
))