[ONOS-7747] Add router failure test cases to SRRouting
Change-Id: I06706c36caa181fff50c0f13c5976298e017940f
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
index 0611abc..738b6b4 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
@@ -67,8 +67,10 @@
if static:
if ipv4:
lib.addStaticOnosRoute( main, "10.0.88.0/24", "10.0.1.1")
+ lib.addStaticOnosRoute( main, "10.0.88.0/24", "10.0.5.1")
if ipv6:
lib.addStaticOnosRoute( main, "2000::8700/120", "2000::101")
+ lib.addStaticOnosRoute( main, "2000::8700/120", "2000::501")
if countFlowsGroups:
lib.loadCount( main )
@@ -248,3 +250,18 @@
lib.checkFlowsGroupsFromFile( main )
# ping hosts
verifyPing( main, ipv4, ipv6, disconnected, internal, external )
+
+def verifyRouterFailure( main, routerToKill, affectedIpv4Hosts=[], affectedIpv6Hosts=[],
+ ipv4=True, ipv6=True, countFlowsGroups=False ):
+ """
+ Kill and recover a quagga router and verify connectivities to external hosts
+ """
+ from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
+ lib.killRouter( main, routerToKill, 5 )
+ main.disconnectedExternalIpv4Hosts = affectedIpv4Hosts
+ main.disconnectedExternalIpv6Hosts = affectedIpv6Hosts
+ verify( main, ipv4, ipv6, True if (affectedIpv4Hosts or affectedIpv6Hosts) else False, False, True, countFlowsGroups )
+ lib.recoverRouter( main, routerToKill, 5 )
+ main.disconnectedExternalIpv4Hosts = []
+ main.disconnectedExternalIpv6Hosts = []
+ verify( main, ipv4, ipv6, False, False, True, countFlowsGroups )