[WIP] Added test 604/605 for routing tests.
Further added functionality for re-discovering hosts after a
switch failure.
Change-Id: I266918bb7286328af52ac90c9588b5c2078c2009
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
index de05514..66f2145 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
@@ -468,6 +468,76 @@
verifyOnosFailure( main, internal=False )
lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
+ def CASE603( self, main ):
+ """"
+ Drop HAGG-1 device and test connectivity.
+ Drop DAAS-1 device and test connectivity (some hosts lost it)
+ Bring up DAAS-1 and test connectivity (all hosts gained it again)
+
+ Repeat the same with HAGG-2 and DAAS-2.
+ """
+ import time
+ from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
+ from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
+ main.case( "Drop hagg spine switch along with dass leaf switch." )
+ setupTest( main, test_idx=603, onosNodes=3 )
+ main.disconnectedIpv4Hosts = []
+ main.disconnectedIpv6Hosts = []
+
+ verify( main )
+ lib.killSwitch( main, "spine103", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
+ verify( main )
+ lib.killSwitch( main, "leaf6", int( main.params[ "TOPO" ]["switchNum" ] ) - 2, int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
+ main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4']
+ main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6']
+ verify( main )
+ lib.recoverSwitch( main, "leaf6", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, rediscoverHosts=True)
+ main.disconnectedIpv4Hosts = []
+ main.disconnectedIpv6Hosts = []
+ verify( main )
+ lib.recoverSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
+ verify( main )
+
+ lib.killSwitch( main, "spine104", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
+ verify( main )
+ lib.killSwitch( main, "leaf1", int( main.params[ "TOPO" ]["switchNum" ] ) - 2, int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
+ main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4']
+ main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6']
+ verify( main )
+ lib.recoverSwitch( main, "leaf1", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, rediscoverHosts=True)
+ main.disconnectedIpv4Hosts = []
+ main.disconnectedIpv6Hosts = []
+ verify( main )
+ lib.recoverSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
+ verify( main )
+
+ lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
+
+ def CASE604( self, main ):
+ """"
+ Drop HAGG-1 device and test connectivity.
+ Bring up HAGG-1 and test connectivity.
+ Drop HAGG-2 device and test connectivity.
+ Bring up HAGG-2 device and test connectivity
+ """
+ import time
+ from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
+ from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
+ main.case( "Drop hagg spine switches." )
+ setupTest( main, test_idx=604, onosNodes=3 )
+ main.disconnectedIpv4Hosts = []
+ main.disconnectedIpv6Hosts = []
+ verify( main )
+ lib.killSwitch( main, "spine103", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
+ verify( main )
+ lib.recoverSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
+ verify( main )
+ lib.killSwitch( main, "spine104", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
+ verify( main )
+ lib.recoverSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
+ verify( main )
+ lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
+
def CASE606( self, main ):
"""
Drop SPINE-1 and test connectivity
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp1.conf b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp1.conf
index d3dac23..d4f09ea 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp1.conf
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp1.conf
@@ -6,4 +6,4 @@
!
ip route 0.0.0.0/0 172.16.0.1
!
-fpm connection ip 10.192.19.41 port 2620
+fpm connection ip 10.128.100.67 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp2.conf b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp2.conf
index 147bcbc..95e97fd 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp2.conf
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/conf/zebradbgp2.conf
@@ -6,4 +6,4 @@
!
ip route 0.0.0.0/0 172.16.0.1
!
-fpm connection ip 10.192.19.41 port 2620
+fpm connection ip 10.128.100.69 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 298eb35..44055d3 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -650,7 +650,7 @@
onfail="Failed to kill switch?" )
@staticmethod
- def recoverSwitch( main, switch, switches, links ):
+ def recoverSwitch( main, switch, switches, links, rediscoverHosts=False ):
"""
Params: switches, links: number of expected switches and links after SwitchUp, ex.: '4', '6'
Recover a switch and verify ONOS can see the proper change
@@ -664,6 +664,13 @@
main.log.info( "Waiting %s seconds for switch up to be discovered" % (
main.switchSleep ) )
time.sleep( main.switchSleep )
+ if rediscoverHosts:
+ main.Network.discoverIpv4Hosts( main.internalIpv4Hosts )
+ main.Network.discoverIpv6Hosts( main.internalIpv6Hosts )
+ main.log.info( "Waiting %s seconds for hosts to get re-discovered" % (
+ main.switchSleep ) )
+ time.sleep( main.switchSleep )
+
topology = utilities.retry( main.Cluster.active( 0 ).CLI.checkStatus,
main.FALSE,
kwargs={ 'numoswitch': switches,