4 # Copyright (c) 2021 by VMware, Inc. ("VMware")
5 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
6 # ("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 """OSPF Summarisation Functionality Automation."""
30 # Save the Current Working Directory to find configuration files.
31 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
32 sys
.path
.append(os
.path
.join(CWD
, "../"))
33 sys
.path
.append(os
.path
.join(CWD
, "../lib/"))
35 # pylint: disable=C0413
36 # Import topogen and topotest helpers
37 from lib
.topogen
import Topogen
, get_topogen
39 from time
import sleep
41 # Import topoJson from lib, to create topology and initial configuration
42 from lib
.common_config
import (
47 reset_config_on_routers
,
55 shutdown_bringup_interface
,
59 create_interfaces_cfg
,
61 from lib
.topolog
import logger
62 from lib
.topojson
import build_config_from_json
63 from lib
.ospf
import (
64 verify_ospf6_neighbor
,
92 "ipv4": ["11.0.20.6/32", "11.0.20.7/32"],
93 "ipv6": ["2011:0:20::6/128", "2011:0:20::7/128"],
113 "ipv4": ["11.0.0.0/8", "12.0.0.0/8", "11.0.0.0/24"],
114 "ipv6": ["2011::/32", "2012::/32", "2011::/64", "2011::/24"],
118 Please view in a fixed-width font such as Courier.
120 +R1 +------------+R2 |
129 +R0 +-------------+R3 |
133 1. OSPF summarisation functionality.
134 2. OSPF summarisation with advertise and no advertise option
135 3. OSPF summarisation with route map modification of metric type.
136 4. OSPF CLI Show verify ospf ASBR summary config and show commands behaviours.
137 5. OSPF summarisation Chaos.
141 def setup_module(mod
):
143 Sets up the pytest environment
147 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
148 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
149 logger
.info("=" * 40)
151 logger
.info("Running setup_module to create topology")
153 # This function initiates the topology build with Topogen...
154 json_file
= "{}/ospfv3_asbr_summary_topo1.json".format(CWD
)
155 tgen
= Topogen(json_file
, mod
.__name
__)
157 topo
= tgen
.json_topo
158 # ... and here it calls Mininet initialization functions.
160 # get list of daemons needs to be started for this suite.
161 daemons
= topo_daemons(tgen
, topo
)
163 # Starting topology, create tmp files which are loaded to routers
164 # to start deamons and then start routers
165 start_topology(tgen
, daemons
)
167 # Creating configuration from JSON
168 build_config_from_json(tgen
, topo
)
170 # Don't run this test if we have any failure.
171 if tgen
.routers_have_failure():
172 pytest
.skip(tgen
.errors
)
173 # Api call verify whether OSPF is converged
174 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
175 assert ospf_covergence
is True, "setup_module :Failed \n Error:" " {}".format(
179 logger
.info("Running setup_module() done")
182 def teardown_module(mod
):
184 Teardown the pytest environment.
189 logger
.info("Running teardown_module to delete topology")
193 # Stop toplogy and Remove tmp files
197 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
199 logger
.info("=" * 40)
202 def red_static(dut
, config
=True):
204 Local 'def' for Redstribute static routes inside ospf.
208 * `dut` : DUT on which configs have to be made.
209 * `config` : True or False, True by default for configure, set False for
215 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "static"}]}}}
219 "ospf6": {"redistribute": [{"redist_type": "static", "delete": True}]}
222 result
= create_router_ospf(tgen
, topo
, ospf_red
)
223 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
226 def red_connected(dut
, config
=True):
228 Local 'def' for Redstribute connected routes inside ospf
232 * `dut` : DUT on which configs have to be made.
233 * `config` : True or False, True by default for configure, set False for
239 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "connected"}]}}}
244 "redistribute": [{"redist_type": "connected", "delete": True}]
248 result
= create_router_ospf(tgen
, topo
, ospf_red
)
249 assert result
is True, "Testcase: Failed \n Error: {}".format(result
)
252 # ##################################
253 # Test cases start here.
254 # ##################################
257 def test_ospfv3_type5_summary_tc42_p0(request
):
258 """OSPF summarisation functionality."""
259 tc_name
= request
.node
.name
260 write_test_header(tc_name
)
263 # Don't run this test if we have any failure.
264 if tgen
.routers_have_failure():
265 pytest
.skip(tgen
.errors
)
268 step("Bring up the base config as per the topology")
269 reset_config_on_routers(tgen
)
274 "Configure 5 static routes from the same network on R0"
275 "5 static routes from different networks and redistribute in R0"
277 input_dict_static_rtes
= {
280 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
281 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
285 result
= create_static_routes(tgen
, input_dict_static_rtes
)
286 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
291 step("Verify that routes are learnt on R1.")
294 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
295 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
296 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
299 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
302 "Configure External Route summary in R0 to summarise 5"
303 " routes to one route. with aggregate timer as 6 sec"
310 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
316 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
317 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
320 "Verify that external routes are summarised to configured summary "
321 "address on R0 after 5 secs of delay timer expiry and only one "
322 "route is sent to R1."
324 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
327 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
328 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
330 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
333 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
335 step("Verify that show ip ospf summary should show the summaries.")
337 SUMMARY
["ipv6"][0]: {
338 "Summary address": SUMMARY
["ipv6"][0],
342 "External route count": 5,
346 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
349 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
351 step("Verify that originally advertised routes are withdraw from there" " peer.")
353 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
356 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
359 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
364 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
368 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
370 step("Delete the configured summary")
376 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
378 "del_aggr_timer": True,
385 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
386 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
388 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
390 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
393 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
398 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
402 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
406 step("show ip ospf summary should not have any summary address.")
408 SUMMARY
["ipv6"][0]: {
409 "Summary address": SUMMARY
["ipv6"][0],
413 "External route count": 5,
417 result
= verify_ospf_summary(
418 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
422 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
425 step("All 5 routes are advertised after deletion of configured summary.")
427 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
428 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
430 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
433 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
435 step("configure the summary again and delete static routes .")
440 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
445 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
446 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
449 SUMMARY
["ipv6"][0]: {
450 "Summary address": SUMMARY
["ipv6"][0],
454 "External route count": 5,
458 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
461 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
466 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True}
470 result
= create_static_routes(tgen
, input_dict
)
471 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
473 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
474 step("Verify that summary route is withdrawn from R1.")
477 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
480 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
485 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
489 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
491 step("Add back static routes.")
492 input_dict_static_rtes
= {
493 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
495 result
= create_static_routes(tgen
, input_dict_static_rtes
)
496 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
499 "Verify that external routes are summarised to configured summary"
500 " address on R0 and only one route is sent to R1."
504 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
, expected
=False)
507 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
512 tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
, expected
=False
516 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
518 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
521 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
522 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
524 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
527 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
529 step("Verify that show ip ospf summary should show configure summaries.")
532 SUMMARY
["ipv6"][0]: {
533 "Summary address": SUMMARY
["ipv6"][0],
537 "External route count": 5,
541 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
544 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
546 step("Configure new static route which is matching configured summary.")
547 input_dict_static_rtes
= {
549 "static_routes": [{"network": NETWORK_11
["ipv6"], "next_hop": "blackhole"}]
552 result
= create_static_routes(tgen
, input_dict_static_rtes
)
553 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
555 # step("verify that summary lsa is not refreshed.")
556 # show ip ospf database command is not working, waiting for DEV fix.
558 step("Delete one of the static route.")
559 input_dict_static_rtes
= {
562 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "delete": True}
566 result
= create_static_routes(tgen
, input_dict_static_rtes
)
567 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
569 # step("verify that summary lsa is not refreshed.")
570 # show ip ospf database command is not working, waiting for DEV fix.
572 # step("Verify that deleted static route is removed from ospf LSDB.")
573 # show ip ospf database command is not working, waiting for DEV fix.
576 "Configure redistribute connected and configure ospf external"
577 " summary address to summarise the connected routes."
582 clear_ospf(tgen
, dut
, ospf
="ospf6")
584 ip
= topo
["routers"]["r0"]["links"]["r3"]["ipv6"]
586 ip_net
= str(ipaddress
.ip_interface(u
"{}".format(ip
)).network
)
590 "summary-address": [{"prefix": ip_net
.split("/")[0], "mask": "8"}]
594 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
595 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
598 "Verify that external routes are summarised to configured "
599 "summary address on R0 and only one route is sent to R1."
602 input_dict_summary
= {"r0": {"static_routes": [{"network": "fd00::/64"}]}}
604 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
605 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
607 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
610 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
612 step("Shut one of the interface")
613 intf
= topo
["routers"]["r0"]["links"]["r3-link0"]["interface"]
614 shutdown_bringup_interface(tgen
, dut
, intf
, False)
616 # step("verify that summary lsa is not refreshed.")
617 # show ip ospf database command is not working, waiting for DEV fix.
619 # step("Verify that deleted connected route is removed from ospf LSDB.")
620 # show ip ospf database command is not working, waiting for DEV fix.
622 step("Un do shut the interface")
623 shutdown_bringup_interface(tgen
, dut
, intf
, True)
625 # step("verify that summary lsa is not refreshed.")
626 # show ip ospf database command is not working, waiting for DEV fix.
628 # step("Verify that deleted connected route is removed from ospf LSDB.")
629 # show ip ospf database command is not working, waiting for DEV fix.
631 step("Delete OSPF process.")
632 ospf_del
= {"r0": {"ospf6": {"delete": True}}}
633 result
= create_router_ospf(tgen
, topo
, ospf_del
)
634 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
636 step("Reconfigure ospf process with summary")
637 reset_config_on_routers(tgen
)
639 input_dict_static_rtes
= {
642 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
643 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
647 result
= create_static_routes(tgen
, input_dict_static_rtes
)
648 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
657 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
662 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
663 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
665 "Verify that external routes are summarised to configured summary "
666 "address on R0 and only one route is sent to R1."
670 SUMMARY
["ipv6"][0]: {
671 "Summary address": SUMMARY
["ipv6"][0],
675 "External route count": 5,
679 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
682 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
684 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
687 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
688 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
690 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
693 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
699 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
704 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
705 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
707 # step("verify that summary lsa is not refreshed.")
708 # show ip ospf database command is not working, waiting for DEV fix.
710 step("Delete the redistribute command in ospf.")
712 red_connected(dut
, config
=False)
713 red_static(dut
, config
=False)
715 step("Verify that summary route is withdrawn from the peer.")
718 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
721 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
726 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
730 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
737 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
745 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
746 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
748 write_test_footer(tc_name
)
751 def test_ospfv3_type5_summary_tc43_p0(request
):
752 """OSPF summarisation with metric type 2."""
753 tc_name
= request
.node
.name
754 write_test_header(tc_name
)
757 # Don't run this test if we have any failure.
758 if tgen
.routers_have_failure():
759 pytest
.skip(tgen
.errors
)
762 step("Bring up the base config as per the topology")
763 reset_config_on_routers(tgen
)
768 "Configure 5 static routes from the same network on R0"
769 "5 static routes from different networks and redistribute in R0"
771 input_dict_static_rtes
= {
774 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
775 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
779 result
= create_static_routes(tgen
, input_dict_static_rtes
)
780 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
785 step("Verify that routes are learnt on R1.")
788 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
789 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
790 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
793 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
796 "Configure External Route summary in R0 to summarise 5" " routes to one route."
802 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
807 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
808 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
810 "Verify that external routes are summarised to configured summary "
811 "address on R0 after 5 secs of delay timer expiry and only one "
812 "route is sent to R1."
814 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
817 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
818 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
820 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
823 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
825 step("Verify that show ip ospf summary should show the summaries.")
827 SUMMARY
["ipv6"][0]: {
828 "Summary address": SUMMARY
["ipv6"][0],
832 "External route count": 5,
836 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
839 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
841 step("Change the summary address mask to lower match (ex - 16 to 8)")
846 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"},
848 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
856 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
857 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
863 "Summary address": "2011::/16",
867 "External route count": 5,
871 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
874 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
877 "Verify that external routes(static / connected) are summarised"
878 " to configured summary address with newly configured mask."
881 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
884 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
885 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
887 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
890 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
892 step("Change the summary address mask to higher match (ex - 8 to 24)")
897 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
902 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
903 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
907 "Summary address": "2011::/32",
911 "External route count": 0,
915 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
918 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
921 "Verify that external routes(static / connected) are summarised"
922 " to configured summary address with newly configured mask."
924 step("Configure 2 summary address with different mask of same network.")
926 "Verify that external routes(static / connected) are summarised "
927 "to configured summary address with highest match."
930 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/32"}]}}
933 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
934 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
936 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
939 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
941 step(" Un configure one of the summary address.")
947 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
955 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
956 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
961 "Verify that external routes(static / connected) are summarised"
962 " to configured summary address with newly configured mask."
965 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
968 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
969 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
971 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
974 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
980 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"}
985 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
986 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
989 "Verify that external routes(static / connected) are summarised "
990 "to configured summary address with highest match."
992 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
995 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
996 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
998 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1001 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1003 write_test_footer(tc_name
)
1006 def ospfv3_type5_summary_tc45_p0(request
):
1007 """OSPF summarisation with Tag option"""
1008 tc_name
= request
.node
.name
1009 write_test_header(tc_name
)
1010 tgen
= get_topogen()
1012 # Don't run this test if we have any failure.
1013 if tgen
.routers_have_failure():
1014 pytest
.skip(tgen
.errors
)
1017 step("Bring up the base config as per the topology")
1018 step("Configure OSPF on all the routers of the topology.")
1019 reset_config_on_routers(tgen
)
1024 "Configure 5 static routes from the same network on R0"
1025 "5 static routes from different networks and redistribute in R0"
1027 input_dict_static_rtes
= {
1030 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1031 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1035 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1036 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1041 step("Verify that routes are learnt on R1.")
1044 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1045 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1046 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1049 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1052 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1057 "summary-address": [
1059 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1067 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1068 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1071 "Verify that external routes are summarised to configured summary"
1072 " address on R0 and only one route is sent to R1 with configured tag."
1074 input_dict_summary
= {
1075 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1079 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1080 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1082 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1085 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1087 step("Verify that show ip ospf summary should show the summaries with tag.")
1089 SUMMARY
["ipv6"][0]: {
1090 "Summary address": SUMMARY
["ipv6"][0],
1091 "Metric-type": "E2",
1094 "External route count": 5,
1098 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1101 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1103 step("Delete the configured summary")
1107 "summary-address": [
1109 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1118 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1119 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1121 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1123 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1126 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1130 result
= verify_rib(
1131 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1135 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1139 step("show ip ospf summary should not have any summary address.")
1141 SUMMARY
["ipv6"][0]: {
1142 "Summary address": SUMMARY
["ipv6"][0],
1143 "Metric-type": "E2",
1146 "External route count": 5,
1150 result
= verify_ospf_summary(
1151 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1155 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1157 step("Configure Min tag value")
1161 "summary-address": [
1162 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1167 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1168 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1169 input_dict_summary
= {
1170 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1174 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1175 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1177 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1180 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1182 step("Verify that show ip ospf summary should show the summaries with tag.")
1184 SUMMARY
["ipv6"][0]: {
1185 "Summary address": SUMMARY
["ipv6"][0],
1186 "Metric-type": "E2",
1189 "External route count": 5,
1193 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1196 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1198 step("Configure Max Tag Value")
1202 "summary-address": [
1204 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1212 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1213 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1215 input_dict_summary
= {
1216 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1220 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1221 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1223 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1226 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1229 "Verify that boundary values tags are used for summary route"
1230 " using show ip ospf route command."
1233 SUMMARY
["ipv6"][0]: {
1234 "Summary address": SUMMARY
["ipv6"][0],
1235 "Metric-type": "E2",
1238 "External route count": 5,
1242 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1245 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1247 step("configure new static route with different tag.")
1248 input_dict_static_rtes_11
= {
1251 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1255 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1256 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1258 step("New tag has not been used by summary address.")
1260 input_dict_summary
= {
1261 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1265 result
= verify_ospf6_rib(
1266 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1270 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1274 result
= verify_rib(
1285 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1288 "Verify that boundary values tags are used for summary route"
1289 " using show ip ospf route command."
1292 SUMMARY
["ipv6"][0]: {
1293 "Summary address": SUMMARY
["ipv6"][0],
1294 "Metric-type": "E2",
1297 "External route count": 5,
1301 result
= verify_ospf_summary(
1302 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1306 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1308 step("Delete the configured summary address")
1312 "summary-address": [
1314 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1323 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1324 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1327 "Verify that 6 routes are advertised to neighbour with 5 routes"
1328 " without any tag, 1 route with tag."
1332 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1333 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1334 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1337 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1339 step("Verify that summary address is flushed from neighbor.")
1342 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1345 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1349 result
= verify_rib(
1350 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1354 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1356 step("Configure summary first & then configure matching static route.")
1358 input_dict_static_rtes
= {
1361 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1362 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1366 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1367 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1372 "summary-address": [
1373 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1378 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1379 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1381 input_dict_static_rtes
= {
1384 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1385 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1389 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1390 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1392 step("Repeat steps 1 to 10 of summarisation in non Back bone area.")
1393 reset_config_on_routers(tgen
)
1395 step("Change the area id on the interface on R0")
1400 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1401 "ospf6": {"area": "0.0.0.0"},
1408 result
= create_interfaces_cfg(tgen
, input_dict
)
1409 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1415 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1416 "ospf6": {"area": "0.0.0.1"},
1422 result
= create_interfaces_cfg(tgen
, input_dict
)
1423 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1425 step("Change the area id on the interface ")
1430 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1431 "ospf6": {"area": "0.0.0.0"},
1438 result
= create_interfaces_cfg(tgen
, input_dict
)
1439 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1445 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1446 "ospf6": {"area": "0.0.0.1"},
1452 result
= create_interfaces_cfg(tgen
, input_dict
)
1453 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1455 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
1456 assert ospf_covergence
is True, "Testcase {} :Failed \n Error: {}".format(
1457 tc_name
, ospf_covergence
1461 "Configure 5 static routes from the same network on R0"
1462 "5 static routes from different networks and redistribute in R0"
1464 input_dict_static_rtes
= {
1467 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1468 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1472 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1473 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1478 step("Verify that routes are learnt on R1.")
1481 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1482 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1483 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1486 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1489 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1494 "summary-address": [
1496 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1504 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1505 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1508 "Verify that external routes are summarised to configured summary"
1509 " address on R0 and only one route is sent to R1 with configured tag."
1511 input_dict_summary
= {
1512 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1516 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1517 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1519 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1522 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1524 step("Verify that show ip ospf summary should show the summaries with tag.")
1526 SUMMARY
["ipv6"][0]: {
1527 "Summary address": SUMMARY
["ipv6"][0],
1528 "Metric-type": "E2",
1531 "External route count": 5,
1535 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1536 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1538 step("Delete the configured summary")
1542 "summary-address": [
1544 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1552 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1553 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1555 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1557 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1560 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1564 result
= verify_rib(
1565 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1569 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1573 step("show ip ospf summary should not have any summary address.")
1575 SUMMARY
["ipv6"][0]: {
1576 "Summary address": SUMMARY
["ipv6"][0],
1577 "Metric-type": "E2",
1580 "External route count": 5,
1584 result
= verify_ospf_summary(
1585 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1589 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1591 step("Configure Min tag value")
1595 "summary-address": [
1596 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1601 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1602 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1603 input_dict_summary
= {
1604 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1608 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1609 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1611 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1614 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1616 step("Verify that show ip ospf summary should show the summaries with tag.")
1618 SUMMARY
["ipv6"][0]: {
1619 "Summary address": SUMMARY
["ipv6"][0],
1620 "Metric-type": "E2",
1623 "External route count": 5,
1627 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1630 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1632 step("Configure Max Tag Value")
1636 "summary-address": [
1638 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1646 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1647 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1649 input_dict_summary
= {
1650 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1654 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1655 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1657 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1660 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1663 "Verify that boundary values tags are used for summary route"
1664 " using show ip ospf route command."
1667 SUMMARY
["ipv6"][0]: {
1668 "Summary address": SUMMARY
["ipv6"][0],
1669 "Metric-type": "E2",
1672 "External route count": 5,
1676 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1679 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1681 step("configure new static route with different tag.")
1682 input_dict_static_rtes_11
= {
1685 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1689 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1690 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1692 step("New tag has not been used by summary address.")
1694 input_dict_summary
= {
1695 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1699 result
= verify_ospf6_rib(
1700 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1704 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1708 result
= verify_rib(
1719 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1722 "Verify that boundary values tags are used for summary route"
1723 " using show ip ospf route command."
1726 SUMMARY
["ipv6"][0]: {
1727 "Summary address": SUMMARY
["ipv6"][0],
1728 "Metric-type": "E2",
1731 "External route count": 5,
1735 result
= verify_ospf_summary(
1736 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1740 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1742 step("Delete the configured summary address")
1746 "summary-address": [
1748 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1757 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1758 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1761 "Verify that 6 routes are advertised to neighbour with 5 routes"
1762 " without any tag, 1 route with tag."
1766 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1767 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1768 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1771 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1773 step("Verify that summary address is flushed from neighbor.")
1776 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1779 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1783 result
= verify_rib(
1784 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1788 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1790 step("Configure summary first & then configure matching static route.")
1792 input_dict_static_rtes
= {
1795 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1796 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1800 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1801 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1806 "summary-address": [
1807 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1812 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1813 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1815 input_dict_static_rtes
= {
1818 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1819 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1823 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1824 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1826 write_test_footer(tc_name
)
1829 def test_ospfv3_type5_summary_tc46_p0(request
):
1830 """OSPF summarisation with advertise and no advertise option"""
1831 tc_name
= request
.node
.name
1832 write_test_header(tc_name
)
1833 tgen
= get_topogen()
1835 # Don't run this test if we have any failure.
1836 if tgen
.routers_have_failure():
1837 pytest
.skip(tgen
.errors
)
1840 step("Bring up the base config as per the topology")
1841 step("Configure OSPF on all the routers of the topology.")
1842 reset_config_on_routers(tgen
)
1847 "Configure 5 static routes from the same network on R0"
1848 "5 static routes from different networks and redistribute in R0"
1850 input_dict_static_rtes
= {
1853 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1854 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1858 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1859 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1864 step("Verify that routes are learnt on R1.")
1867 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1868 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1869 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1872 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1875 "Configure External Route summary in R0 to summarise 5"
1876 " routes to one route with no advertise option."
1881 "summary-address": [
1883 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1891 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1892 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1895 "Verify that external routes are summarised to configured summary"
1896 " address on R0 and summary route is not advertised to neighbor as"
1897 " no advertise is configured.."
1900 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
1903 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1906 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1910 result
= verify_rib(
1911 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1915 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1917 step("Verify that show ip ospf summary should show the " "configured summaries.")
1919 SUMMARY
["ipv6"][0]: {
1920 "Summary address": SUMMARY
["ipv6"][0],
1921 "External route count": 5,
1925 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1928 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1930 step("Delete the configured summary")
1934 "summary-address": [
1936 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1944 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1945 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1947 step("Summary has 5 sec delay timer, sleep 5 secs...")
1950 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1952 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1955 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1959 result
= verify_rib(
1960 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1964 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1968 step("show ip ospf summary should not have any summary address.")
1970 SUMMARY
["ipv6"][0]: {
1971 "Summary address": SUMMARY
["ipv6"][0],
1972 "Metric-type": "E2",
1975 "External route count": 5,
1979 result
= verify_ospf_summary(
1980 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1984 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1986 step("Reconfigure summary with no advertise.")
1990 "summary-address": [
1992 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2000 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2001 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2004 "Verify that external routes are summarised to configured summary"
2005 " address on R0 and summary route is not advertised to neighbor as"
2006 " no advertise is configured.."
2009 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2012 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2015 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2019 result
= verify_rib(
2020 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2024 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2026 step("Verify that show ip ospf summary should show the " "configured summaries.")
2028 SUMMARY
["ipv6"][0]: {
2029 "Summary address": SUMMARY
["ipv6"][0],
2030 "External route count": 5,
2034 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2037 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2040 "Change summary address from no advertise to advertise "
2041 "(summary-address 10.0.0.0 255.255.0.0)"
2047 "summary-address": [
2049 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2057 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2058 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2063 "summary-address": [
2064 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2069 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2070 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2073 "Verify that external routes are summarised to configured summary "
2074 "address on R0 after 5 secs of delay timer expiry and only one "
2075 "route is sent to R1."
2077 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2080 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2081 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2083 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2086 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2088 step("Verify that show ip ospf summary should show the summaries.")
2090 SUMMARY
["ipv6"][0]: {
2091 "Summary address": SUMMARY
["ipv6"][0],
2092 "Metric-type": "E2",
2095 "External route count": 5,
2099 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2102 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2104 step("Verify that originally advertised routes are withdraw from there" " peer.")
2106 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2109 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2112 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2116 output
= tgen
.gears
["r0"].vtysh_cmd(
2117 "show ipv6 ospf6 database as-external json", isjson
=True
2120 output
= tgen
.gears
["r1"].vtysh_cmd(
2121 "show ipv6 ospf6 database as-external json", isjson
=True
2124 result
= verify_rib(
2125 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2129 ), "Testcase {} : Failed" "Error: Routes is present in RIB".format(tc_name
)
2131 write_test_footer(tc_name
)
2134 def test_ospfv3_type5_summary_tc48_p0(request
):
2135 """OSPF summarisation with route map modification of metric type."""
2136 tc_name
= request
.node
.name
2137 write_test_header(tc_name
)
2138 tgen
= get_topogen()
2140 # Don't run this test if we have any failure.
2141 if tgen
.routers_have_failure():
2142 pytest
.skip(tgen
.errors
)
2145 step("Bring up the base config as per the topology")
2146 reset_config_on_routers(tgen
)
2151 "Configure 5 static routes from the same network on R0"
2152 "5 static routes from different networks and redistribute in R0"
2154 input_dict_static_rtes
= {
2157 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2158 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2162 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2163 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2168 step("Verify that routes are learnt on R1.")
2171 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2172 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2173 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2176 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2179 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2185 "summary-address": [
2186 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2191 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2192 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2195 "Verify that external routes are summarised to configured summary "
2196 "address on R0 after 5 secs of delay timer expiry and only one "
2197 "route is sent to R1."
2199 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2202 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2203 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2205 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2208 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2210 step("Verify that show ip ospf summary should show the summaries.")
2212 SUMMARY
["ipv6"][0]: {
2213 "Summary address": SUMMARY
["ipv6"][0],
2214 "Metric-type": "E2",
2217 "External route count": 5,
2221 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2224 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2226 step("Verify that originally advertised routes are withdraw from there" " peer.")
2228 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2231 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2234 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2238 result
= verify_rib(
2239 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2243 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2246 "Configure route map and & rule to permit configured summary address,"
2247 " redistribute static & connected routes with the route map."
2249 step("Configure prefixlist to permit the static routes, add to route map.")
2250 # Create ip prefix list
2256 {"seqid": 10, "network": "any", "action": "permit"}
2262 result
= create_prefix_lists(tgen
, pfx_list
)
2263 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2272 "match": {"ipv6": {"prefix_lists": "pf_list_1_ipv6"}},
2278 result
= create_route_maps(tgen
, routemaps
)
2279 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2284 "redistribute": [{"redist_type": "static", "route_map": "rmap_ipv6"}]
2288 result
= create_router_ospf(tgen
, topo
, ospf_red_r1
)
2289 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2292 "Verify that external routes are summarised to configured"
2293 "summary address on R0 and only one route is sent to R1. Verify that "
2294 "show ip ospf summary should show the configure summaries."
2297 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2300 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2301 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2303 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2306 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2309 SUMMARY
["ipv6"][0]: {
2310 "Summary address": SUMMARY
["ipv6"][0],
2311 "Metric-type": "E2",
2314 "External route count": 5,
2318 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2321 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2323 step("Configure metric type as 1 in route map.")
2332 "set": {"metric-type": "type-1"},
2338 result
= create_route_maps(tgen
, routemaps
)
2339 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2342 "Verify that external routes(static / connected) are summarised"
2343 " to configured summary address with metric type 2."
2346 SUMMARY
["ipv6"][0]: {
2347 "Summary address": SUMMARY
["ipv6"][0],
2348 "Metric-type": "E2",
2351 "External route count": 5,
2355 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2358 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2360 step("Un configure metric type from route map.")
2369 "set": {"metric-type": "type-1", "delete": True},
2375 result
= create_route_maps(tgen
, routemaps
)
2376 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2379 "Verify that external routes(static / connected) are summarised"
2380 " to configured summary address with metric type 2."
2383 SUMMARY
["ipv6"][0]: {
2384 "Summary address": SUMMARY
["ipv6"][0],
2385 "Metric-type": "E2",
2388 "External route count": 5,
2392 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2395 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2397 step("Change rule from permit to deny in prefix list.")
2403 {"seqid": 10, "network": "any", "action": "deny"}
2409 result
= create_prefix_lists(tgen
, pfx_list
)
2410 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2413 "Verify that previously originated summary lsa "
2414 "is withdrawn from the neighbor."
2416 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2419 step("summary route has delay of 5 secs, wait for 5 secs")
2423 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2426 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2430 result
= verify_rib(
2431 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2435 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2437 write_test_footer(tc_name
)
2440 def test_ospfv3_type5_summary_tc51_p2(request
):
2443 verify ospf ASBR summary config and show commands behaviours.
2445 tc_name
= request
.node
.name
2446 write_test_header(tc_name
)
2447 tgen
= get_topogen()
2449 # Don't run this test if we have any failure.
2450 if tgen
.routers_have_failure():
2451 pytest
.skip(tgen
.errors
)
2454 step("Bring up the base config as per the topology")
2455 reset_config_on_routers(tgen
)
2457 step("Configure all the supported OSPF ASBR summary commands on DUT.")
2461 "summary-address": [
2463 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2468 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2473 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2478 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2486 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2487 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2489 step("Configure and re configure all the commands 10 times in a loop.")
2491 for itrate
in range(0, 10):
2495 "summary-address": [
2497 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2502 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2507 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2512 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2520 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2521 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
2528 "summary-address": [
2530 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2536 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2542 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2548 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2557 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2558 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2560 step("Verify the show commands")
2563 SUMMARY
["ipv6"][3]: {
2564 "Summary address": SUMMARY
["ipv6"][3],
2565 "Metric-type": "E2",
2568 "External route count": 0,
2572 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2575 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2577 write_test_footer(tc_name
)
2580 def test_ospfv3_type5_summary_tc49_p2(request
):
2581 """OSPF summarisation Chaos."""
2582 tc_name
= request
.node
.name
2583 write_test_header(tc_name
)
2584 tgen
= get_topogen()
2586 # Don't run this test if we have any failure.
2587 if tgen
.routers_have_failure():
2588 pytest
.skip(tgen
.errors
)
2591 step("Bring up the base config as per the topology")
2592 reset_config_on_routers(tgen
)
2597 "Configure 5 static routes from the same network on R0"
2598 "5 static routes from different networks and redistribute in R0"
2600 input_dict_static_rtes
= {
2603 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2604 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2608 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2609 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2614 step("Verify that routes are learnt on R1.")
2617 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2618 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2619 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2622 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2625 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2631 "summary-address": [
2632 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2637 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2638 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2641 "Verify that external routes are summarised to configured summary "
2642 "address on R0 after 5 secs of delay timer expiry and only one "
2643 "route is sent to R1."
2645 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2648 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2649 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2651 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2654 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2656 step("Verify that show ip ospf summary should show the summaries.")
2658 SUMMARY
["ipv6"][0]: {
2659 "Summary address": SUMMARY
["ipv6"][0],
2660 "Metric-type": "E2",
2663 "External route count": 5,
2667 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2670 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2672 step("Verify that originally advertised routes are withdraw from there" " peer.")
2674 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2677 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2680 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2684 result
= verify_rib(
2685 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2689 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2691 step("Reload the FRR router")
2692 # stop/start -> restart FRR router and verify
2693 stop_router(tgen
, "r0")
2694 start_router(tgen
, "r0")
2697 "Verify that external routes are summarised to configured summary "
2698 "address on R0 after 5 secs of delay timer expiry and only one "
2699 "route is sent to R1."
2701 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2704 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2705 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2707 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2710 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2712 step("Verify that show ip ospf summary should show the summaries.")
2714 SUMMARY
["ipv6"][0]: {
2715 "Summary address": SUMMARY
["ipv6"][0],
2716 "Metric-type": "E2",
2719 "External route count": 5,
2723 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2726 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2728 step("Verify that originally advertised routes are withdraw from there" " peer.")
2730 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2733 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2736 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2740 result
= verify_rib(
2741 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2745 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2747 write_test_footer(tc_name
)
2750 if __name__
== "__main__":
2751 args
= ["-s"] + sys
.argv
[1:]
2752 sys
.exit(pytest
.main(args
))