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
,
71 pytestmark
= [pytest
.mark
.ospfd
, pytest
.mark
.staticd
]
93 "ipv4": ["11.0.20.6/32", "11.0.20.7/32"],
94 "ipv6": ["2011:0:20::6/128", "2011:0:20::7/128"],
114 "ipv4": ["11.0.0.0/8", "12.0.0.0/8", "11.0.0.0/24"],
115 "ipv6": ["2011::/32", "2012::/32", "2011::/64", "2011::/24"],
119 Please view in a fixed-width font such as Courier.
121 +R1 +------------+R2 |
130 +R0 +-------------+R3 |
134 1. OSPF summarisation functionality.
135 2. OSPF summarisation with advertise and no advertise option
136 3. OSPF summarisation with route map modification of metric type.
137 4. OSPF CLI Show verify ospf ASBR summary config and show commands behaviours.
138 5. OSPF summarisation Chaos.
142 def setup_module(mod
):
144 Sets up the pytest environment
148 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
149 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
150 logger
.info("=" * 40)
152 logger
.info("Running setup_module to create topology")
154 # This function initiates the topology build with Topogen...
155 json_file
= "{}/ospfv3_asbr_summary_topo1.json".format(CWD
)
156 tgen
= Topogen(json_file
, mod
.__name
__)
158 topo
= tgen
.json_topo
159 # ... and here it calls Mininet initialization functions.
161 # get list of daemons needs to be started for this suite.
162 daemons
= topo_daemons(tgen
, topo
)
164 # Starting topology, create tmp files which are loaded to routers
165 # to start daemons and then start routers
166 start_topology(tgen
, daemons
)
168 # Creating configuration from JSON
169 build_config_from_json(tgen
, topo
)
171 # Don't run this test if we have any failure.
172 if tgen
.routers_have_failure():
173 pytest
.skip(tgen
.errors
)
174 # Api call verify whether OSPF is converged
175 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
176 assert ospf_covergence
is True, "setup_module :Failed \n Error:" " {}".format(
180 logger
.info("Running setup_module() done")
183 def teardown_module(mod
):
185 Teardown the pytest environment.
190 logger
.info("Running teardown_module to delete topology")
194 # Stop toplogy and Remove tmp files
198 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
200 logger
.info("=" * 40)
203 def red_static(dut
, config
=True):
205 Local 'def' for Redstribute static routes inside ospf.
209 * `dut` : DUT on which configs have to be made.
210 * `config` : True or False, True by default for configure, set False for
216 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "static"}]}}}
220 "ospf6": {"redistribute": [{"redist_type": "static", "delete": True}]}
223 result
= create_router_ospf(tgen
, topo
, ospf_red
)
224 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
227 def red_connected(dut
, config
=True):
229 Local 'def' for Redstribute connected routes inside ospf
233 * `dut` : DUT on which configs have to be made.
234 * `config` : True or False, True by default for configure, set False for
240 ospf_red
= {dut
: {"ospf6": {"redistribute": [{"redist_type": "connected"}]}}}
245 "redistribute": [{"redist_type": "connected", "delete": True}]
249 result
= create_router_ospf(tgen
, topo
, ospf_red
)
250 assert result
is True, "Testcase: Failed \n Error: {}".format(result
)
253 # ##################################
254 # Test cases start here.
255 # ##################################
258 def test_ospfv3_type5_summary_tc42_p0(request
):
259 """OSPF summarisation functionality."""
260 tc_name
= request
.node
.name
261 write_test_header(tc_name
)
264 # Don't run this test if we have any failure.
265 if tgen
.routers_have_failure():
266 pytest
.skip(tgen
.errors
)
269 step("Bring up the base config as per the topology")
270 reset_config_on_routers(tgen
)
275 "Configure 5 static routes from the same network on R0"
276 "5 static routes from different networks and redistribute in R0"
278 input_dict_static_rtes
= {
281 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
282 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
286 result
= create_static_routes(tgen
, input_dict_static_rtes
)
287 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
292 step("Verify that routes are learnt on R1.")
295 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
296 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
297 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
300 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
303 "Configure External Route summary in R0 to summarise 5"
304 " routes to one route. with aggregate timer as 6 sec"
311 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
317 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
318 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
321 "Verify that external routes are summarised to configured summary "
322 "address on R0 after 5 secs of delay timer expiry and only one "
323 "route is sent to R1."
325 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
328 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
329 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
331 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
334 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
336 step("Verify that show ip ospf summary should show the summaries.")
338 SUMMARY
["ipv6"][0]: {
339 "Summary address": SUMMARY
["ipv6"][0],
343 "External route count": 5,
347 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
350 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
352 step("Verify that originally advertised routes are withdraw from there" " peer.")
354 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
357 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
360 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
365 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
369 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
371 step("Delete the configured summary")
377 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
379 "del_aggr_timer": True,
386 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
387 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
389 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
391 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
394 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
399 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
403 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
407 step("show ip ospf summary should not have any summary address.")
409 SUMMARY
["ipv6"][0]: {
410 "Summary address": SUMMARY
["ipv6"][0],
414 "External route count": 5,
418 result
= verify_ospf_summary(
419 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
423 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
426 step("All 5 routes are advertised after deletion of configured summary.")
428 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
429 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
431 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
434 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
436 step("configure the summary again and delete static routes .")
441 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
446 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
447 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
450 SUMMARY
["ipv6"][0]: {
451 "Summary address": SUMMARY
["ipv6"][0],
455 "External route count": 5,
459 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
462 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
467 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True}
471 result
= create_static_routes(tgen
, input_dict
)
472 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
474 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
475 step("Verify that summary route is withdrawn from R1.")
478 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
481 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
486 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
490 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
492 step("Add back static routes.")
493 input_dict_static_rtes
= {
494 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
496 result
= create_static_routes(tgen
, input_dict_static_rtes
)
497 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
500 "Verify that external routes are summarised to configured summary"
501 " address on R0 and only one route is sent to R1."
505 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
, expected
=False)
508 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
513 tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
, expected
=False
517 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
519 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
522 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
523 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
525 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
528 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
530 step("Verify that show ip ospf summary should show configure summaries.")
533 SUMMARY
["ipv6"][0]: {
534 "Summary address": SUMMARY
["ipv6"][0],
538 "External route count": 5,
542 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
545 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
547 step("Configure new static route which is matching configured summary.")
548 input_dict_static_rtes
= {
550 "static_routes": [{"network": NETWORK_11
["ipv6"], "next_hop": "blackhole"}]
553 result
= create_static_routes(tgen
, input_dict_static_rtes
)
554 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
556 # step("verify that summary lsa is not refreshed.")
557 # show ip ospf database command is not working, waiting for DEV fix.
559 step("Delete one of the static route.")
560 input_dict_static_rtes
= {
563 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "delete": True}
567 result
= create_static_routes(tgen
, input_dict_static_rtes
)
568 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
570 # step("verify that summary lsa is not refreshed.")
571 # show ip ospf database command is not working, waiting for DEV fix.
573 # step("Verify that deleted static route is removed from ospf LSDB.")
574 # show ip ospf database command is not working, waiting for DEV fix.
577 "Configure redistribute connected and configure ospf external"
578 " summary address to summarise the connected routes."
583 clear_ospf(tgen
, dut
, ospf
="ospf6")
585 ip
= topo
["routers"]["r0"]["links"]["r3"]["ipv6"]
587 ip_net
= str(ipaddress
.ip_interface(u
"{}".format(ip
)).network
)
591 "summary-address": [{"prefix": ip_net
.split("/")[0], "mask": "8"}]
595 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
596 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
599 "Verify that external routes are summarised to configured "
600 "summary address on R0 and only one route is sent to R1."
603 input_dict_summary
= {"r0": {"static_routes": [{"network": "fd00::/64"}]}}
605 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
606 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
608 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
611 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
613 step("Shut one of the interface")
614 intf
= topo
["routers"]["r0"]["links"]["r3-link0"]["interface"]
615 shutdown_bringup_interface(tgen
, dut
, intf
, False)
617 # step("verify that summary lsa is not refreshed.")
618 # show ip ospf database command is not working, waiting for DEV fix.
620 # step("Verify that deleted connected route is removed from ospf LSDB.")
621 # show ip ospf database command is not working, waiting for DEV fix.
623 step("Un do shut the interface")
624 shutdown_bringup_interface(tgen
, dut
, intf
, True)
626 # step("verify that summary lsa is not refreshed.")
627 # show ip ospf database command is not working, waiting for DEV fix.
629 # step("Verify that deleted connected route is removed from ospf LSDB.")
630 # show ip ospf database command is not working, waiting for DEV fix.
632 step("Delete OSPF process.")
633 ospf_del
= {"r0": {"ospf6": {"delete": True}}}
634 result
= create_router_ospf(tgen
, topo
, ospf_del
)
635 assert result
is True, "Testcase : Failed \n Error: {}".format(result
)
637 step("Reconfigure ospf process with summary")
638 reset_config_on_routers(tgen
)
640 input_dict_static_rtes
= {
643 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
644 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
648 result
= create_static_routes(tgen
, input_dict_static_rtes
)
649 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
658 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
663 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
664 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
666 "Verify that external routes are summarised to configured summary "
667 "address on R0 and only one route is sent to R1."
671 SUMMARY
["ipv6"][0]: {
672 "Summary address": SUMMARY
["ipv6"][0],
676 "External route count": 5,
680 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
683 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
685 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
688 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
689 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
691 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
694 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
700 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
705 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
706 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
708 # step("verify that summary lsa is not refreshed.")
709 # show ip ospf database command is not working, waiting for DEV fix.
711 step("Delete the redistribute command in ospf.")
713 red_connected(dut
, config
=False)
714 red_static(dut
, config
=False)
716 step("Verify that summary route is withdrawn from the peer.")
719 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
722 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
727 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
731 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
738 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
746 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
747 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
749 write_test_footer(tc_name
)
752 def test_ospfv3_type5_summary_tc43_p0(request
):
753 """OSPF summarisation with metric type 2."""
754 tc_name
= request
.node
.name
755 write_test_header(tc_name
)
758 # Don't run this test if we have any failure.
759 if tgen
.routers_have_failure():
760 pytest
.skip(tgen
.errors
)
763 step("Bring up the base config as per the topology")
764 reset_config_on_routers(tgen
)
769 "Configure 5 static routes from the same network on R0"
770 "5 static routes from different networks and redistribute in R0"
772 input_dict_static_rtes
= {
775 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
776 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
780 result
= create_static_routes(tgen
, input_dict_static_rtes
)
781 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
786 step("Verify that routes are learnt on R1.")
789 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
790 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
791 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
794 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
797 "Configure External Route summary in R0 to summarise 5" " routes to one route."
803 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
808 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
809 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
811 "Verify that external routes are summarised to configured summary "
812 "address on R0 after 5 secs of delay timer expiry and only one "
813 "route is sent to R1."
815 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
818 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
819 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
821 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
824 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
826 step("Verify that show ip ospf summary should show the summaries.")
828 SUMMARY
["ipv6"][0]: {
829 "Summary address": SUMMARY
["ipv6"][0],
833 "External route count": 5,
837 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
840 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
842 step("Change the summary address mask to lower match (ex - 16 to 8)")
847 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"},
849 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
857 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
858 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
864 "Summary address": "2011::/16",
868 "External route count": 5,
872 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
875 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
878 "Verify that external routes(static / connected) are summarised"
879 " to configured summary address with newly configured mask."
882 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
885 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
886 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
888 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
891 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
893 step("Change the summary address mask to higher match (ex - 8 to 24)")
898 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
903 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
904 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
908 "Summary address": "2011::/32",
912 "External route count": 0,
916 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
919 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
922 "Verify that external routes(static / connected) are summarised"
923 " to configured summary address with newly configured mask."
925 step("Configure 2 summary address with different mask of same network.")
927 "Verify that external routes(static / connected) are summarised "
928 "to configured summary address with highest match."
931 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/32"}]}}
934 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
935 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
937 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
940 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
942 step(" Un configure one of the summary address.")
948 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
956 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
957 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
962 "Verify that external routes(static / connected) are summarised"
963 " to configured summary address with newly configured mask."
966 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
969 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
970 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
972 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
975 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
981 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "16"}
986 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
987 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
990 "Verify that external routes(static / connected) are summarised "
991 "to configured summary address with highest match."
993 input_dict_summary
= {"r0": {"static_routes": [{"network": "2011::0/16"}]}}
996 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
997 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
999 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1002 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1004 write_test_footer(tc_name
)
1007 def ospfv3_type5_summary_tc45_p0(request
):
1008 """OSPF summarisation with Tag option"""
1009 tc_name
= request
.node
.name
1010 write_test_header(tc_name
)
1011 tgen
= get_topogen()
1013 # Don't run this test if we have any failure.
1014 if tgen
.routers_have_failure():
1015 pytest
.skip(tgen
.errors
)
1018 step("Bring up the base config as per the topology")
1019 step("Configure OSPF on all the routers of the topology.")
1020 reset_config_on_routers(tgen
)
1025 "Configure 5 static routes from the same network on R0"
1026 "5 static routes from different networks and redistribute in R0"
1028 input_dict_static_rtes
= {
1031 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1032 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1036 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1037 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1042 step("Verify that routes are learnt on R1.")
1045 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1046 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1047 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1050 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1053 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1058 "summary-address": [
1060 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1068 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1069 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1072 "Verify that external routes are summarised to configured summary"
1073 " address on R0 and only one route is sent to R1 with configured tag."
1075 input_dict_summary
= {
1076 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1080 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1081 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1083 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1086 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1088 step("Verify that show ip ospf summary should show the summaries with tag.")
1090 SUMMARY
["ipv6"][0]: {
1091 "Summary address": SUMMARY
["ipv6"][0],
1092 "Metric-type": "E2",
1095 "External route count": 5,
1099 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1102 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1104 step("Delete the configured summary")
1108 "summary-address": [
1110 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1119 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1120 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1122 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1124 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1127 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1131 result
= verify_rib(
1132 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1136 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1140 step("show ip ospf summary should not have any summary address.")
1142 SUMMARY
["ipv6"][0]: {
1143 "Summary address": SUMMARY
["ipv6"][0],
1144 "Metric-type": "E2",
1147 "External route count": 5,
1151 result
= verify_ospf_summary(
1152 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1156 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1158 step("Configure Min tag value")
1162 "summary-address": [
1163 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1168 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1169 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1170 input_dict_summary
= {
1171 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1175 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1176 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1178 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1181 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1183 step("Verify that show ip ospf summary should show the summaries with tag.")
1185 SUMMARY
["ipv6"][0]: {
1186 "Summary address": SUMMARY
["ipv6"][0],
1187 "Metric-type": "E2",
1190 "External route count": 5,
1194 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1197 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1199 step("Configure Max Tag Value")
1203 "summary-address": [
1205 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1213 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1214 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1216 input_dict_summary
= {
1217 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1221 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1222 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1224 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1227 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1230 "Verify that boundary values tags are used for summary route"
1231 " using show ip ospf route command."
1234 SUMMARY
["ipv6"][0]: {
1235 "Summary address": SUMMARY
["ipv6"][0],
1236 "Metric-type": "E2",
1239 "External route count": 5,
1243 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1246 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1248 step("configure new static route with different tag.")
1249 input_dict_static_rtes_11
= {
1252 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1256 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1257 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1259 step("New tag has not been used by summary address.")
1261 input_dict_summary
= {
1262 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1266 result
= verify_ospf6_rib(
1267 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1271 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1275 result
= verify_rib(
1286 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1289 "Verify that boundary values tags are used for summary route"
1290 " using show ip ospf route command."
1293 SUMMARY
["ipv6"][0]: {
1294 "Summary address": SUMMARY
["ipv6"][0],
1295 "Metric-type": "E2",
1298 "External route count": 5,
1302 result
= verify_ospf_summary(
1303 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1307 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1309 step("Delete the configured summary address")
1313 "summary-address": [
1315 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1324 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1325 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1328 "Verify that 6 routes are advertised to neighbour with 5 routes"
1329 " without any tag, 1 route with tag."
1333 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1334 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1335 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1338 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1340 step("Verify that summary address is flushed from neighbor.")
1343 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1346 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1350 result
= verify_rib(
1351 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1355 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1357 step("Configure summary first & then configure matching static route.")
1359 input_dict_static_rtes
= {
1362 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1363 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1367 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1368 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1373 "summary-address": [
1374 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1379 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1380 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1382 input_dict_static_rtes
= {
1385 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1386 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1390 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1391 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1393 step("Repeat steps 1 to 10 of summarisation in non Back bone area.")
1394 reset_config_on_routers(tgen
)
1396 step("Change the area id on the interface on R0")
1401 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1402 "ospf6": {"area": "0.0.0.0"},
1409 result
= create_interfaces_cfg(tgen
, input_dict
)
1410 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1416 "interface": topo
["routers"]["r0"]["links"]["r1"]["interface"],
1417 "ospf6": {"area": "0.0.0.1"},
1423 result
= create_interfaces_cfg(tgen
, input_dict
)
1424 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1426 step("Change the area id on the interface ")
1431 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1432 "ospf6": {"area": "0.0.0.0"},
1439 result
= create_interfaces_cfg(tgen
, input_dict
)
1440 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1446 "interface": topo
["routers"]["r1"]["links"]["r0"]["interface"],
1447 "ospf6": {"area": "0.0.0.1"},
1453 result
= create_interfaces_cfg(tgen
, input_dict
)
1454 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
1456 ospf_covergence
= verify_ospf6_neighbor(tgen
, topo
)
1457 assert ospf_covergence
is True, "Testcase {} :Failed \n Error: {}".format(
1458 tc_name
, ospf_covergence
1462 "Configure 5 static routes from the same network on R0"
1463 "5 static routes from different networks and redistribute in R0"
1465 input_dict_static_rtes
= {
1468 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1469 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1473 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1474 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1479 step("Verify that routes are learnt on R1.")
1482 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1483 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1484 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1487 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1490 "Configure External Route summary in R0 to summarise 5" " routes to one route."
1495 "summary-address": [
1497 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1505 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1506 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1509 "Verify that external routes are summarised to configured summary"
1510 " address on R0 and only one route is sent to R1 with configured tag."
1512 input_dict_summary
= {
1513 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1234"}]}
1517 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1518 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1520 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1523 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1525 step("Verify that show ip ospf summary should show the summaries with tag.")
1527 SUMMARY
["ipv6"][0]: {
1528 "Summary address": SUMMARY
["ipv6"][0],
1529 "Metric-type": "E2",
1532 "External route count": 5,
1536 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1537 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1539 step("Delete the configured summary")
1543 "summary-address": [
1545 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1553 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1554 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1556 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1558 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1561 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1565 result
= verify_rib(
1566 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1570 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1574 step("show ip ospf summary should not have any summary address.")
1576 SUMMARY
["ipv6"][0]: {
1577 "Summary address": SUMMARY
["ipv6"][0],
1578 "Metric-type": "E2",
1581 "External route count": 5,
1585 result
= verify_ospf_summary(
1586 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1590 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1592 step("Configure Min tag value")
1596 "summary-address": [
1597 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32", "tag": 1}
1602 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1603 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1604 input_dict_summary
= {
1605 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "1"}]}
1609 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1610 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1612 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1615 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1617 step("Verify that show ip ospf summary should show the summaries with tag.")
1619 SUMMARY
["ipv6"][0]: {
1620 "Summary address": SUMMARY
["ipv6"][0],
1621 "Metric-type": "E2",
1624 "External route count": 5,
1628 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1631 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1633 step("Configure Max Tag Value")
1637 "summary-address": [
1639 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1647 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1648 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1650 input_dict_summary
= {
1651 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "4294967295"}]}
1655 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
1656 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1658 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
1661 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1664 "Verify that boundary values tags are used for summary route"
1665 " using show ip ospf route command."
1668 SUMMARY
["ipv6"][0]: {
1669 "Summary address": SUMMARY
["ipv6"][0],
1670 "Metric-type": "E2",
1673 "External route count": 5,
1677 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1680 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1682 step("configure new static route with different tag.")
1683 input_dict_static_rtes_11
= {
1686 {"network": NETWORK_11
["ipv6"], "next_hop": "blackhole", "tag": "88888"}
1690 result
= create_static_routes(tgen
, input_dict_static_rtes_11
)
1691 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1693 step("New tag has not been used by summary address.")
1695 input_dict_summary
= {
1696 "r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0], "tag": "88888"}]}
1700 result
= verify_ospf6_rib(
1701 tgen
, dut
, input_dict_summary
, tag
="88888", expected
=False
1705 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1709 result
= verify_rib(
1720 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1723 "Verify that boundary values tags are used for summary route"
1724 " using show ip ospf route command."
1727 SUMMARY
["ipv6"][0]: {
1728 "Summary address": SUMMARY
["ipv6"][0],
1729 "Metric-type": "E2",
1732 "External route count": 5,
1736 result
= verify_ospf_summary(
1737 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1741 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1743 step("Delete the configured summary address")
1747 "summary-address": [
1749 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1758 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1759 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1762 "Verify that 6 routes are advertised to neighbour with 5 routes"
1763 " without any tag, 1 route with tag."
1767 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1768 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1769 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1772 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1774 step("Verify that summary address is flushed from neighbor.")
1777 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1780 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1784 result
= verify_rib(
1785 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1789 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1791 step("Configure summary first & then configure matching static route.")
1793 input_dict_static_rtes
= {
1796 {"network": NETWORK
["ipv6"], "next_hop": "blackhole", "delete": True},
1797 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole", "delete": True},
1801 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1802 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1807 "summary-address": [
1808 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
1813 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1814 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1816 input_dict_static_rtes
= {
1819 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1820 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1824 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1825 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1827 write_test_footer(tc_name
)
1830 def test_ospfv3_type5_summary_tc46_p0(request
):
1831 """OSPF summarisation with advertise and no advertise option"""
1832 tc_name
= request
.node
.name
1833 write_test_header(tc_name
)
1834 tgen
= get_topogen()
1836 # Don't run this test if we have any failure.
1837 if tgen
.routers_have_failure():
1838 pytest
.skip(tgen
.errors
)
1841 step("Bring up the base config as per the topology")
1842 step("Configure OSPF on all the routers of the topology.")
1843 reset_config_on_routers(tgen
)
1848 "Configure 5 static routes from the same network on R0"
1849 "5 static routes from different networks and redistribute in R0"
1851 input_dict_static_rtes
= {
1854 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
1855 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
1859 result
= create_static_routes(tgen
, input_dict_static_rtes
)
1860 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1865 step("Verify that routes are learnt on R1.")
1868 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
1869 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1870 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
1873 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
1876 "Configure External Route summary in R0 to summarise 5"
1877 " routes to one route with no advertise option."
1882 "summary-address": [
1884 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1892 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1893 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1896 "Verify that external routes are summarised to configured summary"
1897 " address on R0 and summary route is not advertised to neighbor as"
1898 " no advertise is configured.."
1901 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
1904 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
1907 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1911 result
= verify_rib(
1912 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1916 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
1918 step("Verify that show ip ospf summary should show the " "configured summaries.")
1920 SUMMARY
["ipv6"][0]: {
1921 "Summary address": SUMMARY
["ipv6"][0],
1922 "External route count": 5,
1926 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
1929 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
1931 step("Delete the configured summary")
1935 "summary-address": [
1937 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
1945 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
1946 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
1948 step("Summary has 5 sec delay timer, sleep 5 secs...")
1951 step("Verify that summary lsa is withdrawn from R1 and deleted from R0.")
1953 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
1956 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
1960 result
= verify_rib(
1961 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
1965 ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format(
1969 step("show ip ospf summary should not have any summary address.")
1971 SUMMARY
["ipv6"][0]: {
1972 "Summary address": SUMMARY
["ipv6"][0],
1973 "Metric-type": "E2",
1976 "External route count": 5,
1980 result
= verify_ospf_summary(
1981 tgen
, topo
, dut
, input_dict
, ospf
="ospf6", expected
=False
1985 ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name
)
1987 step("Reconfigure summary with no advertise.")
1991 "summary-address": [
1993 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2001 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2002 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2005 "Verify that external routes are summarised to configured summary"
2006 " address on R0 and summary route is not advertised to neighbor as"
2007 " no advertise is configured.."
2010 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2013 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2016 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2020 result
= verify_rib(
2021 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2025 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2027 step("Verify that show ip ospf summary should show the " "configured summaries.")
2029 SUMMARY
["ipv6"][0]: {
2030 "Summary address": SUMMARY
["ipv6"][0],
2031 "External route count": 5,
2035 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2038 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2041 "Change summary address from no advertise to advertise "
2042 "(summary-address 10.0.0.0 255.255.0.0)"
2048 "summary-address": [
2050 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2058 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2059 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2064 "summary-address": [
2065 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2070 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2071 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2074 "Verify that external routes are summarised to configured summary "
2075 "address on R0 after 5 secs of delay timer expiry and only one "
2076 "route is sent to R1."
2078 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2081 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2082 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2084 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2087 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2089 step("Verify that show ip ospf summary should show the summaries.")
2091 SUMMARY
["ipv6"][0]: {
2092 "Summary address": SUMMARY
["ipv6"][0],
2093 "Metric-type": "E2",
2096 "External route count": 5,
2100 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2103 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2105 step("Verify that originally advertised routes are withdraw from there" " peer.")
2106 output
= tgen
.gears
["r0"].vtysh_cmd(
2107 "show ipv6 ospf6 database as-external json", isjson
=True
2110 output
= tgen
.gears
["r1"].vtysh_cmd(
2111 "show ipv6 ospf6 database as-external json", isjson
=True
2115 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2118 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2121 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2125 result
= verify_rib(
2126 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2130 ), "Testcase {} : Failed" "Error: Routes is present in RIB".format(tc_name
)
2132 write_test_footer(tc_name
)
2135 def test_ospfv3_type5_summary_tc48_p0(request
):
2136 """OSPF summarisation with route map modification of metric type."""
2137 tc_name
= request
.node
.name
2138 write_test_header(tc_name
)
2139 tgen
= get_topogen()
2141 # Don't run this test if we have any failure.
2142 if tgen
.routers_have_failure():
2143 pytest
.skip(tgen
.errors
)
2146 step("Bring up the base config as per the topology")
2147 reset_config_on_routers(tgen
)
2152 "Configure 5 static routes from the same network on R0"
2153 "5 static routes from different networks and redistribute in R0"
2155 input_dict_static_rtes
= {
2158 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2159 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2163 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2164 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2169 step("Verify that routes are learnt on R1.")
2172 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2173 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2174 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2177 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2180 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2186 "summary-address": [
2187 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2192 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2193 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2196 "Verify that external routes are summarised to configured summary "
2197 "address on R0 after 5 secs of delay timer expiry and only one "
2198 "route is sent to R1."
2200 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2203 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2204 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2206 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2209 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2211 step("Verify that show ip ospf summary should show the summaries.")
2213 SUMMARY
["ipv6"][0]: {
2214 "Summary address": SUMMARY
["ipv6"][0],
2215 "Metric-type": "E2",
2218 "External route count": 5,
2222 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2225 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2227 step("Verify that originally advertised routes are withdraw from there" " peer.")
2229 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2232 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2235 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2239 result
= verify_rib(
2240 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2244 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2247 "Configure route map and & rule to permit configured summary address,"
2248 " redistribute static & connected routes with the route map."
2250 step("Configure prefixlist to permit the static routes, add to route map.")
2251 # Create ip prefix list
2257 {"seqid": 10, "network": "any", "action": "permit"}
2263 result
= create_prefix_lists(tgen
, pfx_list
)
2264 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2273 "match": {"ipv6": {"prefix_lists": "pf_list_1_ipv6"}},
2279 result
= create_route_maps(tgen
, routemaps
)
2280 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2285 "redistribute": [{"redist_type": "static", "route_map": "rmap_ipv6"}]
2289 result
= create_router_ospf(tgen
, topo
, ospf_red_r1
)
2290 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2293 "Verify that external routes are summarised to configured"
2294 "summary address on R0 and only one route is sent to R1. Verify that "
2295 "show ip ospf summary should show the configure summaries."
2298 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2301 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2302 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2304 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2307 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2310 SUMMARY
["ipv6"][0]: {
2311 "Summary address": SUMMARY
["ipv6"][0],
2312 "Metric-type": "E2",
2315 "External route count": 5,
2319 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2322 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2324 step("Configure metric type as 1 in route map.")
2333 "set": {"metric-type": "type-1"},
2339 result
= create_route_maps(tgen
, routemaps
)
2340 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2343 "Verify that external routes(static / connected) are summarised"
2344 " to configured summary address with metric type 2."
2347 SUMMARY
["ipv6"][0]: {
2348 "Summary address": SUMMARY
["ipv6"][0],
2349 "Metric-type": "E2",
2352 "External route count": 5,
2356 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2359 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2361 step("Un configure metric type from route map.")
2370 "set": {"metric-type": "type-1", "delete": True},
2376 result
= create_route_maps(tgen
, routemaps
)
2377 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2380 "Verify that external routes(static / connected) are summarised"
2381 " to configured summary address with metric type 2."
2384 SUMMARY
["ipv6"][0]: {
2385 "Summary address": SUMMARY
["ipv6"][0],
2386 "Metric-type": "E2",
2389 "External route count": 5,
2393 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2396 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2398 step("Change rule from permit to deny in prefix list.")
2404 {"seqid": 10, "network": "any", "action": "deny"}
2410 result
= create_prefix_lists(tgen
, pfx_list
)
2411 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2414 "Verify that previously originated summary lsa "
2415 "is withdrawn from the neighbor."
2417 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2420 step("summary route has delay of 5 secs, wait for 5 secs")
2424 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
, expected
=False)
2427 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2431 result
= verify_rib(
2432 tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
, expected
=False
2436 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2438 write_test_footer(tc_name
)
2441 def test_ospfv3_type5_summary_tc51_p2(request
):
2444 verify ospf ASBR summary config and show commands behaviours.
2446 tc_name
= request
.node
.name
2447 write_test_header(tc_name
)
2448 tgen
= get_topogen()
2450 # Don't run this test if we have any failure.
2451 if tgen
.routers_have_failure():
2452 pytest
.skip(tgen
.errors
)
2455 step("Bring up the base config as per the topology")
2456 reset_config_on_routers(tgen
)
2458 step("Configure all the supported OSPF ASBR summary commands on DUT.")
2462 "summary-address": [
2464 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2469 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2474 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2479 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2487 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2488 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2490 step("Configure and re configure all the commands 10 times in a loop.")
2492 for itrate
in range(0, 10):
2496 "summary-address": [
2498 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2503 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2508 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2513 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2521 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2522 assert result
is True, "Testcase {} : Failed \n Error: {}".format(
2529 "summary-address": [
2531 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2537 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2543 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2549 "prefix": SUMMARY
["ipv6"][0].split("/")[0],
2558 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2559 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2561 step("Verify the show commands")
2564 SUMMARY
["ipv6"][3]: {
2565 "Summary address": SUMMARY
["ipv6"][3],
2566 "Metric-type": "E2",
2569 "External route count": 0,
2573 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2576 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2578 write_test_footer(tc_name
)
2581 def test_ospfv3_type5_summary_tc49_p2(request
):
2582 """OSPF summarisation Chaos."""
2583 tc_name
= request
.node
.name
2584 write_test_header(tc_name
)
2585 tgen
= get_topogen()
2587 # Don't run this test if we have any failure.
2588 if tgen
.routers_have_failure():
2589 pytest
.skip(tgen
.errors
)
2592 step("Bring up the base config as per the topology")
2593 reset_config_on_routers(tgen
)
2598 "Configure 5 static routes from the same network on R0"
2599 "5 static routes from different networks and redistribute in R0"
2601 input_dict_static_rtes
= {
2604 {"network": NETWORK
["ipv6"], "next_hop": "blackhole"},
2605 {"network": NETWORK2
["ipv6"], "next_hop": "blackhole"},
2609 result
= create_static_routes(tgen
, input_dict_static_rtes
)
2610 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2615 step("Verify that routes are learnt on R1.")
2618 result
= verify_ospf6_rib(tgen
, dut
, input_dict_static_rtes
)
2619 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2620 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_static_rtes
, protocol
=protocol
)
2623 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2626 "Configure External Route summary in R0 to summarise 5" " routes to one route."
2632 "summary-address": [
2633 {"prefix": SUMMARY
["ipv6"][0].split("/")[0], "mask": "32"}
2638 result
= create_router_ospf(tgen
, topo
, ospf_summ_r1
)
2639 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2642 "Verify that external routes are summarised to configured summary "
2643 "address on R0 after 5 secs of delay timer expiry and only one "
2644 "route is sent to R1."
2646 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2649 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2650 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2652 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2655 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2657 step("Verify that show ip ospf summary should show the summaries.")
2659 SUMMARY
["ipv6"][0]: {
2660 "Summary address": SUMMARY
["ipv6"][0],
2661 "Metric-type": "E2",
2664 "External route count": 5,
2668 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2671 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2673 step("Verify that originally advertised routes are withdraw from there" " peer.")
2675 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2678 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2681 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2685 result
= verify_rib(
2686 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2690 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2692 step("Reload the FRR router")
2693 # stop/start -> restart FRR router and verify
2694 stop_router(tgen
, "r0")
2695 start_router(tgen
, "r0")
2698 "Verify that external routes are summarised to configured summary "
2699 "address on R0 after 5 secs of delay timer expiry and only one "
2700 "route is sent to R1."
2702 input_dict_summary
= {"r0": {"static_routes": [{"network": SUMMARY
["ipv6"][0]}]}}
2705 result
= verify_ospf6_rib(tgen
, dut
, input_dict_summary
)
2706 assert result
is True, "Testcase {} : Failed \n Error: {}".format(tc_name
, result
)
2708 result
= verify_rib(tgen
, "ipv6", dut
, input_dict_summary
, protocol
=protocol
)
2711 ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name
)
2713 step("Verify that show ip ospf summary should show the summaries.")
2715 SUMMARY
["ipv6"][0]: {
2716 "Summary address": SUMMARY
["ipv6"][0],
2717 "Metric-type": "E2",
2720 "External route count": 5,
2724 result
= verify_ospf_summary(tgen
, topo
, dut
, input_dict
, ospf
="ospf6")
2727 ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name
)
2729 step("Verify that originally advertised routes are withdraw from there" " peer.")
2731 "r0": {"static_routes": [{"network": NETWORK
["ipv6"], "next_hop": "blackhole"}]}
2734 result
= verify_ospf6_rib(tgen
, dut
, input_dict
, expected
=False)
2737 ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format(
2741 result
= verify_rib(
2742 tgen
, "ipv6", dut
, input_dict
, protocol
=protocol
, expected
=False
2746 ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name
)
2748 write_test_footer(tc_name
)
2751 if __name__
== "__main__":
2752 args
= ["-s"] + sys
.argv
[1:]
2753 sys
.exit(pytest
.main(args
))