]>
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
52 # Save the Current Working Directory to find configuration files.
53 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
54 sys
.path
.append(os
.path
.join(CWD
, "../"))
56 # pylint: disable=C0413
57 # Import topogen and topotest helpers
58 from lib
.micronet_compat
import Topo
59 from lib
.topogen
import Topogen
, get_topogen
61 # Import topoJson from lib, to create topology and initial configuration
62 from lib
.common_config
import (
66 reset_config_on_routers
,
72 from lib
.topolog
import logger
73 from lib
.bgp
import verify_bgp_convergence
, create_router_bgp
, clear_bgp_and_verify
74 from lib
.topojson
import build_topo_from_json
, build_config_from_json
76 pytestmark
= [pytest
.mark
.bgpd
]
79 # Reading the data from JSON File for topology creation
80 jsonFile
= "{}/prefix_lists.json".format(CWD
)
83 with
open(jsonFile
, "r") as topoJson
:
84 topo
= json
.load(topoJson
)
86 assert False, "Could not read file {}".format(jsonFile
)
89 bgp_convergence
= False
92 class BGPPrefixListTopo(Topo
):
94 Test BGPPrefixListTopo - topology 1
96 * `Topo`: Topology object
99 def build(self
, *_args
, **_opts
):
101 tgen
= get_topogen(self
)
103 # Building topology from json file
104 build_topo_from_json(tgen
, topo
)
107 def setup_module(mod
):
109 Sets up the pytest environment
114 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
115 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
116 logger
.info("=" * 40)
118 logger
.info("Running setup_module to create topology")
120 # This function initiates the topology build with Topogen...
121 tgen
= Topogen(BGPPrefixListTopo
, mod
.__name
__)
122 # ... and here it calls Mininet initialization functions.
124 # Starting topology, create tmp files which are loaded to routers
125 # to start deamons and then start routers
128 # Creating configuration from JSON
129 build_config_from_json(tgen
, topo
)
131 # Checking BGP convergence
132 global BGP_CONVERGENCE
134 # Don't run this test if we have any failure.
135 if tgen
.routers_have_failure():
136 pytest
.skip(tgen
.errors
)
138 # Api call verify whether BGP is converged
139 BGP_CONVERGENCE
= verify_bgp_convergence(tgen
, topo
)
140 assert BGP_CONVERGENCE
is True, "setup_module :Failed \n Error:" " {}".format(
144 logger
.info("Running setup_module() done")
147 def teardown_module(mod
):
149 Teardown the pytest environment
154 logger
.info("Running teardown_module to delete topology")
158 # Stop toplogy and Remove tmp files
162 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
164 logger
.info("=" * 40)
167 #####################################################
171 #####################################################
174 def test_ip_prefix_lists_in_permit(request
):
176 Create ip prefix list and test permit prefixes IN direction
180 if BGP_CONVERGENCE
is not True:
181 pytest
.skip("skipped because of BGP Convergence failure")
184 tc_name
= request
.node
.name
185 write_test_header(tc_name
)
187 # Create Static routes
191 {"network": "20.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
195 result
= create_static_routes(tgen
, input_dict
)
196 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
198 # Create ip prefix list
203 "pf_list_1": [{"seqid": 10, "network": "any", "action": "permit"}]
208 result
= create_prefix_lists(tgen
, input_dict_2
)
209 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
211 # Configure bgp neighbor with prefix list
219 {"redist_type": "static"},
220 {"redist_type": "connected"},
237 {"name": "pf_list_1", "direction": "in"}
249 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
250 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
252 # Verifying RIB routes
255 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
256 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
258 write_test_footer(tc_name
)
261 def test_ip_prefix_lists_out_permit(request
):
263 Create ip prefix list and test permit prefixes out direction
267 if BGP_CONVERGENCE
is not True:
268 pytest
.skip("skipped because of BGP Convergence failure")
271 tc_name
= request
.node
.name
272 write_test_header(tc_name
)
274 # Creating configuration from JSON
275 reset_config_on_routers(tgen
)
277 # Create Static routes
281 {"network": "10.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
285 result
= create_static_routes(tgen
, input_dict
)
286 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
288 # Create Static routes
292 {"network": "20.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
296 result
= create_static_routes(tgen
, input_dict_1
)
297 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
302 {"network": "10.0.0.2/30", "no_of_ip": 1, "next_hop": "10.0.0.9"}
306 result
= create_static_routes(tgen
, input_dict_5
)
307 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
309 # Api call to redistribute static routes
311 # Create ip prefix list
317 {"seqid": 10, "network": "20.0.20.1/32", "action": "permit"}
323 result
= create_prefix_lists(tgen
, input_dict_2
)
324 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
326 # Configure prefix list to bgp neighbor
327 # Configure bgp neighbor with prefix list
349 {"redist_type": "static"},
350 {"redist_type": "connected"},
359 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
360 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
362 # Verifying RIB routes
365 result
= verify_rib(tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
)
366 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
369 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
373 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
374 write_test_footer(tc_name
)
377 def test_ip_prefix_lists_in_deny_and_permit_any(request
):
379 Create ip prefix list and test permit/deny prefixes IN direction
383 if BGP_CONVERGENCE
is not True:
384 pytest
.skip("skipped because of BGP Convergence failure")
387 tc_name
= request
.node
.name
388 write_test_header(tc_name
)
390 # Creating configuration from JSON
391 reset_config_on_routers(tgen
)
393 # Create Static Routes
397 {"network": "10.0.20.1/32", "no_of_ip": 1, "next_hop": "10.0.0.2"}
401 result
= create_static_routes(tgen
, input_dict
)
402 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
404 # Api call to redistribute static routes
405 # Create ip prefix list
411 {"seqid": "10", "network": "10.0.20.1/32", "action": "deny"},
412 {"seqid": "11", "network": "any", "action": "permit"},
418 result
= create_prefix_lists(tgen
, input_dict_2
)
419 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
421 # Configure bgp neighbor with prefix list
429 {"redist_type": "static"},
430 {"redist_type": "connected"},
447 {"name": "pf_list_1", "direction": "in"}
459 # Configure prefix list to bgp neighbor
460 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
461 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
463 # Verifying RIB routes
467 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
471 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
473 write_test_footer(tc_name
)
476 def test_delete_prefix_lists(request
):
478 Delete ip prefix list
482 if BGP_CONVERGENCE
is not True:
483 pytest
.skip("skipped because of BGP Convergence failure")
486 tc_name
= request
.node
.name
487 write_test_header(tc_name
)
489 # Creating configuration from JSON
490 reset_config_on_routers(tgen
)
492 # Create ip prefix list
498 {"seqid": "10", "network": "10.0.20.1/32", "action": "deny"}
504 result
= create_prefix_lists(tgen
, input_dict_2
)
505 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
507 result
= verify_prefix_lists(tgen
, input_dict_2
)
508 assert result
is not True, "Testcase {} : Failed \n Error: {}".format(
520 "network": "10.0.20.1/32",
529 result
= create_prefix_lists(tgen
, input_dict_2
)
530 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
532 result
= verify_prefix_lists(tgen
, input_dict_2
)
533 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
535 write_test_footer(tc_name
)
538 def test_ip_prefix_lists_out_deny_and_permit_any(request
):
540 Create ip prefix list and test deny/permit any prefixes OUT direction
544 if BGP_CONVERGENCE
is not True:
545 pytest
.skip("skipped because of BGP Convergence failure")
548 tc_name
= request
.node
.name
549 write_test_header(tc_name
)
551 # Creating configuration from JSON
552 reset_config_on_routers(tgen
)
554 # Create Static Routes
558 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
562 result
= create_static_routes(tgen
, input_dict
)
563 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
565 # Create Static Routes
569 {"network": "20.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.1"}
573 result
= create_static_routes(tgen
, input_dict_1
)
574 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
576 # Api call to redistribute static routes
578 # Create ip prefix list
586 "network": "10.0.0.0/8",
590 {"seqid": "11", "network": "any", "action": "permit"},
596 result
= create_prefix_lists(tgen
, input_dict_3
)
597 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
599 # Configure prefix list to bgp neighbor
607 {"redist_type": "static"},
608 {"redist_type": "connected"},
621 {"redist_type": "static"},
622 {"redist_type": "connected"},
654 result
= create_router_bgp(tgen
, topo
, input_dict_4
)
655 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
657 # Verifying RIB routes
660 result
= verify_rib(tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
)
661 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
663 # Verifying RIB routes
667 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
671 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
672 write_test_footer(tc_name
)
675 def test_modify_prefix_lists_in_permit_to_deny(request
):
677 Modify ip prefix list and test permit to deny prefixes IN direction
681 if BGP_CONVERGENCE
is not True:
682 pytest
.skip("skipped because of BGP Convergence failure")
685 tc_name
= request
.node
.name
686 write_test_header(tc_name
)
688 # Creating configuration from JSON
689 reset_config_on_routers(tgen
)
691 # Create Static Routes
695 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
699 result
= create_static_routes(tgen
, input_dict
)
700 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
702 # Api call to redistribute static routes
704 # Create ip prefix list
712 "network": "10.0.0.0/8",
721 result
= create_prefix_lists(tgen
, input_dict_2
)
722 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
724 # Configure prefix list to bgp neighbor
732 {"redist_type": "static"},
733 {"redist_type": "connected"},
750 {"name": "pf_list_1", "direction": "in"}
762 result
= create_router_bgp(tgen
, topo
, input_dict_3
)
763 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
765 # Verifying RIB routes
768 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
769 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
779 "network": "10.0.0.0/8",
783 {"seqid": "11", "network": "any", "action": "permit"},
789 result
= create_prefix_lists(tgen
, input_dict_1
)
790 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
792 # Api call to clear bgp, so config changes would be reflected
794 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
795 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
797 # Verifying RIB routes
801 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
805 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
807 write_test_footer(tc_name
)
810 def test_modify_prefix_lists_in_deny_to_permit(request
):
812 Modify ip prefix list and test deny to permit prefixes IN direction
816 if BGP_CONVERGENCE
is not True:
817 pytest
.skip("skipped because of BGP Convergence failure")
820 tc_name
= request
.node
.name
821 write_test_header(tc_name
)
823 # Creating configuration from JSON
824 reset_config_on_routers(tgen
)
826 # Create Static Routes
830 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
834 result
= create_static_routes(tgen
, input_dict
)
835 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
837 # Api call to redistribute static routes
839 # Create ip prefix list
847 "network": "10.0.0.0/8",
851 {"seqid": "11", "network": "any", "action": "permit"},
857 result
= create_prefix_lists(tgen
, input_dict_1
)
858 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
860 # Configure prefix list to bgp neighbor
868 {"redist_type": "static"},
869 {"redist_type": "connected"},
886 {"name": "pf_list_1", "direction": "in"}
898 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
899 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
901 # Verifying RIB routes
905 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
909 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
911 # Modify ip prefix list
919 "network": "10.0.0.0/8",
928 result
= create_prefix_lists(tgen
, input_dict_1
)
929 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
931 # Api call to clear bgp, so config changes would be reflected
933 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
934 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
936 # Verifying RIB routes
939 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
940 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
942 write_test_footer(tc_name
)
945 def test_modify_prefix_lists_out_permit_to_deny(request
):
947 Modify ip prefix list and test permit to deny prefixes OUT direction
951 if BGP_CONVERGENCE
is not True:
952 pytest
.skip("skipped because of BGP Convergence failure")
955 tc_name
= request
.node
.name
956 write_test_header(tc_name
)
958 # Creating configuration from JSON
959 reset_config_on_routers(tgen
)
961 # Create Static Routes
965 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
969 result
= create_static_routes(tgen
, input_dict
)
970 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
972 # Api call to redistribute static routes
974 # Create ip prefix list
982 "network": "10.0.0.0/8",
991 result
= create_prefix_lists(tgen
, input_dict_1
)
992 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
994 # Configure prefix list to bgp neighbor
1002 {"redist_type": "static"},
1003 {"redist_type": "connected"},
1021 "name": "pf_list_1",
1035 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
1036 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1038 # Verifying RIB routes
1041 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1042 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1044 # Modify ip prefix list
1052 "network": "10.0.0.0/8",
1056 {"seqid": "11", "network": "any", "action": "permit"},
1062 result
= create_prefix_lists(tgen
, input_dict_1
)
1063 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1065 # Api call to clear bgp, so config changes would be reflected
1067 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
1068 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1070 # Verifying RIB routes
1073 result
= verify_rib(
1074 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
1078 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
1080 write_test_footer(tc_name
)
1083 def test_modify_prefix_lists_out_deny_to_permit(request
):
1085 Modify ip prefix list and test deny to permit prefixes OUT direction
1088 tgen
= get_topogen()
1089 if BGP_CONVERGENCE
is not True:
1090 pytest
.skip("skipped because of BGP Convergence failure")
1093 tc_name
= request
.node
.name
1094 write_test_header(tc_name
)
1096 # Creating configuration from JSON
1097 reset_config_on_routers(tgen
)
1099 # Create Static Routes
1103 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
1107 result
= create_static_routes(tgen
, input_dict
)
1108 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1110 # Api call to redistribute static routes
1111 # Create ip prefix list
1119 "network": "10.0.0.0/8",
1123 {"seqid": "11", "network": "any", "action": "permit"},
1129 result
= create_prefix_lists(tgen
, input_dict_1
)
1130 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1132 # Configure prefix list to bgp neighbor
1140 {"redist_type": "static"},
1141 {"redist_type": "connected"},
1159 "name": "pf_list_1",
1173 result
= create_router_bgp(tgen
, topo
, input_dict_2
)
1174 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1176 # Verifying RIB routes
1179 result
= verify_rib(
1180 tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
, expected
=False
1184 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
1186 # Modify ip prefix list
1194 "network": "10.0.0.0/8",
1203 result
= create_prefix_lists(tgen
, input_dict_1
)
1204 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1206 # Api call to clear bgp, so config changes would be reflected
1208 result
= clear_bgp_and_verify(tgen
, topo
, dut
)
1209 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1211 # Verifying RIB routes
1214 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1215 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1217 write_test_footer(tc_name
)
1220 def test_ip_prefix_lists_implicit_deny(request
):
1222 Create ip prefix list and test implicit deny
1225 tgen
= get_topogen()
1226 if BGP_CONVERGENCE
is not True:
1227 pytest
.skip("skipped because of BGP Convergence failure")
1230 tc_name
= request
.node
.name
1231 write_test_header(tc_name
)
1233 # Creating configuration from JSON
1234 reset_config_on_routers(tgen
)
1236 # Create Static Routes
1240 {"network": "10.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.2"}
1244 result
= create_static_routes(tgen
, input_dict
)
1245 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1247 # Create Static Routes
1251 {"network": "20.0.20.1/32", "no_of_ip": 9, "next_hop": "10.0.0.1"}
1255 result
= create_static_routes(tgen
, input_dict
)
1256 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1258 # Api call to redistribute static routes
1259 # Create ip prefix list
1267 "network": "10.0.0.0/8",
1276 result
= create_prefix_lists(tgen
, input_dict_3
)
1277 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1279 # Configure prefix list to bgp neighbor
1287 {"redist_type": "static"},
1288 {"redist_type": "connected"},
1301 {"redist_type": "static"},
1302 {"redist_type": "connected"},
1320 "name": "pf_list_1",
1334 result
= create_router_bgp(tgen
, topo
, input_dict_4
)
1335 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1337 # Verifying RIB routes
1340 result
= verify_rib(tgen
, "ipv4", dut
, input_dict
, protocol
=protocol
)
1341 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1343 # Verifying RIB routes
1346 result
= verify_rib(
1347 tgen
, "ipv4", dut
, input_dict_1
, protocol
=protocol
, expected
=False
1351 ), "Testcase {} : Failed \n Error: Routes still" " present in RIB".format(tc_name
)
1353 write_test_footer(tc_name
)
1356 if __name__
== "__main__":
1357 args
= ["-s"] + sys
.argv
[1:]
1358 sys
.exit(pytest
.main(args
))