8080 "12.0.20.5/32" ,
8181 ]
8282}
83- SUMMARY = {"ipv4" : ["11.0.0.0/8" , "12.0.0.0/8" , "11.0.0.0/24" ]}
83+
84+ NETWORK3 = {
85+ "ipv4" : [
86+ "13.0.0.0/16" ,
87+ ]
88+ }
89+
90+ SUMMARY = {"ipv4" : ["11.0.0.0/8" , "12.0.0.0/8" , "11.0.0.0/24" , "13.0.0.0/8" ]}
91+
8492"""
8593TOPOOLOGY =
8694 Please view in a fixed-width font such as Courier.
@@ -676,6 +684,7 @@ def test_ospf_type5_summary_tc42_p0(request):
676684 "static_routes" : [
677685 {"network" : NETWORK ["ipv4" ], "next_hop" : "blackhole" },
678686 {"network" : NETWORK2 ["ipv4" ], "next_hop" : "blackhole" },
687+ {"network" : NETWORK3 ["ipv4" ], "next_hop" : "blackhole" },
679688 ]
680689 }
681690 }
@@ -704,7 +713,8 @@ def test_ospf_type5_summary_tc42_p0(request):
704713 "r0" : {
705714 "ospf" : {
706715 "summary-address" : [
707- {"prefix" : SUMMARY ["ipv4" ][0 ].split ("/" )[0 ], "mask" : "8" }
716+ {"prefix" : SUMMARY ["ipv4" ][0 ].split ("/" )[0 ], "mask" : "8" },
717+ {"prefix" : SUMMARY ["ipv4" ][3 ].split ("/" )[0 ], "mask" : "8" },
708718 ],
709719 "aggr_timer" : 6 ,
710720 }
@@ -764,6 +774,31 @@ def test_ospf_type5_summary_tc42_p0(request):
764774 "Error: Routes still present in RIB" .format (tc_name )
765775 )
766776
777+ input_dict_summary3 = {"r0" : {"static_routes" : [{"network" : SUMMARY ["ipv4" ][3 ]}]}}
778+ dut = "r1"
779+ result = verify_ospf_rib (tgen , dut , input_dict_summary3 )
780+ assert result is True , "Testcase {} : Failed \n Error: {}" .format (tc_name , result )
781+
782+ result = verify_rib (tgen , "ipv4" , dut , input_dict_summary3 , protocol = protocol )
783+ assert (
784+ result is True
785+ ), "Testcase {} : Failed. Error: Routes is missing in RIB" .format (tc_name )
786+
787+ input_dict3 = {"r0" : {"static_routes" : [{"network" : NETWORK3 ["ipv4" ]}]}}
788+ result = verify_ospf_rib (tgen , dut , input_dict3 , expected = False )
789+ assert result is not True , (
790+ "Testcase {} : Failed\n Expected: Routes should not be present in OSPF RIB. \n Error: "
791+ "Routes still present in OSPF RIB {}" .format (tc_name , result )
792+ )
793+
794+ result = verify_rib (
795+ tgen , "ipv4" , dut , input_dict3 , protocol = protocol , expected = False
796+ )
797+ assert result is not True , (
798+ "Testcase {} : Failed \n Expected: Routes should not be present in RIB"
799+ "Error: Routes still present in RIB" .format (tc_name )
800+ )
801+
767802 step ("Delete the configured summary" )
768803 ospf_summ_r1 = {
769804 "r0" : {
@@ -774,7 +809,13 @@ def test_ospf_type5_summary_tc42_p0(request):
774809 "mask" : "8" ,
775810 "del_aggr_timer" : True ,
776811 "delete" : True ,
777- }
812+ },
813+ {
814+ "prefix" : SUMMARY ["ipv4" ][3 ].split ("/" )[0 ],
815+ "mask" : "8" ,
816+ "del_aggr_timer" : True ,
817+ "delete" : True ,
818+ },
778819 ]
779820 }
780821 }
0 commit comments