Merge "Dumping flows on each test now"
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index c198c4f..5a165a2 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1985,7 +1985,7 @@
response = main.FALSE
return response
- def arping( self, srcHost="", dstHost="10.128.20.211", ethDevice="", output=main.TRUE ):
+ def arping( self, srcHost="", dstHost="10.128.20.211", ethDevice="", output=True, noResult=False ):
"""
Description:
Sends arp message from mininet host for hosts discovery
@@ -1997,7 +1997,10 @@
"""
if ethDevice:
ethDevice = '-I ' + ethDevice + ' '
- cmd = srcHost + " arping -c1 " + ethDevice + dstHost
+ cmd = srcHost + " arping -c1 "
+ if noResult:
+ cmd += "-w10 " # If we don't want the actural arping result, set -w10, arping will exit after 10 ms.
+ cmd += ethDevice + dstHost
try:
if output:
main.log.info( "Sending: " + cmd )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 118563c..4f32aab 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1004,7 +1004,7 @@
"start/running",
"\$",
"Unknown\sinstance",
- pexpect.TIMEOUT ], timeout=120 )
+ pexpect.TIMEOUT ], timeout=180 )
if i == 0:
self.handle.expect( "\$" )
main.log.info( "Service is already running" )
@@ -1046,7 +1046,7 @@
"Could not resolve hostname",
"Unknown\sinstance",
"\$",
- pexpect.TIMEOUT ], timeout=60 )
+ pexpect.TIMEOUT ], timeout=180 )
if i == 0:
self.handle.expect( "\$" )
main.log.info( "ONOS service stopped" )
@@ -1084,9 +1084,9 @@
"""
try:
self.handle.sendline( "" )
- self.handle.expect( "\$", timeout=60 )
+ self.handle.expect( "\$", timeout=180 )
self.handle.sendline( "onos-uninstall " + str( nodeIp ) )
- self.handle.expect( "\$", timeout=60 )
+ self.handle.expect( "\$", timeout=180 )
main.log.info( "ONOS " + nodeIp + " was uninstalled" )
# onos-uninstall command does not return any text
return main.TRUE
@@ -1116,7 +1116,7 @@
i = self.handle.expect( [
"Killing\sONOS",
"ONOS\sprocess\sis\snot\srunning",
- pexpect.TIMEOUT ], timeout=20 )
+ pexpect.TIMEOUT ], timeout=60 )
if i == 0:
main.log.info( "ONOS instance " + str( nodeIp ) +
" was killed and stopped" )
@@ -1152,7 +1152,7 @@
"\$",
"No\sroute\sto\shost",
"password:",
- pexpect.TIMEOUT ], timeout=20 )
+ pexpect.TIMEOUT ], timeout=60 )
if i == 0:
main.log.info(
@@ -1251,7 +1251,7 @@
main.cleanup()
main.exit()
- def isup( self, node="", timeout=120 ):
+ def isup( self, node="", timeout=240 ):
"""
Run's onos-wait-for-start which only returns once ONOS is at run
level 100(ready for use)
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.params b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.params
index 58917ba..73a3599 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.params
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.params
@@ -2,15 +2,19 @@
# CASE - Description
# 1 - Variable initialization and optional pull and build ONOS package
# 2 - Install ONOS
- # 11 - Start Mininet with Openflow 1.3 (OpenvSwitch --version more than 2.3.1)
+ # 11 - Start Mininet with Openflow 1.3 (Use OpenvSwitch version more than 2.3.1)
# 12 - Assign switch to controller
+ # 13 - Discover hosts with Mininet Pingall(proto="IPV6")
# 14 - Stop Mininet
+ # 16 - Balance ownership of switches
+ # 1000 - Test host intents
# 2000 - Test Point Intent
# 3000 - Test Single To Multi Point Intent
# 4000 - Test multi to single point intents
# 5000 - Test host mobility
+ # 6000 - Test Multi Point intent End Point Failure
- <testcases>1,2,11,12,13,2000,3000,4000,5000,14</testcases>
+ <testcases>1,2,11,12,13,16,1000,2000,3000,4000,5000,6000,14</testcases>
<SCALE>
<size>1</size>
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
old mode 100644
new mode 100755
index 9c49283..450516a
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -346,6 +346,21 @@
onpass="Successfully discovered hosts",
onfail="Failed to discover hosts" )
+ def CASE16( self, main ):
+ """
+ Balance Masters
+ """
+ main.case( "Balance mastership of switches" )
+ main.step( "Balancing mastership of switches" )
+
+ balanceResult = main.FALSE
+ balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=balanceResult,
+ onpass="Successfully balanced mastership of switches",
+ onfail="Failed to balance mastership of switches" )
+
def CASE14( self, main ):
"""
Stop mininet
@@ -367,6 +382,130 @@
main.cleanup()
main.exit()
+ def CASE1000( self, main ):
+ """
+ Add host intents between 2 host:
+ - Discover hosts
+ - Add host intents
+ - Check intents
+ - Verify flows
+ - Ping hosts
+ - Reroute
+ - Link down
+ - Verify flows
+ - Check topology
+ - Ping hosts
+ - Link up
+ - Verify flows
+ - Check topology
+ - Ping hosts
+ - Remove intents
+ """
+ import time
+ import json
+ import re
+
+ # Assert variables - These variable's name|format must be followed
+ # if you want to use the wrapper function
+ assert main, "There is no main"
+ assert main.CLIs, "There is no main.CLIs"
+ assert main.Mininet1, "Mininet handle should be named Mininet1"
+ assert main.numSwitch, "Placed the total number of switch topology in \
+ main.numSwitch"
+
+ intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
+
+ main.testName = "Host Intents"
+ main.case( main.testName + " Test - " + str( main.numCtrls ) +
+ " NODE(S) - OF " + main.OFProtocol )
+ main.caseExplanation = "This test case tests Host intents using " +\
+ str( main.numCtrls ) + " node(s) cluster;\n" +\
+ "Different type of hosts will be tested in " +\
+ "each step such as IPV6, Dual stack, VLAN " +\
+ "etc;\nThe test will use OF " + main.OFProtocol\
+ + " OVS running in Mininet"
+
+ main.step( "IPV6: Add host intents between h1 and h9" )
+ stepResult = main.TRUE
+ stepResult = main.intentFunction.hostIntent( main,
+ name='IPV6',
+ host1='h1',
+ host2='h9',
+ host1Id='00:00:00:00:00:01/-1',
+ host2Id='00:00:00:00:00:09/-1',
+ sw1='s5',
+ sw2='s2',
+ expectedLink=18 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="IPV6: Host intent test successful " +
+ "between two IPV6 hosts",
+ onfail="IPV6: Host intent test failed " +
+ "between two IPV6 hosts")
+
+ main.step( "DUALSTACK1: Add host intents between h3 and h11" )
+ stepResult = main.TRUE
+ stepResult = main.intentFunction.hostIntent( main,
+ name='DUALSTACK',
+ host1='h3',
+ host2='h11',
+ host1Id='00:00:00:00:00:03/-1',
+ host2Id='00:00:00:00:00:0B/-1',
+ sw1='s5',
+ sw2='s2',
+ expectedLink=18 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="DUALSTACK: Host intent test " +
+ "successful between two " +
+ "dual stack host using IPV6",
+ onfail="DUALSTACK: Host intent test " +
+ "failed between two" +
+ "dual stack host using IPV6" )
+
+ main.step( "1HOP: Add host intents between h1 and h3" )
+ stepResult = main.TRUE
+ stepResult = main.intentFunction.hostIntent( main,
+ name='1HOP',
+ host1='h1',
+ host2='h9',
+ host1Id='00:00:00:00:00:01/-1',
+ host2Id='00:00:00:00:00:09/-1')
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="1HOP: Host intent test " +
+ "successful between two " +
+ "host using IPV6 in the same switch",
+ onfail="1HOP: Host intent test " +
+ "failed between two" +
+ "host using IPV6 in the same switch" )
+
+ main.step( "VLAN: Add vlan host intents between h5 and h24" )
+ stepResult = main.TRUE
+ stepResult = main.intentFunction.hostIntent( main,
+ name='VLAN1',
+ host1='h5',
+ host2='h24',
+ host1Id='00:00:00:00:00:05/100',
+ host2Id='00:00:00:00:00:18/100',
+ sw1='s5',
+ sw2='s2',
+ expectedLink=18 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="VLAN: Host intent test " +
+ "successful between two " +
+ "host using IPV6 in the same VLAN",
+ onfail="VLAN1: Host intent test " +
+ "failed between two" +
+ "host using IPV6 in the same VLAN" )
+
+ main.intentFunction.report( main )
+
def CASE2000( self, main ):
"""
add point intents between 2 hosts:
@@ -586,12 +725,12 @@
onfail=main.assertReturnString )
main.step( "1HOP: Add point intents between h1 and h9" )
main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
- stepResult = main.intentFunction.hostIntent( main,
+ stepResult = main.intentFunction.pointIntent( main,
name='1HOP',
- host1='h1',
- host2='h9',
- host1Id='00:00:00:00:00:01/-1',
- host2Id='00:00:00:00:00:09/-1')
+ host1="h1",
+ host2="h9",
+ deviceId1="of:0000000000000005/1",
+ deviceId2="of:0000000000000006/1")
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass=main.assertReturnString,
@@ -863,3 +1002,221 @@
onpass=main.assertReturnString,
onfail=main.assertReturnString )
main.intentFunction.report( main )
+
+ def CASE6000( self, main ):
+ """
+ Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
+ """
+ assert main, "There is no main"
+ assert main.CLIs, "There is no main.CLIs"
+ assert main.Mininet1, "Mininet handle should be named Mininet1"
+ assert main.numSwitch, "Placed the total number of switch topology in \
+ main.numSwitch"
+ main.case( "Test Multi to Single End Point Failure" )
+ main.step( "NOOPTION: test end point failure for multi point to single point intents" )
+ main.assertReturnString = "Assertion results for IPV6 multi to single \
+ point intent end point failure with no options set\n"
+ hostNames = [ 'h8', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ name="NOOPTION",
+ test="MultipletoSingle",
+ hostNames=hostNames,
+ devices=devices,
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.step( "IPV6: test end point failure for multi point to single point intents" )
+ main.assertReturnString = "Assertion results for IPV6 multi to single \
+ point intent end point failure with IPV6 type and MAC addresses\n"
+ hostNames = [ 'h8', 'h9', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
+ macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="MultipletoSingle",
+ name="IPV6",
+ hostNames=hostNames,
+ devices=devices,
+ macs=macs,
+ ethType="IPV6",
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.step( "IPV6_2: test end point faliure for multi point to single point intents" )
+ main.assertReturnString = "Assertion results for IPV6 multi to single \
+ point intent end point failure with IPV6 type and no MAC addresses\n"
+ hostNames = [ 'h8', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="MultipletoSingle",
+ name="IPV6_2",
+ hostNames=hostNames,
+ devices=devices,
+ ethType="IPV6",
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.step( "VLAN: test end point failure for multi point to single point intents" )
+ main.assertReturnString = "Assertion results for IPV6 multi to single \
+ point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
+ hostNames = [ 'h5', 'h24' ]
+ devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
+ macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="MultipletoSingle",
+ name="VLAN",
+ hostNames=hostNames,
+ devices=devices,
+ ethType="IPV6",
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.case( "Test Single to Multiple End Point Failure" )
+ main.step( "NOOPTION: test end point failure for single point to multi point intents" )
+ main.assertReturnString = "Assertion results for IPV6 single to multi \
+ point intent end point failure with no options set\n"
+ hostNames = [ 'h8', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="SingletoMultiple",
+ name="NOOPTION",
+ hostNames=hostNames,
+ devices=devices,
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+ main.step( "IPV6: test end point failure for single point to multi point intents" )
+ main.assertReturnString = "Assertion results for IPV6 single to multi \
+ point intent end point failure with IPV6 type and MAC addresses\n"
+ hostNames = [ 'h8', 'h9', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
+ macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="SingletoMultiple",
+ name="IPV6",
+ hostNames=hostNames,
+ devices=devices,
+ ethType="IPV6",
+ macs=macs,
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.step( "IPV6_2: test end point failure for single point to multi point intents" )
+ main.assertReturnString = "Assertion results for IPV6 single to multi\
+ point intent endpoint failure with IPV6 type and no MAC addresses\n"
+ hostNames = [ 'h8', 'h17' ]
+ devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="SingletoMultiple",
+ name="IPV6_2",
+ hostNames=hostNames,
+ devices=devices,
+ ethType="IPV6",
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.step( "VLAN: test end point failure for single point to multi point intents" )
+ main.assertReturnString = "Assertion results for IPV6 single to multi point\
+ intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
+ hostNames = [ 'h5', 'h24' ]
+ devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
+ macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
+ testResult = main.TRUE
+ testResult = main.intentFunction.testEndPointFail(
+ main,
+ test="SingletoMultiple",
+ name="IPV6",
+ hostNames=hostNames,
+ devices=devices,
+ macs=macs,
+ ethType="IPV6",
+ sw1="s6",
+ sw2="s2",
+ sw3="s4",
+ sw4="s1",
+ sw5="s3",
+ expectedLink1=16,
+ expectedLink2=14 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+
+ main.intentFunction.report( main )
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
index dd25a2e..3e9369f 100755
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
@@ -78,4 +78,4 @@
</Mininet1>
</COMPONENT>
-</TOPOLOGY>
+</TOPOLOGY>
\ No newline at end of file
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
index b6d706e..d7b2d82 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
@@ -133,11 +133,23 @@
# Check intents state again if first check fails...
if not intentResult:
intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
# Check flows count in each node
- checkFlowsCount( main )
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
# Verify flows
- checkFlowsState( main )
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
# Ping hosts
firstPingResult = main.Mininet1.ping6pair(SRC=hostNames[0], TARGET=main.hostsData[ host2 ][ 'ipAddresses' ][ 0 ])
@@ -391,11 +403,23 @@
# Check intents state again if first check fails...
if not intentResult:
intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
# Check flows count in each node
- checkFlowsCount( main )
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
# Verify flows
- checkFlowsState( main )
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
# Ping hosts
pingTemp = ping6allHosts( main, hostNames )
@@ -671,14 +695,25 @@
# Check intents state again if first check fails...
if not intentResult:
intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
# Check flows count in each node
- checkFlowsCount( main )
-
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
# Verify flows
- checkFlowsState( main )
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
- # Run iperf to both host
+ # Run iperf to both host
iperfTemp = main.Mininet1.iperftcpipv6( host1,host2 )
iperfResult = iperfResult and iperfTemp
if iperfTemp:
@@ -893,7 +928,7 @@
main.hostsData.get( host ).get( 'mac' )
ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
main.hostsData.get( host ).get( 'ipAddresses' )
-
+
pingResult = main.TRUE
intentResult = main.TRUE
removeIntentResult = main.TRUE
@@ -946,7 +981,7 @@
tcpSrc="",
tcpDst="" ) )
-
+
# Check intents state
time.sleep( main.checkIntentSleep )
intentResult = checkIntentState( main, intentsId )
@@ -954,11 +989,23 @@
# Check intents state again if first check fails...
if not intentResult:
intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
# Check flows count in each node
- checkFlowsCount( main )
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
# Verify flows
- checkFlowsState( main )
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
firstPingResult = main.Mininet1.ping6pair(SRC=hostNames[0], TARGET=main.hostsData[ hostNames[1] ][ 'ipAddresses' ][0])
if not firstPingResult:
@@ -1140,6 +1187,7 @@
expectedLink - Expected link when the switches are down, it should
be two links lower than the links before the two
switches are down
+ Note - Don't use more than 2 hosts for MultiToSingle Intent with no mac address option.
"""
assert main, "There is no main variable"
@@ -1236,11 +1284,23 @@
# Check intents state again if first check fails...
if not intentResult:
intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
# Check flows count in each node
- checkFlowsCount( main )
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
# Verify flows
- checkFlowsState( main )
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
# Ping hosts...
pingTemp = ping6allHosts( main, hostNames )
@@ -1349,6 +1409,376 @@
return stepResult
+def testEndPointFail( main,
+ name,
+ test="",
+ hostNames="",
+ devices="",
+ macs="",
+ ports="",
+ onosNode=0,
+ ethType="",
+ bandwidth="",
+ lambdaAlloc=False,
+ ipProto="",
+ ipAddresses="",
+ tcp="",
+ sw1="",
+ sw2="",
+ sw3="",
+ sw4="",
+ sw5="",
+ expectedLink1=0,
+ expectedLink2=0 ):
+ """
+ Test Multipoint Topology for Endpoint failures
+ """
+
+ assert main, "There is no main variable"
+ assert hostNames, "You must specify hosts"
+ assert devices or main.hostsData, "You must specify devices"
+
+ global itemName
+ itemName = name
+ tempHostsData = {}
+ intentsId = []
+ onosNode = int( onosNode )
+
+ macsDict = {}
+ ipDict = {}
+ if hostNames and devices:
+ if len( hostNames ) != len( devices ):
+ main.log.debug( "hosts and devices does not have the same length" )
+ return main.FALSE
+ if ports:
+ if len( ports ) != len( devices ):
+ main.log.error( "Ports and devices does " +
+ "not have the same length" )
+ return main.FALSE
+ else:
+ main.log.info( "Device Ports are not specified" )
+ if macs:
+ for i in range( len( devices ) ):
+ macsDict[ devices[ i ] ] = macs[ i ]
+ elif hostNames and not devices and main.hostsData:
+ devices = []
+ main.log.info( "multiIntent function is using main.hostsData" )
+ for host in hostNames:
+ devices.append( main.hostsData.get( host ).get( 'location' ) )
+ macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+ main.hostsData.get( host ).get( 'mac' )
+ ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
+ main.hostsData.get( host ).get( 'ipAddresses' )
+
+ pingResult = main.TRUE
+ intentResult = main.TRUE
+ removeIntentResult = main.TRUE
+ flowResult = main.TRUE
+ topoResult = main.TRUE
+ linkDownResult = main.TRUE
+ linkUpResult = main.TRUE
+
+ devicesCopy = copy.copy( devices )
+ if ports:
+ portsCopy = copy.copy( ports )
+ main.log.info( itemName + ": Adding intents" )
+
+ # Check flows count in each node
+ checkFlowsCount( main )
+
+ if test=="MultipletoSingle":
+ for i in range( len( devices ) ):
+ egressDevice = devicesCopy[ i ]
+ ingressDeviceList = copy.copy( devicesCopy )
+ ingressDeviceList.remove( egressDevice )
+ if ports:
+ portEgress = portsCopy[ i ]
+ portIngressList = copy.copy( portsCopy )
+ del portIngressList[ i ]
+ else:
+ portEgress = ""
+ portIngressList = None
+ if not macsDict:
+ dstMac = ""
+ else:
+ dstMac = macsDict[ egressDevice ]
+ if dstMac == None:
+ main.log.debug( "There is no MAC in device - " + egressDevice )
+ dstMac = ""
+
+ intentsId.append(
+ main.CLIs[ onosNode ].addMultipointToSinglepointIntent(
+ ingressDeviceList=ingressDeviceList,
+ egressDevice=egressDevice,
+ portIngressList=portIngressList,
+ portEgress=portEgress,
+ ethType=ethType,
+ ethDst=dstMac,
+ bandwidth=bandwidth,
+ lambdaAlloc=lambdaAlloc,
+ ipProto=ipProto,
+ ipSrc="",
+ ipDst="",
+ tcpSrc="",
+ tcpDst="" ) )
+
+
+ elif test=="SingletoMultiple":
+ for i in range( len( devices ) ):
+ ingressDevice = devicesCopy[ i ]
+ egressDeviceList = copy.copy( devicesCopy )
+ egressDeviceList.remove( ingressDevice )
+ if ports:
+ portIngress = portsCopy[ i ]
+ portEgressList = copy.copy( portsCopy )
+ del portEgressList[ i ]
+ else:
+ portIngress = ""
+ portEgressList = None
+ if not macsDict:
+ srcMac = ""
+ else:
+ srcMac = macsDict[ ingressDevice ]
+ if srcMac == None:
+ main.log.debug( "There is no MAC in device - " + ingressDevice )
+ srcMac = ""
+
+ intentsId.append(
+ main.CLIs[ onosNode ].addSinglepointToMultipointIntent(
+ ingressDevice=ingressDevice,
+ egressDeviceList=egressDeviceList,
+ portIngress=portIngress,
+ portEgressList=portEgressList,
+ ethType=ethType,
+ ethSrc=srcMac,
+ bandwidth=bandwidth,
+ lambdaAlloc=lambdaAlloc,
+ ipProto=ipProto,
+ ipSrc="",
+ ipDst="",
+ tcpSrc="",
+ tcpDst="" ) )
+
+ else:
+ main.log.info("Invalid test Name - Type either SingletoMultiple or MultipletoSingle")
+ return main.FALSE
+
+ # Check intents state
+ time.sleep( main.checkIntentSleep )
+ intentResult = checkIntentState( main, intentsId )
+
+ # Check intents state again if first check fails...
+ if not intentResult:
+ intentResult = checkIntentState( main, intentsId )
+ if intentResult:
+ main.assertReturnString += 'Initial Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Intent State Failed\n'
+
+ # Check flows count in each node
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Initial Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow Count Failed\n'
+ # Verify flows
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Initial Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Initial Flow State Failed\n'
+
+ # Ping hosts...
+ pingTemp = ping6allHosts( main, hostNames )
+ pingResult = pingResult and pingTemp
+ if pingTemp:
+ main.assertReturnString += 'Initial Pingall Passed\n'
+ else:
+ main.assertReturnString += 'Initial Pingall Failed\n'
+
+ # Test rerouting if these variables exist
+ if sw1 and sw2 and sw3 and sw4 and sw5 and expectedLink1 and expectedLink2:
+ # Take two links down
+ # Take first link down
+ linkDownResult1 = link( main, sw1, sw2, "down" )
+ if linkDownResult1:
+ main.assertReturnString += 'First Link Down Passed\n'
+ else:
+ main.assertReturnString += 'First Link Down Failed\n'
+
+ # Take second link down
+ linkDownResult2 = link( main, sw3, sw4, "down" )
+ if linkDownResult2:
+ main.assertReturnString += 'Second Link Down Passed\n'
+ else:
+ main.assertReturnString += 'Second Link Down Failed\n'
+
+ # Check flows count in each node
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Link Down Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Link Down Flow Count Failed\n'
+ # Verify flows
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Link Down Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Link Down Flow State Failed\n'
+
+ # Check OnosTopology
+ topoResult = checkTopology( main, expectedLink1 )
+ if topoResult:
+ main.assertReturnString += 'Link Down Topology State Passed\n'
+ else:
+ main.assertReturnString += 'Link Down Topology State Failed\n'
+
+ # Ping hosts
+ pingTemp = ping6allHosts( main, hostNames )
+ pingResult = pingResult and pingTemp
+ if pingTemp:
+ main.assertReturnString += 'Link Down Ping6all Passed\n'
+ else:
+ main.assertReturnString += 'Link Down Ping6all Failed\n'
+
+ # Check intent state
+ intentTemp = checkIntentState( main, intentsId )
+ intentResult = intentResult and intentTemp
+ if intentTemp:
+ main.assertReturnString += 'Link Down Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Link Down Intent State Failed\n'
+
+ # Take third link down to isolate the node
+ linkDownResult3 = link( main, sw3, sw5, "down" )
+ if linkDownResult3:
+ main.assertReturnString += 'Isolation Third Link Down Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Third Link Down Failed\n'
+
+ # Check flows count in each node
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Isolation Link Down Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Link Down Flow Count Failed\n'
+
+ # Verify flows
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Isolation Link Down Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Link Down Flow State Failed\n'
+
+ # Check OnosTopology
+ topoResult = checkTopology( main, expectedLink2 )
+ if topoResult:
+ main.assertReturnString += 'Isolation Link Down Topology State Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Link Down Topology State Failed\n'
+
+ # Ping hosts after isolation
+ main.log.info("Ping will fail if the node is isolated correctly.It will ping only after bringing up the isolation link")
+ pingIsolation = ping6allHosts( main, hostNames )
+ if pingIsolation:
+ main.assertReturnString += 'Isolation Link Down Ping6all Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Link Down Ping6all Failed\n'
+
+ # Check intent state after isolation
+ main.log.info("Intent will be in FAILED state if the node is isolated correctly.It will be in INSTALLED state only after bringing up isolation link")
+ intentIsolation = checkIntentState( main, intentsId )
+ if intentIsolation:
+ main.assertReturnString += 'Isolation Link Down Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Isolation Link Down Intent State Failed\n'
+
+ linkDownResult = linkDownResult1 and linkDownResult2 and linkDownResult3
+
+ # Checks ONOS state in link down
+ if linkDownResult and topoResult and pingResult and intentResult:
+ main.log.info( itemName + ": Successfully brought link down" )
+ else:
+ main.log.error( itemName + ": Failed to bring link down" )
+
+ # Bring the links back up
+ # Bring first link up
+ linkUpResult1 = link( main, sw1, sw2, "up" )
+ if linkUpResult1:
+ main.assertReturnString += 'First Link Up Passed\n'
+ else:
+ main.assertReturnString += 'First Link Up Failed\n'
+
+ # Bring second link up
+ linkUpResult2 = link( main, sw3, sw4, "up" )
+ if linkUpResult2:
+ main.assertReturnString += 'Second Link Up Passed\n'
+ else:
+ main.assertReturnString += 'Second Link Up Failed\n'
+ # Bring third link up
+ linkUpResult3 = link( main, sw3, sw5, "up" )
+ if linkUpResult3:
+ main.assertReturnString += 'Third Link Up Passed\n'
+ else:
+ main.assertReturnString += 'Third Link Up Failed\n'
+
+ linkUpResult = linkUpResult1 and linkUpResult2 and linkUpResult3
+ time.sleep( main.rerouteSleep )
+
+ # Check flows count in each node
+ FlowResult = checkFlowsCount( main )
+ if FlowResult:
+ main.assertReturnString += 'Link Up Flow Count Passed\n'
+ else:
+ main.assertReturnString += 'Link Up Flow Count Failed\n'
+ # Verify flows
+ StateResult = checkFlowsState( main )
+ if StateResult:
+ main.assertReturnString += 'Link Up Flow State Passed\n'
+ else:
+ main.assertReturnString += 'Link Up Flow State Failed\n'
+
+ # Check OnosTopology
+ topoResult = checkTopology( main, main.numLinks )
+ if topoResult:
+ main.assertReturnString += 'Link Up Topology State Passed\n'
+ else:
+ main.assertReturnString += 'Link Up Topology State Failed\n'
+
+ # Ping hosts
+ pingTemp = ping6allHosts( main, hostNames )
+ pingResult = pingResult and pingTemp
+ if pingTemp:
+ main.assertReturnString += 'Link Up Pingall Passed\n'
+ else:
+ main.assertReturnString += 'Link Up Pingall Failed\n'
+
+ # Check Intents
+ intentTemp = checkIntentState( main, intentsId )
+ intentResult = intentResult and intentTemp
+ if intentTemp:
+ main.assertReturnString += 'Link Up Intent State Passed\n'
+ else:
+ main.assertReturnString += 'Link Up Intent State Failed\n'
+
+ # Checks ONOS state in link up
+ if linkUpResult and topoResult and pingResult and intentResult:
+ main.log.info( itemName + ": Successfully brought link back up" )
+ else:
+ main.log.error( itemName + ": Failed to bring link back up" )
+
+ # Remove all intents
+ removeIntentResult = removeAllIntents( main, intentsId )
+ if removeIntentResult:
+ main.assertReturnString += 'Remove Intents Passed'
+ else:
+ main.assertReturnString += 'Remove Intents Failed'
+
+ testResult = pingResult and linkDownResult and linkUpResult \
+ and intentResult and removeIntentResult
+
+ return testResult
+
def ping6allHosts( main, hostList ):
# Ping all host in the hosts list variable
main.log.info( "Pinging: " + str( hostList ) )
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index 385d9e6..ac2b3c6 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -157,7 +157,7 @@
time.sleep(20)
- main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
devices = int(clusterCount)*10
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
index f3cd037..059552b 100644
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
+++ b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
@@ -158,7 +158,7 @@
time.sleep(20)
- main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
devices = int(clusterCount)*10
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 7d70d7f..0c4d950 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -127,7 +127,7 @@
deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
print("Device mastership list: " + str(deviceMastership))
- main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled false")
main.log.step("Setting up null provider")
for i in range(3):
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
index 439ecef..ff158b7 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
@@ -127,7 +127,7 @@
deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
print("Device mastership list: " + str(deviceMastership))
- main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled false")
main.log.step("Setting up null provider")
for i in range(3):
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
index b44a3c0..90ec8bf 100755
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
@@ -37,7 +37,7 @@
<balance>10</balance>
<nodeSleep>10</nodeSleep>
<pingall>15</pingall>
- <MNsleep>120</MNsleep>
+ <MNsleep>60</MNsleep>
</SLEEP>
<TIMEOUT>
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
index 7a8c0c6..f1101fe 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
@@ -99,6 +99,7 @@
def sendArpPackage( main, hostList ):
import json
+ import time
"""
send arping package from host
return the total hosts number from Onos
@@ -107,7 +108,8 @@
if isinstance(hostList, list):
threads = []
for h in hostList:
- main.Mininet1.arping( srcHost=h, dstHost="10.0.0.1", output=main.FALSE )
+ main.Mininet1.arping( srcHost=h, dstHost="10.0.0.1", output=main.FALSE, noResult=True )
+ time.sleep(1)
else:
main.Mininet1.arping(srcHost=hostList)
summaryStr = json.loads( main.CLIs[0].summary().encode() )