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
,
58 create_interfaces_cfg
,
60 from lib
.topolog
import logger
61 from lib
.topojson
import build_config_from_json
62 from lib
.ospf
import (
63 verify_ospf6_neighbor
,
70 pytestmark
= [pytest
.mark
.ospfd
, pytest
.mark
.staticd
]
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 # Starting topology, create tmp files which are loaded to routers
161 # to start daemons and then start routers
164 # Creating configuration from JSON
165 build_config_from_json(tgen
, topo
)
167 # Don't run this test if we have any failure.
168 if tgen
.routers_have_failure():
169 pytest
.skip(tgen
.errors
)
170 # Api call verify whether OSPF is converged
171 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
172 assert ospf_covergence
is True, "setup_module :Failed \n Error:" " {}".format(
176 logger
.info("Running setup_module() done")
179 def teardown_module(mod
):
181 Teardown the pytest environment.
186 logger
.info("Running teardown_module to delete topology")
190 # Stop toplogy and Remove tmp files
194 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
196 logger
.info("=" * 40)
199 def red_static(dut
, config
=True):
201 Local 'def' for Redstribute static routes inside ospf.
205 * `dut` : DUT on which configs have to be made.
206 * `config` : True or False, True by default for configure, set False for
212 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "static"}]}}}
216 "ospf6": {"redistribute": [{"redist_type": "static", "delete": True}]}
219 result
= create_router_ospf(tgen
, topo
, ospf_red
)
220 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
223 def red_connected(dut
, config
=True):
225 Local 'def' for Redstribute connected routes inside ospf
229 * `dut` : DUT on which configs have to be made.
230 * `config` : True or False, True by default for configure, set False for
236 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "connected"}]}}}
241 "redistribute": [{"redist_type": "connected", "delete": True}]
245 result
= create_router_ospf(tgen
, topo
, ospf_red
)
246 assert result
is True, "Testcase: Failed \n Error: {}".format(result
)
249 # ##################################
250 # Test cases start here.
251 # ##################################
254 def test_ospfv3_type5_summary_tc42_p0(request
):
255 """OSPF summarisation functionality."""
256 tc_name
= request
.node
.name
257 write_test_header(tc_name
)
260 # Don't run this test if we have any failure.
261 if tgen
.routers_have_failure():
262 pytest
.skip(tgen
.errors
)
265 step("Bring up the base config as per the topology")
266 reset_config_on_routers(tgen
)
271 "Configure 5 static routes from the same network on R0"
272 "5 static routes from different networks and redistribute in R0"
274 input_dict_static_rtes
= {
277 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
278 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
282 result
= create_static_routes(tgen
, input_dict_static_rtes
)
283 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
288 step("Verify that routes are learnt on R1.")
291 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
292 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
293 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
296 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
299 "Configure External Route summary in R0 to summarise 5"
300 " routes to one route. with aggregate timer as 6 sec"
307 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
313 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
314 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
317 "Verify that external routes are summarised to configured summary "
318 "address on R0 after 5 secs of delay timer expiry and only one "
319 "route is sent to R1."
321 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
324 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
325 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
327 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
330 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
332 step("Verify that show ip ospf summary should show the summaries.")
334 SUMMARY
["ipv6"][0]: {
335 "Summary address": SUMMARY
["ipv6"][0],
339 "External route count": 5,
343 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
346 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
348 step("Verify that originally advertised routes are withdraw from there" " peer.")
350 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
353 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
356 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
361 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
365 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
367 step("Delete the configured summary")
373 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
375 "del_aggr_timer": True,
382 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
383 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
385 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
387 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
390 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
395 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
399 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
403 step("show ip ospf summary should not have any summary address.")
405 SUMMARY
["ipv6"][0]: {
406 "Summary address": SUMMARY
["ipv6"][0],
410 "External route count": 5,
414 result
= verify_ospf_summary(
415 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
419 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
422 step("All 5 routes are advertised after deletion of configured summary.")
424 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
425 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
427 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
430 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
432 step("configure the summary again and delete static routes .")
437 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
442 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
443 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
446 SUMMARY
["ipv6"][0]: {
447 "Summary address": SUMMARY
["ipv6"][0],
451 "External route count": 5,
455 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
458 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
463 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True}
467 result
= create_static_routes(tgen
, input_dict
)
468 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
470 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
471 step("Verify that summary route is withdrawn from R1.")
474 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
477 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
482 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
486 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
488 step("Add back static routes.")
489 input_dict_static_rtes
= {
490 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
492 result
= create_static_routes(tgen
, input_dict_static_rtes
)
493 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
496 "Verify that external routes are summarised to configured summary"
497 " address on R0 and only one route is sent to R1."
501 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
, expected
=False)
504 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
509 tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
, expected
=False
513 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
515 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
518 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
519 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
521 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
524 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
526 step("Verify that show ip ospf summary should show configure summaries.")
529 SUMMARY
["ipv6"][0]: {
530 "Summary address": SUMMARY
["ipv6"][0],
534 "External route count": 5,
538 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
541 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
543 step("Configure new static route which is matching configured summary.")
544 input_dict_static_rtes
= {
546 "static_routes": [{"network": NETWORK_11
["ipv6"], "next_hop": "blackhole"}]
549 result
= create_static_routes(tgen
, input_dict_static_rtes
)
550 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
552 # step("verify that summary lsa is not refreshed.")
553 # show ip ospf database command is not working, waiting for DEV fix.
555 step("Delete one of the static route.")
556 input_dict_static_rtes
= {
559 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "delete": True}
563 result
= create_static_routes(tgen
, input_dict_static_rtes
)
564 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
566 # step("verify that summary lsa is not refreshed.")
567 # show ip ospf database command is not working, waiting for DEV fix.
569 # step("Verify that deleted static route is removed from ospf LSDB.")
570 # show ip ospf database command is not working, waiting for DEV fix.
573 "Configure redistribute connected and configure ospf external"
574 " summary address to summarise the connected routes."
579 clear_ospf(tgen
, dut
, ospf
="ospf6")
581 ip
= topo
["routers"]["r0"]["links"]["r3"]["ipv6"]
583 ip_net
= str(ipaddress
.ip_interface(u
"{}".format(ip
)).network
)
587 "summary-address": [{"prefix": ip_net
.split("/")[0], "mask": "8"}]
591 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
592 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
595 "Verify that external routes are summarised to configured "
596 "summary address on R0 and only one route is sent to R1."
599 input_dict_summary
= {"r0": {"static_routes": [{"network": "fd00::/64"}]}}
601 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
602 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
604 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
607 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
609 step("Shut one of the interface")
610 intf
= topo
["routers"]["r0"]["links"]["r3-link0"]["interface"]
611 shutdown_bringup_interface(tgen
, dut
, intf
, False)
613 # step("verify that summary lsa is not refreshed.")
614 # show ip ospf database command is not working, waiting for DEV fix.
616 # step("Verify that deleted connected route is removed from ospf LSDB.")
617 # show ip ospf database command is not working, waiting for DEV fix.
619 step("Un do shut the interface")
620 shutdown_bringup_interface(tgen
, dut
, intf
, True)
622 # step("verify that summary lsa is not refreshed.")
623 # show ip ospf database command is not working, waiting for DEV fix.
625 # step("Verify that deleted connected route is removed from ospf LSDB.")
626 # show ip ospf database command is not working, waiting for DEV fix.
628 step("Delete OSPF process.")
629 ospf_del
= {"r0": {"ospf6": {"delete": True}}}
630 result
= create_router_ospf(tgen
, topo
, ospf_del
)
631 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
633 step("Reconfigure ospf process with summary")
634 reset_config_on_routers(tgen
)
636 input_dict_static_rtes
= {
639 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
640 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
644 result
= create_static_routes(tgen
, input_dict_static_rtes
)
645 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
654 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
659 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
660 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
662 "Verify that external routes are summarised to configured summary "
663 "address on R0 and only one route is sent to R1."
667 SUMMARY
["ipv6"][0]: {
668 "Summary address": SUMMARY
["ipv6"][0],
672 "External route count": 5,
676 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
679 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
681 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
684 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
685 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
687 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
690 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
696 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
701 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
702 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
704 # step("verify that summary lsa is not refreshed.")
705 # show ip ospf database command is not working, waiting for DEV fix.
707 step("Delete the redistribute command in ospf.")
709 red_connected(dut
, config
=False)
710 red_static(dut
, config
=False)
712 step("Verify that summary route is withdrawn from the peer.")
715 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
718 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
723 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
727 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
734 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
742 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
743 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
745 write_test_footer(tc_name
)
748 def test_ospfv3_type5_summary_tc43_p0(request
):
749 """OSPF summarisation with metric type 2."""
750 tc_name
= request
.node
.name
751 write_test_header(tc_name
)
754 # Don't run this test if we have any failure.
755 if tgen
.routers_have_failure():
756 pytest
.skip(tgen
.errors
)
759 step("Bring up the base config as per the topology")
760 reset_config_on_routers(tgen
)
765 "Configure 5 static routes from the same network on R0"
766 "5 static routes from different networks and redistribute in R0"
768 input_dict_static_rtes
= {
771 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
772 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
776 result
= create_static_routes(tgen
, input_dict_static_rtes
)
777 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
782 step("Verify that routes are learnt on R1.")
785 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
786 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
787 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
790 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
793 "Configure External Route summary in R0 to summarise 5" " routes to one route."
799 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
804 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
805 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
807 "Verify that external routes are summarised to configured summary "
808 "address on R0 after 5 secs of delay timer expiry and only one "
809 "route is sent to R1."
811 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
814 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
815 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
817 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
820 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
822 step("Verify that show ip ospf summary should show the summaries.")
824 SUMMARY
["ipv6"][0]: {
825 "Summary address": SUMMARY
["ipv6"][0],
829 "External route count": 5,
833 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
836 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
838 step("Change the summary address mask to lower match (ex - 16 to 8)")
843 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"},
845 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
853 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
854 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
860 "Summary address": "2011::/16",
864 "External route count": 5,
868 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
871 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
874 "Verify that external routes(static / connected) are summarised"
875 " to configured summary address with newly configured mask."
878 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
881 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
882 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
884 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
887 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
889 step("Change the summary address mask to higher match (ex - 8 to 24)")
894 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
899 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
900 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
904 "Summary address": "2011::/32",
908 "External route count": 0,
912 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
915 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
918 "Verify that external routes(static / connected) are summarised"
919 " to configured summary address with newly configured mask."
921 step("Configure 2 summary address with different mask of same network.")
923 "Verify that external routes(static / connected) are summarised "
924 "to configured summary address with highest match."
927 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/32"}]}}
930 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
931 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
933 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
936 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
938 step(" Un configure one of the summary address.")
944 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
952 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
953 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
958 "Verify that external routes(static / connected) are summarised"
959 " to configured summary address with newly configured mask."
962 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
965 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
966 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
968 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
971 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
977 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"}
982 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
983 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
986 "Verify that external routes(static / connected) are summarised "
987 "to configured summary address with highest match."
989 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
992 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
993 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
995 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
998 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1000 write_test_footer(tc_name
)
1003 def ospfv3_type5_summary_tc45_p0(request
):
1004 """OSPF summarisation with Tag option"""
1005 tc_name
= request
.node
.name
1006 write_test_header(tc_name
)
1007 tgen
= get_topogen()
1009 # Don't run this test if we have any failure.
1010 if tgen
.routers_have_failure():
1011 pytest
.skip(tgen
.errors
)
1014 step("Bring up the base config as per the topology")
1015 step("Configure OSPF on all the routers of the topology.")
1016 reset_config_on_routers(tgen
)
1021 "Configure 5 static routes from the same network on R0"
1022 "5 static routes from different networks and redistribute in R0"
1024 input_dict_static_rtes
= {
1027 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1028 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1032 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1033 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1038 step("Verify that routes are learnt on R1.")
1041 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1042 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1043 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1046 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1049 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1054 "summary-address": [
1056 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1064 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1065 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1068 "Verify that external routes are summarised to configured summary"
1069 " address on R0 and only one route is sent to R1 with configured tag."
1071 input_dict_summary
= {
1072 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1076 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1077 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1079 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1082 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1084 step("Verify that show ip ospf summary should show the summaries with tag.")
1086 SUMMARY
["ipv6"][0]: {
1087 "Summary address": SUMMARY
["ipv6"][0],
1088 "Metric-type": "E2",
1091 "External route count": 5,
1095 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1098 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1100 step("Delete the configured summary")
1104 "summary-address": [
1106 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1115 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1116 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1118 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1120 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1123 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1127 result
= verify_rib(
1128 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1132 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1136 step("show ip ospf summary should not have any summary address.")
1138 SUMMARY
["ipv6"][0]: {
1139 "Summary address": SUMMARY
["ipv6"][0],
1140 "Metric-type": "E2",
1143 "External route count": 5,
1147 result
= verify_ospf_summary(
1148 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1152 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1154 step("Configure Min tag value")
1158 "summary-address": [
1159 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1164 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1165 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1166 input_dict_summary
= {
1167 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1171 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1172 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1174 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1177 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1179 step("Verify that show ip ospf summary should show the summaries with tag.")
1181 SUMMARY
["ipv6"][0]: {
1182 "Summary address": SUMMARY
["ipv6"][0],
1183 "Metric-type": "E2",
1186 "External route count": 5,
1190 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1193 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1195 step("Configure Max Tag Value")
1199 "summary-address": [
1201 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1209 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1210 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1212 input_dict_summary
= {
1213 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1217 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1218 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1220 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1223 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1226 "Verify that boundary values tags are used for summary route"
1227 " using show ip ospf route command."
1230 SUMMARY
["ipv6"][0]: {
1231 "Summary address": SUMMARY
["ipv6"][0],
1232 "Metric-type": "E2",
1235 "External route count": 5,
1239 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1242 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1244 step("configure new static route with different tag.")
1245 input_dict_static_rtes_11
= {
1248 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1252 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1253 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1255 step("New tag has not been used by summary address.")
1257 input_dict_summary
= {
1258 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1262 result
= verify_ospf6_rib(
1263 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1267 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1271 result
= verify_rib(
1282 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1285 "Verify that boundary values tags are used for summary route"
1286 " using show ip ospf route command."
1289 SUMMARY
["ipv6"][0]: {
1290 "Summary address": SUMMARY
["ipv6"][0],
1291 "Metric-type": "E2",
1294 "External route count": 5,
1298 result
= verify_ospf_summary(
1299 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1303 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1305 step("Delete the configured summary address")
1309 "summary-address": [
1311 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1320 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1321 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1324 "Verify that 6 routes are advertised to neighbour with 5 routes"
1325 " without any tag, 1 route with tag."
1329 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1330 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1331 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1334 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1336 step("Verify that summary address is flushed from neighbor.")
1339 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1342 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1346 result
= verify_rib(
1347 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1351 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1353 step("Configure summary first & then configure matching static route.")
1355 input_dict_static_rtes
= {
1358 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1359 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1363 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1364 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1369 "summary-address": [
1370 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1375 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1376 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1378 input_dict_static_rtes
= {
1381 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1382 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1386 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1387 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1389 step("Repeat steps 1 to 10 of summarisation in non Back bone area.")
1390 reset_config_on_routers(tgen
)
1392 step("Change the area id on the interface on R0")
1397 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1398 "ospf6": {"area": "0.0.0.0"},
1405 result
= create_interfaces_cfg(tgen
, input_dict
)
1406 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1412 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1413 "ospf6": {"area": "0.0.0.1"},
1419 result
= create_interfaces_cfg(tgen
, input_dict
)
1420 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1422 step("Change the area id on the interface ")
1427 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1428 "ospf6": {"area": "0.0.0.0"},
1435 result
= create_interfaces_cfg(tgen
, input_dict
)
1436 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1442 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1443 "ospf6": {"area": "0.0.0.1"},
1449 result
= create_interfaces_cfg(tgen
, input_dict
)
1450 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1452 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
1453 assert ospf_covergence
is True, "Testcase {} :Failed \n Error: {}".format(
1454 tc_name
, ospf_covergence
1458 "Configure 5 static routes from the same network on R0"
1459 "5 static routes from different networks and redistribute in R0"
1461 input_dict_static_rtes
= {
1464 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1465 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1469 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1470 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1475 step("Verify that routes are learnt on R1.")
1478 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1479 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1480 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1483 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1486 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1491 "summary-address": [
1493 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1501 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1502 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1505 "Verify that external routes are summarised to configured summary"
1506 " address on R0 and only one route is sent to R1 with configured tag."
1508 input_dict_summary
= {
1509 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1513 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1514 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1516 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1519 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1521 step("Verify that show ip ospf summary should show the summaries with tag.")
1523 SUMMARY
["ipv6"][0]: {
1524 "Summary address": SUMMARY
["ipv6"][0],
1525 "Metric-type": "E2",
1528 "External route count": 5,
1532 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1533 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1535 step("Delete the configured summary")
1539 "summary-address": [
1541 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1549 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1550 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1552 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1554 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1557 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1561 result
= verify_rib(
1562 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1566 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1570 step("show ip ospf summary should not have any summary address.")
1572 SUMMARY
["ipv6"][0]: {
1573 "Summary address": SUMMARY
["ipv6"][0],
1574 "Metric-type": "E2",
1577 "External route count": 5,
1581 result
= verify_ospf_summary(
1582 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1586 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1588 step("Configure Min tag value")
1592 "summary-address": [
1593 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1598 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1599 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1600 input_dict_summary
= {
1601 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1605 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1606 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1608 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1611 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1613 step("Verify that show ip ospf summary should show the summaries with tag.")
1615 SUMMARY
["ipv6"][0]: {
1616 "Summary address": SUMMARY
["ipv6"][0],
1617 "Metric-type": "E2",
1620 "External route count": 5,
1624 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1627 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1629 step("Configure Max Tag Value")
1633 "summary-address": [
1635 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1643 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1644 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1646 input_dict_summary
= {
1647 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1651 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1652 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1654 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1657 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1660 "Verify that boundary values tags are used for summary route"
1661 " using show ip ospf route command."
1664 SUMMARY
["ipv6"][0]: {
1665 "Summary address": SUMMARY
["ipv6"][0],
1666 "Metric-type": "E2",
1669 "External route count": 5,
1673 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1676 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1678 step("configure new static route with different tag.")
1679 input_dict_static_rtes_11
= {
1682 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1686 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1687 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1689 step("New tag has not been used by summary address.")
1691 input_dict_summary
= {
1692 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1696 result
= verify_ospf6_rib(
1697 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1701 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1705 result
= verify_rib(
1716 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1719 "Verify that boundary values tags are used for summary route"
1720 " using show ip ospf route command."
1723 SUMMARY
["ipv6"][0]: {
1724 "Summary address": SUMMARY
["ipv6"][0],
1725 "Metric-type": "E2",
1728 "External route count": 5,
1732 result
= verify_ospf_summary(
1733 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1737 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1739 step("Delete the configured summary address")
1743 "summary-address": [
1745 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1754 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1755 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1758 "Verify that 6 routes are advertised to neighbour with 5 routes"
1759 " without any tag, 1 route with tag."
1763 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1764 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1765 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1768 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1770 step("Verify that summary address is flushed from neighbor.")
1773 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1776 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1780 result
= verify_rib(
1781 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1785 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1787 step("Configure summary first & then configure matching static route.")
1789 input_dict_static_rtes
= {
1792 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1793 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1797 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1798 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1803 "summary-address": [
1804 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1809 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1810 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1812 input_dict_static_rtes
= {
1815 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1816 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1820 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1821 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1823 write_test_footer(tc_name
)
1826 def test_ospfv3_type5_summary_tc46_p0(request
):
1827 """OSPF summarisation with advertise and no advertise option"""
1828 tc_name
= request
.node
.name
1829 write_test_header(tc_name
)
1830 tgen
= get_topogen()
1832 # Don't run this test if we have any failure.
1833 if tgen
.routers_have_failure():
1834 pytest
.skip(tgen
.errors
)
1837 step("Bring up the base config as per the topology")
1838 step("Configure OSPF on all the routers of the topology.")
1839 reset_config_on_routers(tgen
)
1844 "Configure 5 static routes from the same network on R0"
1845 "5 static routes from different networks and redistribute in R0"
1847 input_dict_static_rtes
= {
1850 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1851 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1855 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1856 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1861 step("Verify that routes are learnt on R1.")
1864 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1865 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1866 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1869 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1872 "Configure External Route summary in R0 to summarise 5"
1873 " routes to one route with no advertise option."
1878 "summary-address": [
1880 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1888 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1889 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1892 "Verify that external routes are summarised to configured summary"
1893 " address on R0 and summary route is not advertised to neighbor as"
1894 " no advertise is configured.."
1897 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
1900 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1903 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1907 result
= verify_rib(
1908 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1912 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1914 step("Verify that show ip ospf summary should show the " "configured summaries.")
1916 SUMMARY
["ipv6"][0]: {
1917 "Summary address": SUMMARY
["ipv6"][0],
1918 "External route count": 5,
1922 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1925 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1927 step("Delete the configured summary")
1931 "summary-address": [
1933 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1941 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1942 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1944 step("Summary has 5 sec delay timer, sleep 5 secs...")
1947 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1949 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1952 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1956 result
= verify_rib(
1957 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1961 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1965 step("show ip ospf summary should not have any summary address.")
1967 SUMMARY
["ipv6"][0]: {
1968 "Summary address": SUMMARY
["ipv6"][0],
1969 "Metric-type": "E2",
1972 "External route count": 5,
1976 result
= verify_ospf_summary(
1977 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1981 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1983 step("Reconfigure summary with no advertise.")
1987 "summary-address": [
1989 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1997 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1998 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2001 "Verify that external routes are summarised to configured summary"
2002 " address on R0 and summary route is not advertised to neighbor as"
2003 " no advertise is configured.."
2006 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2009 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2012 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2016 result
= verify_rib(
2017 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2021 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2023 step("Verify that show ip ospf summary should show the " "configured summaries.")
2025 SUMMARY
["ipv6"][0]: {
2026 "Summary address": SUMMARY
["ipv6"][0],
2027 "External route count": 5,
2031 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2034 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2037 "Change summary address from no advertise to advertise "
2038 "(summary-address 10.0.0.0 255.255.0.0)"
2044 "summary-address": [
2046 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2054 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2055 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2060 "summary-address": [
2061 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2066 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2067 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2070 "Verify that external routes are summarised to configured summary "
2071 "address on R0 after 5 secs of delay timer expiry and only one "
2072 "route is sent to R1."
2074 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2077 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2078 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2080 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2083 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2085 step("Verify that show ip ospf summary should show the summaries.")
2087 SUMMARY
["ipv6"][0]: {
2088 "Summary address": SUMMARY
["ipv6"][0],
2089 "Metric-type": "E2",
2092 "External route count": 5,
2096 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2099 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2101 step("Verify that originally advertised routes are withdraw from there" " peer.")
2102 output
= tgen
.gears
["r0"].vtysh_cmd(
2103 "show ipv6 ospf6 database as-external json", isjson
=True
2106 output
= tgen
.gears
["r1"].vtysh_cmd(
2107 "show ipv6 ospf6 database as-external json", isjson
=True
2111 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2114 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2117 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2121 result
= verify_rib(
2122 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2126 ), "Testcase {} : Failed" "Error: Routes is present in RIB".format(tc_name
)
2128 write_test_footer(tc_name
)
2131 def test_ospfv3_type5_summary_tc48_p0(request
):
2132 """OSPF summarisation with route map modification of metric type."""
2133 tc_name
= request
.node
.name
2134 write_test_header(tc_name
)
2135 tgen
= get_topogen()
2137 # Don't run this test if we have any failure.
2138 if tgen
.routers_have_failure():
2139 pytest
.skip(tgen
.errors
)
2142 step("Bring up the base config as per the topology")
2143 reset_config_on_routers(tgen
)
2148 "Configure 5 static routes from the same network on R0"
2149 "5 static routes from different networks and redistribute in R0"
2151 input_dict_static_rtes
= {
2154 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2155 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2159 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2160 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2165 step("Verify that routes are learnt on R1.")
2168 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2169 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2170 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2173 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2176 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2182 "summary-address": [
2183 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2188 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2189 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2192 "Verify that external routes are summarised to configured summary "
2193 "address on R0 after 5 secs of delay timer expiry and only one "
2194 "route is sent to R1."
2196 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2199 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2200 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2202 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2205 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2207 step("Verify that show ip ospf summary should show the summaries.")
2209 SUMMARY
["ipv6"][0]: {
2210 "Summary address": SUMMARY
["ipv6"][0],
2211 "Metric-type": "E2",
2214 "External route count": 5,
2218 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2221 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2223 step("Verify that originally advertised routes are withdraw from there" " peer.")
2225 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2228 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2231 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2235 result
= verify_rib(
2236 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2240 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2243 "Configure route map and & rule to permit configured summary address,"
2244 " redistribute static & connected routes with the route map."
2246 step("Configure prefixlist to permit the static routes, add to route map.")
2247 # Create ip prefix list
2253 {"seqid": 10, "network": "any", "action": "permit"}
2259 result
= create_prefix_lists(tgen
, pfx_list
)
2260 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2269 "match": {"ipv6": {"prefix_lists": "pf_list_1_ipv6"}},
2275 result
= create_route_maps(tgen
, routemaps
)
2276 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2281 "redistribute": [{"redist_type": "static", "route_map": "rmap_ipv6"}]
2285 result
= create_router_ospf(tgen
, topo
, ospf_red_r1
)
2286 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2289 "Verify that external routes are summarised to configured"
2290 "summary address on R0 and only one route is sent to R1. Verify that "
2291 "show ip ospf summary should show the configure summaries."
2294 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2297 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2298 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2300 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2303 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2306 SUMMARY
["ipv6"][0]: {
2307 "Summary address": SUMMARY
["ipv6"][0],
2308 "Metric-type": "E2",
2311 "External route count": 5,
2315 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2318 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2320 step("Configure metric type as 1 in route map.")
2329 "set": {"metric-type": "type-1"},
2335 result
= create_route_maps(tgen
, routemaps
)
2336 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2339 "Verify that external routes(static / connected) are summarised"
2340 " to configured summary address with metric type 2."
2343 SUMMARY
["ipv6"][0]: {
2344 "Summary address": SUMMARY
["ipv6"][0],
2345 "Metric-type": "E2",
2348 "External route count": 5,
2352 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2355 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2357 step("Un configure metric type from route map.")
2366 "set": {"metric-type": "type-1", "delete": True},
2372 result
= create_route_maps(tgen
, routemaps
)
2373 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2376 "Verify that external routes(static / connected) are summarised"
2377 " to configured summary address with metric type 2."
2380 SUMMARY
["ipv6"][0]: {
2381 "Summary address": SUMMARY
["ipv6"][0],
2382 "Metric-type": "E2",
2385 "External route count": 5,
2389 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2392 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2394 step("Change rule from permit to deny in prefix list.")
2400 {"seqid": 10, "network": "any", "action": "deny"}
2406 result
= create_prefix_lists(tgen
, pfx_list
)
2407 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2410 "Verify that previously originated summary lsa "
2411 "is withdrawn from the neighbor."
2413 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2416 step("summary route has delay of 5 secs, wait for 5 secs")
2420 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2423 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2427 result
= verify_rib(
2428 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2432 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2434 write_test_footer(tc_name
)
2437 def test_ospfv3_type5_summary_tc51_p2(request
):
2440 verify ospf ASBR summary config and show commands behaviours.
2442 tc_name
= request
.node
.name
2443 write_test_header(tc_name
)
2444 tgen
= get_topogen()
2446 # Don't run this test if we have any failure.
2447 if tgen
.routers_have_failure():
2448 pytest
.skip(tgen
.errors
)
2451 step("Bring up the base config as per the topology")
2452 reset_config_on_routers(tgen
)
2454 step("Configure all the supported OSPF ASBR summary commands on DUT.")
2458 "summary-address": [
2460 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2465 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2470 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2475 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2483 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2484 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2486 step("Configure and re configure all the commands 10 times in a loop.")
2488 for itrate
in range(0, 10):
2492 "summary-address": [
2494 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2499 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2504 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2509 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2517 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2518 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
2525 "summary-address": [
2527 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2533 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2539 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2545 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2554 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2555 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2557 step("Verify the show commands")
2560 SUMMARY
["ipv6"][3]: {
2561 "Summary address": SUMMARY
["ipv6"][3],
2562 "Metric-type": "E2",
2565 "External route count": 0,
2569 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2572 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2574 write_test_footer(tc_name
)
2577 def test_ospfv3_type5_summary_tc49_p2(request
):
2578 """OSPF summarisation Chaos."""
2579 tc_name
= request
.node
.name
2580 write_test_header(tc_name
)
2581 tgen
= get_topogen()
2583 # Don't run this test if we have any failure.
2584 if tgen
.routers_have_failure():
2585 pytest
.skip(tgen
.errors
)
2588 step("Bring up the base config as per the topology")
2589 reset_config_on_routers(tgen
)
2594 "Configure 5 static routes from the same network on R0"
2595 "5 static routes from different networks and redistribute in R0"
2597 input_dict_static_rtes
= {
2600 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2601 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2605 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2606 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2611 step("Verify that routes are learnt on R1.")
2614 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2615 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2616 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2619 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2622 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2628 "summary-address": [
2629 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2634 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2635 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2638 "Verify that external routes are summarised to configured summary "
2639 "address on R0 after 5 secs of delay timer expiry and only one "
2640 "route is sent to R1."
2642 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2645 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2646 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2648 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2651 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2653 step("Verify that show ip ospf summary should show the summaries.")
2655 SUMMARY
["ipv6"][0]: {
2656 "Summary address": SUMMARY
["ipv6"][0],
2657 "Metric-type": "E2",
2660 "External route count": 5,
2664 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2667 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2669 step("Verify that originally advertised routes are withdraw from there" " peer.")
2671 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2674 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2677 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2681 result
= verify_rib(
2682 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2686 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2688 step("Reload the FRR router")
2689 # stop/start -> restart FRR router and verify
2690 stop_router(tgen
, "r0")
2691 start_router(tgen
, "r0")
2694 "Verify that external routes are summarised to configured summary "
2695 "address on R0 after 5 secs of delay timer expiry and only one "
2696 "route is sent to R1."
2698 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2701 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2702 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2704 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2707 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2709 step("Verify that show ip ospf summary should show the summaries.")
2711 SUMMARY
["ipv6"][0]: {
2712 "Summary address": SUMMARY
["ipv6"][0],
2713 "Metric-type": "E2",
2716 "External route count": 5,
2720 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2723 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2725 step("Verify that originally advertised routes are withdraw from there" " peer.")
2727 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2730 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2733 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2737 result
= verify_rib(
2738 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2742 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2744 write_test_footer(tc_name
)
2747 if __name__
== "__main__":
2748 args
= ["-s"] + sys
.argv
[1:]
2749 sys
.exit(pytest
.main(args
))