Merge "Fix SR link failure tests"
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
index b388a64..0bef93e 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
@@ -35,7 +35,7 @@
run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
run.pingAll( main, "CASE1_Failure" )
run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
- 'of:0000000000000002', '2', '1', '4', '8' )
+ 'of:0000000000000002', '2', '3', '4', '8' )
run.pingAll( main, "CASE1_Recovery" )
# TODO Dynamic config of hosts in subnet
# TODO Dynamic config of host not in subnet
@@ -69,7 +69,7 @@
run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
run.pingAll( main, "CASE2_Failure" )
run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
- 'of:0000000000000002', '2', '1', '8', '32' )
+ 'of:0000000000000002', '2', '3', '8', '32' )
run.pingAll( main, "CASE2_Recovery" )
# TODO Dynamic config of hosts in subnet
# TODO Dynamic config of host not in subnet
@@ -103,7 +103,7 @@
run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
run.pingAll( main, "CASE3_Failure" )
run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
- 'of:0000000000000002', '2', '1', '4', '8' )
+ 'of:0000000000000002', '2', '3', '4', '8' )
run.pingAll( main, "CASE3_Recovery" )
# TODO Dynamic config of hosts in subnet
# TODO Dynamic config of host not in subnet
@@ -137,7 +137,7 @@
run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
run.pingAll( main, "CASE2_Failure" )
run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
- 'of:0000000000000002', '2', '1', '8', '32' )
+ 'of:0000000000000002', '2', '3', '8', '32' )
run.pingAll( main, "CASE2_Recovery" )
# TODO Dynamic config of hosts in subnet
# TODO Dynamic config of host not in subnet
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 61c12ad..5da5834 100755
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -7,6 +7,9 @@
class Testcaselib:
+
+ useSSH=False
+
@staticmethod
def initTest( main ):
"""
@@ -98,7 +101,7 @@
apps,
tempOnosIp,
onosUser,
- useSSH=True )
+ useSSH=Testcaselib.useSSH )
cellResult = main.ONOSbench.setCell( "temp" )
verifyResult = main.ONOSbench.verifyCell( )
stepResult = cellResult and verifyResult
@@ -125,15 +128,16 @@
actual=stepResult,
onpass="Successfully installed ONOS package",
onfail="Failed to install ONOS package" )
- for i in range( main.numCtrls ):
- onosInstallResult = onosInstallResult and \
- main.ONOSbench.onosSecureSSH(
- node=main.ONOSip[ i ] )
- stepResult = onosInstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully secure SSH",
- onfail="Failed to secure SSH" )
+ if Testcaselib.useSSH:
+ for i in range( main.numCtrls ):
+ onosInstallResult = onosInstallResult and \
+ main.ONOSbench.onosSecureSSH(
+ node=main.ONOSip[ i ] )
+ stepResult = onosInstallResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully secure SSH",
+ onfail="Failed to secure SSH" )
main.step( "Starting ONOS service" )
stopResult, startResult, onosIsUp = main.TRUE, main.TRUE, main.TRUE,
for i in range( main.numCtrls ):
@@ -282,6 +286,7 @@
main.linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.step( "Kill link between %s and %s" % (end1, end2) )
LinkDown = main.Mininet1.link( END1=end1, END2=end2, OPTION="down" )
+ LinkDown = main.Mininet1.link( END2=end1, END1=end2, OPTION="down" )
main.log.info(
"Waiting %s seconds for link down to be discovered" % main.linkSleep )
time.sleep( main.linkSleep )
@@ -317,8 +322,12 @@
main.log.info(
"Waiting %s seconds for link up to be discovered" % main.linkSleep )
time.sleep( main.linkSleep )
- main.CLIs[ main.active ].portstate( dpid=dpid1, port=port1 )
- main.CLIs[ main.active ].portstate( dpid=dpid2, port=port2 )
+
+ for i in range(0, main.numCtrls):
+ onosIsUp = main.ONOSbench.isup( main.ONOSip[ i ] )
+ if onosIsUp == main.TRUE:
+ main.CLIs[ i ].portstate( dpid=dpid1, port=port1 )
+ main.CLIs[ i ].portstate( dpid=dpid2, port=port2 )
time.sleep( main.linkSleep )
result = main.CLIs[ main.active ].checkStatus( numoswitch=switches,