]>
git.proxmox.com Git - mirror_frr.git/blob - tests/topotests/bgp_prefix_list_topo1/test_prefix_lists.py
4 # Copyright (c) 2019 by VMware, Inc. ("VMware")
5 # Used Copyright (c) 2018 by Network Device Education Foundation,
6 # Inc. ("NetDEF") in this file.
8 # Permission to use, copy, modify, and/or distribute this software
9 # for any purpose with or without fee is hereby granted, provided
10 # that the above copyright notice and this permission notice appear
13 # THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
14 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
16 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
17 # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
19 # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 Following tests are covered to test prefix-list functionality:
27 - Create topology (setup module)
28 Creating 4 routers topology, r1, r2, r3 are in IBGP and
31 - Verify for bgp to converge
34 - Test ip prefix-lists IN permit
35 - Test ip prefix-lists OUT permit
36 - Test ip prefix-lists IN deny and permit any
37 - Test delete ip prefix-lists
38 - Test ip prefix-lists OUT deny and permit any
39 - Test modify ip prefix-lists IN permit to deny
40 - Test modify ip prefix-lists IN deny to permit
41 - Test modify ip prefix-lists OUT permit to deny
42 - Test modify prefix-lists OUT deny to permit
43 - Test ip prefix-lists implicit deny
51 # Save the Current Working Directory to find configuration files.
52 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
53 sys
.path
.append(os
.path
.join(CWD
, "../"))
55 # pylint: disable=C0413
56 # Import topogen and topotest helpers
57 from lib
.topogen
import Topogen
, get_topogen
59 # Import topoJson from lib, to create topology and initial configuration
60 from lib
.common_config
import (
64 reset_config_on_routers
,
70 from lib
.topolog
import logger
71 from lib
.bgp
import verify_bgp_convergence
, create_router_bgp
, clear_bgp_and_verify
72 from lib
.topojson
import build_config_from_json
75 pytestmark
= [pytest
.mark
.bgpd
]
79 bgp_convergence
= False
82 def setup_module(mod
):
84 Sets up the pytest environment
89 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
90 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
93 logger
.info("Running setup_module to create topology")
95 # This function initiates the topology build with Topogen...
96 json_file
= "{}/prefix_lists.json".format(CWD
)
97 tgen
= Topogen(json_file
, mod
.__name
__)
100 # ... and here it calls Mininet initialization functions.
102 # Starting topology, create tmp files which are loaded to routers
103 # to start daemons and then start routers
106 # Creating configuration from JSON
107 build_config_from_json(tgen
, topo
)
109 # Checking BGP convergence
110 global BGP_CONVERGENCE
112 # Don't run this test if we have any failure.
113 if tgen
.routers_have_failure():
114 pytest
.skip(tgen
.errors
)
116 # Api call verify whether BGP is converged
117 BGP_CONVERGENCE
= verify_bgp_convergence(tgen
, topo
)
118 assert BGP_CONVERGENCE
is True, "setup_module :Failed \n Error:" " {}".format(
122 logger
.info("Running setup_module() done")
125 def teardown_module(mod
):
127 Teardown the pytest environment
132 logger
.info("Running teardown_module to delete topology")
136 # Stop toplogy and Remove tmp files
140 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
142 logger
.info("=" * 40)
145 #####################################################
149 #####################################################
152 def test_ip_prefix_lists_in_permit(request
):
154 Create ip prefix list and test permit prefixes IN direction
158 if BGP_CONVERGENCE
is not True:
159 pytest
.skip("skipped because of BGP Convergence failure")
162 tc_name
= request
.node
.name
163 write_test_header(tc_name
)
165 # Create Static routes
169 {"network": "20.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
173 result
= create_static_routes(tgen
, input_dict
)
174 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
176 # Create ip prefix list
181 "pf_list_1": [{"seqid": 10, "network": "any", "action": "permit"}]
186 result
= create_prefix_lists(tgen
, input_dict_2
)
187 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
189 # Configure bgp neighbor with prefix list
197 {"redist_type": "static"},
198 {"redist_type": "connected"},
215 {"name": "pf_list_1", "direction": "in"}
227 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
228 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
230 # Verifying RIB routes
233 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
234 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
236 write_test_footer(tc_name
)
239 def test_ip_prefix_lists_out_permit(request
):
241 Create ip prefix list and test permit prefixes out direction
245 if BGP_CONVERGENCE
is not True:
246 pytest
.skip("skipped because of BGP Convergence failure")
249 tc_name
= request
.node
.name
250 write_test_header(tc_name
)
252 # Creating configuration from JSON
253 reset_config_on_routers(tgen
)
255 # Create Static routes
259 {"network": "10.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
263 result
= create_static_routes(tgen
, input_dict
)
264 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
266 # Create Static routes
270 {"network": "20.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
274 result
= create_static_routes(tgen
, input_dict_1
)
275 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
280 {"network": "10.0.0.2/30", "no_of_ip": 1, "next_hop": "10.0.0.9"}
284 result
= create_static_routes(tgen
, input_dict_5
)
285 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
287 # Api call to redistribute static routes
289 # Create ip prefix list
295 {"seqid": 10, "network": "20.0.20.1/32", "action": "permit"}
301 result
= create_prefix_lists(tgen
, input_dict_2
)
302 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
304 # Configure prefix list to bgp neighbor
305 # Configure bgp neighbor with prefix list
327 {"redist_type": "static"},
328 {"redist_type": "connected"},
337 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
338 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
340 # Verifying RIB routes
343 result
= verify_rib(tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
)
344 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
347 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
349 assert result
is not True, (
350 "Testcase {} : Failed \n "
351 "Expected: Routes should not be present in {} FIB \n "
352 "Found: {}".format(tc_name
, dut
, result
)
355 write_test_footer(tc_name
)
358 def test_ip_prefix_lists_in_deny_and_permit_any(request
):
360 Create ip prefix list and test permit/deny prefixes IN direction
364 if BGP_CONVERGENCE
is not True:
365 pytest
.skip("skipped because of BGP Convergence failure")
368 tc_name
= request
.node
.name
369 write_test_header(tc_name
)
371 # Creating configuration from JSON
372 reset_config_on_routers(tgen
)
374 # Create Static Routes
378 {"network": "10.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
382 result
= create_static_routes(tgen
, input_dict
)
383 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
385 # Api call to redistribute static routes
386 # Create ip prefix list
392 {"seqid": "10", "network": "10.0.20.1/32", "action": "deny"},
393 {"seqid": "11", "network": "any", "action": "permit"},
399 result
= create_prefix_lists(tgen
, input_dict_2
)
400 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
402 # Configure bgp neighbor with prefix list
410 {"redist_type": "static"},
411 {"redist_type": "connected"},
428 {"name": "pf_list_1", "direction": "in"}
440 # Configure prefix list to bgp neighbor
441 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
442 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
444 # Verifying RIB routes
448 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
450 assert result
is not True, (
451 "Testcase {} : Failed \n "
452 "Expected: Routes should not be present in {} BGP RIB \n "
453 "Found: {}".format(tc_name
, dut
, result
)
456 write_test_footer(tc_name
)
459 def test_delete_prefix_lists(request
):
461 Delete ip prefix list
465 if BGP_CONVERGENCE
is not True:
466 pytest
.skip("skipped because of BGP Convergence failure")
469 tc_name
= request
.node
.name
470 write_test_header(tc_name
)
472 # Creating configuration from JSON
473 reset_config_on_routers(tgen
)
475 # Create ip prefix list
481 {"seqid": "10", "network": "10.0.20.1/32", "action": "deny"}
487 result
= create_prefix_lists(tgen
, input_dict_2
)
488 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
490 result
= verify_prefix_lists(tgen
, input_dict_2
)
491 assert result
is not True, "Testcase {} : Failed \n Error: {}".format(
503 "network": "10.0.20.1/32",
512 result
= create_prefix_lists(tgen
, input_dict_2
)
513 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
515 result
= verify_prefix_lists(tgen
, input_dict_2
)
516 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
518 write_test_footer(tc_name
)
521 def test_ip_prefix_lists_out_deny_and_permit_any(request
):
523 Create ip prefix list and test deny/permit any prefixes OUT direction
527 if BGP_CONVERGENCE
is not True:
528 pytest
.skip("skipped because of BGP Convergence failure")
531 tc_name
= request
.node
.name
532 write_test_header(tc_name
)
534 # Creating configuration from JSON
535 reset_config_on_routers(tgen
)
537 # Create Static Routes
541 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
545 result
= create_static_routes(tgen
, input_dict
)
546 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
548 # Create Static Routes
552 {"network": "20.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.1"}
556 result
= create_static_routes(tgen
, input_dict_1
)
557 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
559 # Api call to redistribute static routes
561 # Create ip prefix list
569 "network": "10.0.0.0/8",
573 {"seqid": "11", "network": "any", "action": "permit"},
579 result
= create_prefix_lists(tgen
, input_dict_3
)
580 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
582 # Configure prefix list to bgp neighbor
590 {"redist_type": "static"},
591 {"redist_type": "connected"},
604 {"redist_type": "static"},
605 {"redist_type": "connected"},
637 result
= create_router_bgp(tgen
, topo
, input_dict_4
)
638 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
640 # Verifying RIB routes
643 result
= verify_rib(tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
)
644 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
646 # Verifying RIB routes
650 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
652 assert result
is not True, (
653 "Testcase {} : Failed \n "
654 "Expected: Routes should not be present in {} BGP RIB \n "
655 "Found: {}".format(tc_name
, dut
, result
)
658 write_test_footer(tc_name
)
661 def test_modify_prefix_lists_in_permit_to_deny(request
):
663 Modify ip prefix list and test permit to deny prefixes IN direction
667 if BGP_CONVERGENCE
is not True:
668 pytest
.skip("skipped because of BGP Convergence failure")
671 tc_name
= request
.node
.name
672 write_test_header(tc_name
)
674 # Creating configuration from JSON
675 reset_config_on_routers(tgen
)
677 # Create Static Routes
681 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
685 result
= create_static_routes(tgen
, input_dict
)
686 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
688 # Api call to redistribute static routes
690 # Create ip prefix list
698 "network": "10.0.0.0/8",
707 result
= create_prefix_lists(tgen
, input_dict_2
)
708 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
710 # Configure prefix list to bgp neighbor
718 {"redist_type": "static"},
719 {"redist_type": "connected"},
736 {"name": "pf_list_1", "direction": "in"}
748 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
749 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
751 # Verifying RIB routes
754 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
755 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
765 "network": "10.0.0.0/8",
769 {"seqid": "11", "network": "any", "action": "permit"},
775 result
= create_prefix_lists(tgen
, input_dict_1
)
776 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
778 # Api call to clear bgp, so config changes would be reflected
780 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
781 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
783 # Verifying RIB routes
787 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
789 assert result
is not True, (
790 "Testcase {} : Failed \n "
791 "Expected: Routes should not be present in {} BGP RIB \n "
792 "Found: {}".format(tc_name
, dut
, result
)
795 write_test_footer(tc_name
)
798 def test_modify_prefix_lists_in_deny_to_permit(request
):
800 Modify ip prefix list and test deny to permit prefixes IN direction
804 if BGP_CONVERGENCE
is not True:
805 pytest
.skip("skipped because of BGP Convergence failure")
808 tc_name
= request
.node
.name
809 write_test_header(tc_name
)
811 # Creating configuration from JSON
812 reset_config_on_routers(tgen
)
814 # Create Static Routes
818 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
822 result
= create_static_routes(tgen
, input_dict
)
823 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
825 # Api call to redistribute static routes
827 # Create ip prefix list
835 "network": "10.0.0.0/8",
839 {"seqid": "11", "network": "any", "action": "permit"},
845 result
= create_prefix_lists(tgen
, input_dict_1
)
846 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
848 # Configure prefix list to bgp neighbor
856 {"redist_type": "static"},
857 {"redist_type": "connected"},
874 {"name": "pf_list_1", "direction": "in"}
886 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
887 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
889 # Verifying RIB routes
893 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
895 assert result
is not True, (
896 "Testcase {} : Failed \n "
897 "Expected: Routes should not be present in {} BGP RIB \n "
898 "Found: {}".format(tc_name
, dut
, result
)
901 # Modify ip prefix list
909 "network": "10.0.0.0/8",
918 result
= create_prefix_lists(tgen
, input_dict_1
)
919 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
921 # Api call to clear bgp, so config changes would be reflected
923 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
924 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
926 # Verifying RIB routes
929 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
930 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
932 write_test_footer(tc_name
)
935 def test_modify_prefix_lists_out_permit_to_deny(request
):
937 Modify ip prefix list and test permit to deny prefixes OUT direction
941 if BGP_CONVERGENCE
is not True:
942 pytest
.skip("skipped because of BGP Convergence failure")
945 tc_name
= request
.node
.name
946 write_test_header(tc_name
)
948 # Creating configuration from JSON
949 reset_config_on_routers(tgen
)
951 # Create Static Routes
955 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
959 result
= create_static_routes(tgen
, input_dict
)
960 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
962 # Api call to redistribute static routes
964 # Create ip prefix list
972 "network": "10.0.0.0/8",
981 result
= create_prefix_lists(tgen
, input_dict_1
)
982 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
984 # Configure prefix list to bgp neighbor
992 {"redist_type": "static"},
993 {"redist_type": "connected"},
1011 "name": "pf_list_1",
1025 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
1026 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1028 # Verifying RIB routes
1031 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1032 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1034 # Modify ip prefix list
1042 "network": "10.0.0.0/8",
1046 {"seqid": "11", "network": "any", "action": "permit"},
1052 result
= create_prefix_lists(tgen
, input_dict_1
)
1053 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1055 # Api call to clear bgp, so config changes would be reflected
1057 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
1058 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1060 # Verifying RIB routes
1063 result
= verify_rib(
1064 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
1066 assert result
is not True, (
1067 "Testcase {} : Failed \n "
1068 "Expected: Routes should not be present in {} BGP RIB \n "
1069 "Found: {}".format(tc_name
, dut
, result
)
1072 write_test_footer(tc_name
)
1075 def test_modify_prefix_lists_out_deny_to_permit(request
):
1077 Modify ip prefix list and test deny to permit prefixes OUT direction
1080 tgen
= get_topogen()
1081 if BGP_CONVERGENCE
is not True:
1082 pytest
.skip("skipped because of BGP Convergence failure")
1085 tc_name
= request
.node
.name
1086 write_test_header(tc_name
)
1088 # Creating configuration from JSON
1089 reset_config_on_routers(tgen
)
1091 # Create Static Routes
1095 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
1099 result
= create_static_routes(tgen
, input_dict
)
1100 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1102 # Api call to redistribute static routes
1103 # Create ip prefix list
1111 "network": "10.0.0.0/8",
1115 {"seqid": "11", "network": "any", "action": "permit"},
1121 result
= create_prefix_lists(tgen
, input_dict_1
)
1122 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1124 # Configure prefix list to bgp neighbor
1132 {"redist_type": "static"},
1133 {"redist_type": "connected"},
1151 "name": "pf_list_1",
1165 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
1166 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1168 # Verifying RIB routes
1171 result
= verify_rib(
1172 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
1174 assert result
is not True, (
1175 "Testcase {} : Failed \n "
1176 "Expected: Routes should not be present in {} BGP RIB \n "
1177 "Found: {}".format(tc_name
, dut
, result
)
1180 # Modify ip prefix list
1188 "network": "10.0.0.0/8",
1197 result
= create_prefix_lists(tgen
, input_dict_1
)
1198 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1200 # Api call to clear bgp, so config changes would be reflected
1202 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
1203 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1205 # Verifying RIB routes
1208 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1209 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1211 write_test_footer(tc_name
)
1214 def test_ip_prefix_lists_implicit_deny(request
):
1216 Create ip prefix list and test implicit deny
1219 tgen
= get_topogen()
1220 if BGP_CONVERGENCE
is not True:
1221 pytest
.skip("skipped because of BGP Convergence failure")
1224 tc_name
= request
.node
.name
1225 write_test_header(tc_name
)
1227 # Creating configuration from JSON
1228 reset_config_on_routers(tgen
)
1230 # Create Static Routes
1234 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
1238 result
= create_static_routes(tgen
, input_dict
)
1239 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1241 # Create Static Routes
1245 {"network": "20.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.1"}
1249 result
= create_static_routes(tgen
, input_dict
)
1250 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1252 # Api call to redistribute static routes
1253 # Create ip prefix list
1261 "network": "10.0.0.0/8",
1270 result
= create_prefix_lists(tgen
, input_dict_3
)
1271 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1273 # Configure prefix list to bgp neighbor
1281 {"redist_type": "static"},
1282 {"redist_type": "connected"},
1295 {"redist_type": "static"},
1296 {"redist_type": "connected"},
1314 "name": "pf_list_1",
1328 result
= create_router_bgp(tgen
, topo
, input_dict_4
)
1329 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1331 # Verifying RIB routes
1334 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1335 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1337 # Verifying RIB routes
1340 result
= verify_rib(
1341 tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
, expected
=False
1343 assert result
is not True, (
1344 "Testcase {} : Failed \n "
1345 "Expected: Routes should not be present in {} BGP RIB \n "
1346 "Found: {}".format(tc_name
, dut
, result
)
1349 write_test_footer(tc_name
)
1352 if __name__
== "__main__":
1353 args
= ["-s"] + sys
.argv
[1:]
1354 sys
.exit(pytest
.main(args
))