2 # SPDX-License-Identifier: ISC
5 # Copyright (c) 2021 by VMware, Inc. ("VMware")
6 # Used Copyright (c) 2018 by Network Device Education Foundation,
7 # Inc. ("NetDEF") in this file.
11 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
12 1. Verify recursive import among Tenant VRFs.
13 2. Verify that dynamic import works fine between two different Tenant VRFs.
14 When next-hop IPs are same across all VRFs.
15 When next-hop IPs are different across all VRFs.
16 3. Verify that with multiple tenant VRFs, dynamic import works fine between
17 Tenant VRFs to default VRF.
18 When next-hop IPs and prefixes are same across all VRFs.
19 When next-hop IPs and prefixes are different across all VRFs.
27 from time
import sleep
29 # Save the Current Working Directory to find configuration files.
30 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
31 sys
.path
.append(os
.path
.join(CWD
, "../"))
32 sys
.path
.append(os
.path
.join(CWD
, "../lib/"))
34 # Required to instantiate the topology builder class.
36 # pylint: disable=C0413
37 # Import topogen and topotest helpers
38 from lib
.topogen
import Topogen
, get_topogen
39 from lib
.topotest
import version_cmp
41 from lib
.common_config
import (
46 reset_config_on_routers
,
52 create_bgp_community_lists
,
53 get_frr_ipv6_linklocal
,
56 from lib
.topolog
import logger
58 verify_bgp_convergence
,
63 from lib
.topojson
import build_config_from_json
65 pytestmark
= [pytest
.mark
.bgpd
, pytest
.mark
.staticd
]
68 NETWORK1_1
= {"ipv4": "11.11.11.1/32", "ipv6": "11:11::1/128"}
69 NETWORK1_2
= {"ipv4": "11.11.11.11/32", "ipv6": "11:11::11/128"}
70 NETWORK1_3
= {"ipv4": "10.10.10.1/32", "ipv6": "10:10::1/128"}
71 NETWORK1_4
= {"ipv4": "10.10.10.100/32", "ipv6": "10:10::100/128"}
72 NETWORK1_5
= {"ipv4": "110.110.110.1/32", "ipv6": "110:110::1/128"}
73 NETWORK1_6
= {"ipv4": "110.110.110.100/32", "ipv6": "110:110::100/128"}
75 NETWORK2_1
= {"ipv4": "22.22.22.2/32", "ipv6": "22:22::2/128"}
76 NETWORK2_2
= {"ipv4": "22.22.22.22/32", "ipv6": "22:22::22/128"}
77 NETWORK2_3
= {"ipv4": "20.20.20.20/32", "ipv6": "20:20::20/128"}
78 NETWORK2_4
= {"ipv4": "20.20.20.200/32", "ipv6": "20:20::200/128"}
79 NETWORK2_5
= {"ipv4": "220.220.220.20/32", "ipv6": "220:220::20/128"}
80 NETWORK2_6
= {"ipv4": "220.220.220.200/32", "ipv6": "220:220::200/128"}
82 NETWORK3_1
= {"ipv4": "30.30.30.3/32", "ipv6": "30:30::3/128"}
83 NETWORK3_2
= {"ipv4": "30.30.30.30/32", "ipv6": "30:30::30/128"}
86 "ipv4": ["11.11.11.1", "22.22.22.2", "22.22.22.22"],
87 "ipv6": ["11:11::1", "22:22::2", "22:22::22"],
89 PREFERRED_NEXT_HOP
= "global"
90 VRF_LIST
= ["RED", "BLUE", "GREEN"]
91 COMM_VAL_1
= "100:100"
92 COMM_VAL_2
= "500:500"
93 COMM_VAL_3
= "600:600"
96 def setup_module(mod
):
98 Sets up the pytest environment
103 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
104 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
105 logger
.info("=" * 40)
107 logger
.info("Running setup_module to create topology")
109 # This function initiates the topology build with Topogen...
110 json_file
= "{}/bgp_vrf_dynamic_route_leak_topo4.json".format(CWD
)
111 tgen
= Topogen(json_file
, mod
.__name
__)
113 topo
= tgen
.json_topo
114 # ... and here it calls Mininet initialization functions.
116 # Starting topology, create tmp files which are loaded to routers
117 # to start daemons and then start routers
120 # Run these tests for kernel version 4.19 or above
121 if version_cmp(platform
.release(), "4.19") < 0:
123 "BGP vrf dynamic route leak tests will not run "
124 '(have kernel "{}", but it requires >= 4.19)'.format(platform
.release())
126 pytest
.skip(error_msg
)
128 # Creating configuration from JSON
129 build_config_from_json(tgen
, topo
)
131 global BGP_CONVERGENCE
133 ADDR_TYPES
= check_address_types()
135 BGP_CONVERGENCE
= verify_bgp_convergence(tgen
, topo
)
136 assert BGP_CONVERGENCE
is True, "setup_module : Failed \n Error: {}".format(
140 logger
.info("Running setup_module() done")
143 def teardown_module():
144 """Teardown the pytest environment"""
146 logger
.info("Running teardown_module to delete topology")
150 # Stop toplogy and Remove tmp files
154 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
156 logger
.info("=" * 40)
159 #####################################################
163 #####################################################
166 def test_dynamic_import_routes_between_two_tenant_vrf_p0(request
):
168 Verify that dynamic import works fine between two different Tenant VRFs.
170 When next-hop IPs are same across all VRFs.
171 When next-hop IPs are different across all VRFs.
175 tc_name
= request
.node
.name
176 write_test_header(tc_name
)
177 reset_config_on_routers(tgen
)
178 if tgen
.routers_have_failure():
179 pytest
.skip(tgen
.errors
)
182 "Configure static routes on R3 for each vrf and redistribute in "
183 "respective BGP instance"
186 for vrf_name
, network
in zip(VRF_LIST
, [NETWORK1_1
, NETWORK2_1
, NETWORK3_1
]):
187 step("Configure static route for VRF : {}".format(vrf_name
))
188 for addr_type
in ADDR_TYPES
:
193 "network": [network
[addr_type
]],
194 "next_hop": "blackhole",
201 result
= create_static_routes(tgen
, static_routes
)
202 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
206 step("Redistribute static route on BGP VRF : {}".format(vrf_name
))
208 for addr_type
in ADDR_TYPES
:
210 {addr_type
: {"unicast": {"redistribute": [{"redist_type": "static"}]}}}
214 "r3": {"bgp": [{"vrf": vrf_name
, "local_as": 3, "address_family": temp
}]}
217 result
= create_router_bgp(tgen
, topo
, redist_dict
)
218 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
222 for vrf_name
, network
in zip(VRF_LIST
, [NETWORK1_1
, NETWORK2_1
, NETWORK3_1
]):
224 "Verify that R3 has installed redistributed routes in respective "
225 "vrfs: {}".format(vrf_name
)
227 for addr_type
in ADDR_TYPES
:
232 "network": [network
[addr_type
]],
233 "next_hop": "blackhole",
240 result
= verify_rib(tgen
, addr_type
, "r3", static_routes
)
241 assert result
is True, "Testcase {} : Failed \n Error {}".format(
245 step("Import from vrf GREEN+BLUE into vrf RED on R3")
247 for vrf_name
in ["BLUE", "GREEN"]:
249 for addr_type
in ADDR_TYPES
:
250 temp
.update({addr_type
: {"unicast": {"import": {"vrf": vrf_name
}}}})
253 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
256 result
= create_router_bgp(tgen
, topo
, import_dict
)
257 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
262 "Verify on R1, that it installs all the routes(local+imported) in "
263 "vrf RED's RIB/FIB and doesn't get confuse with next-hop attribute, "
264 "as all vrfs on R1 are using same IP address for next-hop"
267 for addr_type
in ADDR_TYPES
:
273 NETWORK1_1
[addr_type
],
274 NETWORK2_1
[addr_type
],
275 NETWORK3_1
[addr_type
],
277 "next_hop": "blackhole",
284 next_hop_1
= topo
["routers"]["r3"]["links"]["r1-link1"][addr_type
].split("/")[0]
285 result
= verify_bgp_rib(
286 tgen
, addr_type
, "r1", static_routes
, next_hop
=next_hop_1
288 assert result
is True, "Testcase {} : Failed \n Error {}".format(
292 result
= verify_rib(tgen
, addr_type
, "r1", static_routes
, next_hop
=next_hop_1
)
293 assert result
is True, "Testcase {} : Failed \n Error {}".format(
297 step("Remove import vrf GREEN/BLUE/Both command from vrf RED's instance on" " R3")
298 for vrf_name
in ["BLUE", "GREEN"]:
300 for addr_type
in ADDR_TYPES
:
302 {addr_type
: {"unicast": {"import": {"vrf": vrf_name
, "delete": True}}}}
306 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
309 result
= create_router_bgp(tgen
, topo
, import_dict
)
310 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
314 step("Verify that R1,R2 & R3 withdraw imported routes from vrf RED's RIB")
315 for dut
in ["r1", "r2", "r3"]:
316 for addr_type
in ADDR_TYPES
:
321 "network": [NETWORK2_1
[addr_type
], NETWORK3_1
[addr_type
]],
322 "next_hop": "blackhole",
328 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
329 assert result
is not True, (
330 "Testcase {} : Failed \nError {}\n"
331 "Routes {} still in BGP table".format(
332 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
336 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
337 assert result
is not True, (
338 "Testcase {} : Failed \nError {}\n"
339 "Routes {} still in Route table".format(
340 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
344 step("Add import vrf GREEN/BLUE/Both command from vrf RED's instance on " "R3")
345 for vrf_name
in ["BLUE", "GREEN"]:
347 for addr_type
in ADDR_TYPES
:
348 temp
.update({addr_type
: {"unicast": {"import": {"vrf": vrf_name
}}}})
351 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
354 result
= create_router_bgp(tgen
, topo
, import_dict
)
355 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
359 for dut
in ["r1", "r2", "r3"]:
360 step("Verify that {} reinstall imported routes from vrf RED's RIB".format(dut
))
361 for addr_type
in ADDR_TYPES
:
366 "network": [NETWORK2_1
[addr_type
], NETWORK3_1
[addr_type
]],
367 "next_hop": "blackhole",
373 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
374 assert result
is True, "Testcase {} : Failed \n Error {}".format(
378 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
379 assert result
is True, "Testcase {} : Failed \n Error {}".format(
383 for action
, value
in zip(["Shut", "No shut"], [True, False]):
385 "{} the neighborship between R1-R3 and R1-R2 for vrf GREEN, BLUE "
386 "and default".format(action
)
388 bgp_disable
= {"r3": {"bgp": []}}
389 for vrf_name
in ["GREEN", "BLUE", "default"]:
391 for addr_type
in ADDR_TYPES
:
398 "dest_link": {"r3-link1": {"shutdown": value
}}
401 "dest_link": {"r3-link1": {"shutdown": value
}}
409 bgp_disable
["r3"]["bgp"].append(
410 {"vrf": vrf_name
, "local_as": 3, "address_family": temp
}
412 result
= create_router_bgp(tgen
, topo
, bgp_disable
)
413 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
417 step("Verify RIB/FIB of vrf RED will be unchanged on all 3 routers")
418 for dut
in ["r1", "r2", "r3"]:
419 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
420 for addr_type
in ADDR_TYPES
:
426 NETWORK2_1
[addr_type
],
427 NETWORK3_1
[addr_type
],
429 "next_hop": "blackhole",
435 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
436 assert result
is True, "Testcase {} : Failed \n Error {}".format(
440 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
441 assert result
is True, "Testcase {} : Failed \n Error {}".format(
445 for action
, value
, status
in zip(
446 ["Shut", "No shut"], [True, False], ["Withdraw", "Reinstall"]
448 step("{} the neighborship between R1-R3 and R1-R2 for vrf RED".format(action
))
450 for addr_type
in ADDR_TYPES
:
456 "r1": {"dest_link": {"r3-link1": {"shutdown": value
}}},
457 "r2": {"dest_link": {"r3-link1": {"shutdown": value
}}},
465 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
467 result
= create_router_bgp(tgen
, topo
, bgp_disable
)
468 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
473 "Verify that R1 and R2 {} all the routes from RED vrf's RIB and"
474 " FIB".format(status
)
476 for dut
in ["r1", "r2"]:
477 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
478 for addr_type
in ADDR_TYPES
:
484 NETWORK2_1
[addr_type
],
485 NETWORK3_1
[addr_type
],
487 "next_hop": "blackhole",
495 result
= verify_bgp_rib(
496 tgen
, addr_type
, dut
, static_routes
, expected
=False
500 ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
503 static_routes
[dut
]["static_routes"][0]["network"],
507 tgen
, addr_type
, dut
, static_routes
, expected
=False
511 ), "Testcase {} : Failed \nError {}\n" "Routes {} still in Route table".format(
514 static_routes
[dut
]["static_routes"][0]["network"],
517 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
518 assert result
is True, "Testcase {} : Failed \n Error {}".format(
522 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
523 assert result
is True, "Testcase {} : Failed \n Error {}".format(
527 step("Remove import command from router R3 and configure the same on R2")
528 for vrf_name
in ["BLUE", "GREEN"]:
530 for addr_type
in ADDR_TYPES
:
532 {addr_type
: {"unicast": {"import": {"vrf": vrf_name
, "delete": True}}}}
536 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
539 result
= create_router_bgp(tgen
, topo
, import_dict
)
540 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
545 "Verify that once import commands are removed from R3, all imported "
546 "routes are withdrawn from RIB/FIB of vrf RED on R1/R2/R3"
549 for dut
in ["r1", "r2", "r3"]:
550 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
551 for addr_type
in ADDR_TYPES
:
556 "network": [NETWORK2_1
[addr_type
], NETWORK3_1
[addr_type
]],
557 "next_hop": "blackhole",
563 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
564 assert result
is not True, (
565 "Testcase {} : Failed \nError {}\n"
566 "Routes {} still in BGP table".format(
567 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
571 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
574 ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
575 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
579 "Configure static routes on R2 for each vrf and redistribute in "
580 "respective BGP instance"
582 for vrf_name
, network
in zip(VRF_LIST
, [NETWORK1_1
, NETWORK2_1
, NETWORK3_1
]):
583 step("Configure static route for VRF : {}".format(vrf_name
))
584 for addr_type
in ADDR_TYPES
:
589 "network": [network
[addr_type
]],
590 "next_hop": "blackhole",
597 result
= create_static_routes(tgen
, static_routes
)
598 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
602 step("Redistribute static route on BGP VRF : {}".format(vrf_name
))
604 for addr_type
in ADDR_TYPES
:
606 {addr_type
: {"unicast": {"redistribute": [{"redist_type": "static"}]}}}
610 "r2": {"bgp": [{"vrf": vrf_name
, "local_as": 2, "address_family": temp
}]}
613 result
= create_router_bgp(tgen
, topo
, redist_dict
)
614 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
618 step("Remove redistribute static route on BGP VRF : {} on r3".format(vrf_name
))
620 for addr_type
in ADDR_TYPES
:
625 "redistribute": [{"redist_type": "static", "delete": True}]
632 "r3": {"bgp": [{"vrf": vrf_name
, "local_as": 3, "address_family": temp
}]}
635 result
= create_router_bgp(tgen
, topo
, redist_dict
)
636 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
640 for vrf_name
in ["BLUE", "GREEN"]:
642 for addr_type
in ADDR_TYPES
:
643 temp
.update({addr_type
: {"unicast": {"import": {"vrf": vrf_name
}}}})
646 "r2": {"bgp": [{"vrf": "RED", "local_as": 2, "address_family": temp
}]}
649 result
= create_router_bgp(tgen
, topo
, import_dict
)
650 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
655 "Verify after import commands are re-configured on R2's vrf RED, all "
656 "those routes are installed again in vrf RED of R1,R2,R3"
658 for dut
in ["r1", "r2", "r3"]:
659 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
660 for addr_type
in ADDR_TYPES
:
666 NETWORK1_1
[addr_type
],
667 NETWORK2_1
[addr_type
],
668 NETWORK3_1
[addr_type
],
670 "next_hop": "blackhole",
676 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
677 assert result
is True, "Testcase {} : Failed \n Error {}".format(
681 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
682 assert result
is True, "Testcase {} : Failed \n Error {}".format(
687 "Remove/add import vrf GREEN/BLUE/both command from vrf RED's " "instance on R2"
689 for vrf_name
in ["BLUE", "GREEN"]:
691 for addr_type
in ADDR_TYPES
:
693 {addr_type
: {"unicast": {"import": {"vrf": vrf_name
, "delete": True}}}}
697 "r2": {"bgp": [{"vrf": "RED", "local_as": 2, "address_family": temp
}]}
700 result
= create_router_bgp(tgen
, topo
, redist_dict
)
701 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
705 step("Verify that R1,R2 & R3 withdraw imported routes from vrf RED's RIB")
706 for dut
in ["r1", "r2", "r3"]:
707 for addr_type
in ADDR_TYPES
:
712 "network": [NETWORK2_1
[addr_type
], NETWORK3_1
[addr_type
]],
713 "next_hop": "blackhole",
719 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
720 assert result
is not True, (
721 "Testcase {} : Failed \nError {}\n"
722 "Routes {} still in BGP table".format(
723 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
727 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
, expected
=False)
730 ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
731 tc_name
, result
, static_routes
[dut
]["static_routes"][0]["network"]
734 step("Add import vrf GREEN/BLUE/Both command from vrf RED's instance on " "R2")
735 for vrf_name
in ["BLUE", "GREEN"]:
737 for addr_type
in ADDR_TYPES
:
738 temp
.update({addr_type
: {"unicast": {"import": {"vrf": vrf_name
}}}})
741 "r2": {"bgp": [{"vrf": "RED", "local_as": 2, "address_family": temp
}]}
744 result
= create_router_bgp(tgen
, topo
, redist_dict
)
745 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
749 for dut
in ["r1", "r2", "r3"]:
750 step("Verify that {} reinstall imported routes from vrf RED's RIB".format(dut
))
751 for addr_type
in ADDR_TYPES
:
756 "network": [NETWORK2_1
[addr_type
], NETWORK3_1
[addr_type
]],
757 "next_hop": "blackhole",
763 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
764 assert result
is True, "Testcase {} : Failed \n Error {}".format(
768 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
769 assert result
is True, "Testcase {} : Failed \n Error {}".format(
773 for action
, value
in zip(["Shut", "No shut"], [True, False]):
775 "{} the neighborship between R2-R3 for vrf GREEN, BLUE and default".format(
779 bgp_disable
= {"r2": {"bgp": []}}
780 for vrf_name
in ["GREEN", "BLUE", "default"]:
782 for addr_type
in ADDR_TYPES
:
789 "dest_link": {"r2-link1": {"shutdown": value
}}
797 bgp_disable
["r2"]["bgp"].append(
798 {"vrf": vrf_name
, "local_as": 2, "address_family": temp
}
800 result
= create_router_bgp(tgen
, topo
, bgp_disable
)
801 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
805 step("Verify RIB/FIB of vrf RED will be unchanged on all 3 routers")
806 for dut
in ["r1", "r2", "r3"]:
807 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
808 for addr_type
in ADDR_TYPES
:
814 NETWORK2_1
[addr_type
],
815 NETWORK3_1
[addr_type
],
817 "next_hop": "blackhole",
823 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
824 assert result
is True, "Testcase {} : Failed \n Error {}".format(
828 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
829 assert result
is True, "Testcase {} : Failed \n Error {}".format(
833 for action
, value
, status
in zip(
834 ["Shut", "No shut"], [True, False], ["Withdraw", "Reinstall"]
836 step("{} the neighborship between R2-R3 for vrf RED".format(action
))
838 for addr_type
in ADDR_TYPES
:
844 "r2": {"dest_link": {"r3-link1": {"shutdown": value
}}}
852 "r3": {"bgp": [{"vrf": "RED", "local_as": 3, "address_family": temp
}]}
854 result
= create_router_bgp(tgen
, topo
, bgp_disable
)
855 assert result
is True, "Testcase {} :Failed \n Error: {}".format(
860 "Verify that R1 and R2 {} all the routes from RED vrf's RIB and"
861 " FIB".format(status
)
863 for dut
in ["r1", "r3"]:
864 step("Verify RIB/FIB for vrf RED on {}".format(dut
))
865 for addr_type
in ADDR_TYPES
:
871 NETWORK2_1
[addr_type
],
872 NETWORK3_1
[addr_type
],
874 "next_hop": "blackhole",
882 result
= verify_bgp_rib(
883 tgen
, addr_type
, dut
, static_routes
, expected
=False
887 ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
890 static_routes
[dut
]["static_routes"][0]["network"],
894 tgen
, addr_type
, dut
, static_routes
, expected
=False
898 ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
901 static_routes
[dut
]["static_routes"][0]["network"],
904 result
= verify_bgp_rib(tgen
, addr_type
, dut
, static_routes
)
905 assert result
is True, "Testcase {} : Failed \n Error {}".format(
909 result
= verify_rib(tgen
, addr_type
, dut
, static_routes
)
910 assert result
is True, "Testcase {} : Failed \n Error {}".format(
914 write_test_footer(tc_name
)
917 if __name__
== "__main__":
918 args
= ["-s"] + sys
.argv
[1:]
919 sys
.exit(pytest
.main(args
))