Merge "HotFix SCPFscalingMaxIntents and SCPFscalingMaxIntentsWithFobj - Fixed a small bug. If test failed in early, the intents number is not correct."
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 8165d3a..b38e257 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -2174,71 +2174,80 @@
returns: A list of flows in json format
'''
jsonFlowTable = []
- for flow in flowTable:
- jsonFlow = {}
- # split up the fields of the flow
- parsedFlow = flow.split(", ")
- # get rid of any spaces in front of the field
- for i in range( len(parsedFlow) ):
- item = parsedFlow[i]
- if item[0] == " ":
- parsedFlow[i] = item[1:]
- # grab the selector and treatment from the parsed flow
- # the last element is the selector and the treatment
- temp = parsedFlow.pop(-1)
- # split up the selector and the treatment
- temp = temp.split(" ")
- index = 0
- # parse the flags
- # NOTE: This only parses one flag
- flag = {}
- if version == "1.3":
- flag = {"flag":[temp[index]]}
+ try:
+ for flow in flowTable:
+ jsonFlow = {}
+ # split up the fields of the flow
+ parsedFlow = flow.split(", ")
+ # get rid of any spaces in front of the field
+ for i in range( len(parsedFlow) ):
+ item = parsedFlow[i]
+ if item[0] == " ":
+ parsedFlow[i] = item[1:]
+ # grab the selector and treatment from the parsed flow
+ # the last element is the selector and the treatment
+ temp = parsedFlow.pop(-1)
+ # split up the selector and the treatment
+ temp = temp.split(" ")
+ index = 0
+ # parse the flags
+ # NOTE: This only parses one flag
+ flag = {}
+ if version == "1.3":
+ flag = {"flag":[temp[index]]}
+ index += 1
+ # the first element is the selector and split it up
+ sel = temp[index]
index += 1
- # the first element is the selector and split it up
- sel = temp[index]
- index += 1
- sel = sel.split(",")
- # the priority is stuck in the selecter so put it back
- # in the flow
- parsedFlow.append(sel.pop(0))
- # parse selector
- criteria = []
- for item in sel:
- # this is the type of the packet e.g. "arp"
- if "=" not in item:
- criteria.append( {"type":item} )
- else:
+ sel = sel.split(",")
+ # the priority is stuck in the selecter so put it back
+ # in the flow
+ parsedFlow.append(sel.pop(0))
+ # parse selector
+ criteria = []
+ for item in sel:
+ # this is the type of the packet e.g. "arp"
+ if "=" not in item:
+ criteria.append( {"type":item} )
+ else:
+ field = item.split("=")
+ criteria.append( {field[0]:field[1]} )
+ selector = {"selector": {"criteria":sorted(criteria)} }
+ treat = temp[index]
+ # get rid of the action part e.g. "action=output:2"
+ # we will add it back later
+ treat = treat.split("=")
+ treat.pop(0)
+ # parse treatment
+ action = []
+ for item in treat:
+ field = item.split(":")
+ action.append( {field[0]:field[1]} )
+ # create the treatment field and add the actions
+ treatment = {"treatment": {"action":sorted(action)} }
+ # parse the rest of the flow
+ for item in parsedFlow:
field = item.split("=")
- criteria.append( {field[0]:field[1]} )
- selector = {"selector": {"criteria":sorted(criteria)} }
- treat = temp[index]
- # get rid of the action part e.g. "action=output:2"
- # we will add it back later
- treat = treat.split("=")
- treat.pop(0)
- # parse treatment
- action = []
- for item in treat:
- field = item.split(":")
- action.append( {field[0]:field[1]} )
- # create the treatment field and add the actions
- treatment = {"treatment": {"action":sorted(action)} }
- # parse the rest of the flow
- for item in parsedFlow:
- field = item.split("=")
- jsonFlow.update( {field[0]:field[1]} )
- # add the treatment and the selector to the json flow
- jsonFlow.update( selector )
- jsonFlow.update( treatment )
- jsonFlow.update( flag )
+ jsonFlow.update( {field[0]:field[1]} )
+ # add the treatment and the selector to the json flow
+ jsonFlow.update( selector )
+ jsonFlow.update( treatment )
+ jsonFlow.update( flag )
- if debug: main.log.debug( "\033[94mJson flow:\033[0m\n{}\n".format(jsonFlow) )
+ if debug: main.log.debug( "\033[94mJson flow:\033[0m\n{}\n".format(jsonFlow) )
- # add the json flow to the json flow table
- jsonFlowTable.append( jsonFlow )
+ # add the json flow to the json flow table
+ jsonFlowTable.append( jsonFlow )
- return jsonFlowTable
+ return jsonFlowTable
+
+ except IndexError:
+ main.log.exception( self.name + ": IndexError found" )
+ return None
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup()
+ main.exit()
def getFlowTable( self, sw, version="", debug=False):
'''
@@ -2312,6 +2321,8 @@
try:
main.log.info( "Getting flows from Mininet" )
flows = self.getFlowTable( sw, version, debug )
+ if flows == None:
+ return main.ERROR
if debug: print "flow ids:\n{}\n\n".format(flowId)
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 1abf258..f3de98f 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -2288,7 +2288,7 @@
# Either no non-localhost IPs, or more than 1
main.log.warn( "getIpAddr failed to find a public IP address" )
return LOCALHOST
- except CalledProcessError:
+ except subprocess.CalledProcessError:
main.log.exception( "Error executing ifconfig" )
except IndexError:
main.log.exception( "Error getting IP Address" )
diff --git a/TestON/tests/HA/HAscaling/HAscaling.params b/TestON/tests/HA/HAscaling/HAscaling.params
index ff4e306..388f432 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.params
+++ b/TestON/tests/HA/HAscaling/HAscaling.params
@@ -17,9 +17,9 @@
#CASE15: Check that Leadership Election is still functional
#CASE16: Install Distributed Primitives app
#CASE17: Check for basic functionality with distributed primitives
- <testcases>1,[2,8,21,3,8,4,5,14,16,17]*1,[6,8,3,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4]*13,13</testcases>
+ <testcases>1,2,8,21,3,8,4,5,14,16,17,[6,8,7,4,15,17]*9,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <scaling>1,3b,3,5b,5,7b,7,7b,5,5b,3,3b,1</scaling>
+ <scaling>1,3b,5b,7b,7,7b,5b,3b,1</scaling>
<server>
<port>8000</port>
<interface>eth0</interface>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.topo b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.topo
index c6d57fc..2dbca1d 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.topo
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.topo
@@ -27,12 +27,21 @@
<COMPONENTS> </COMPONENTS>
</ONOScli2>
+ <ONOScli3>
+ <host>127.0.0.1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli3>
+
<QuaggaCliSpeaker1>
<host>127.0.0.1</host>
<user>sdn</user>
<password>rocks</password>
<type>QuaggaCliDriver</type>
- <connect_order>4</connect_order>
+ <connect_order>5</connect_order>
<COMPONENTS> </COMPONENTS>
</QuaggaCliSpeaker1>
@@ -41,7 +50,7 @@
<user>sdn</user>
<password>rocks</password>
<type>MininetCliDriver</type>
- <connect_order>5</connect_order>
+ <connect_order>6</connect_order>
<COMPONENTS>
<home>~/Mininet/mininet/custom/</home>
</COMPONENTS>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
index 9183974..d995156 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
@@ -154,7 +154,7 @@
onfail="ONOS is NOT up" )
main.step( "Checking if ONOS CLI is ready" )
- cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
+ cliResult = main.ONOScli1.startOnosCli( ONOS1Ip,
commandlineTimeout=100,
onosStartTimeout=600 )
utilities.assert_equals( expect=main.TRUE,
@@ -164,7 +164,7 @@
for i in range( 10 ):
ready = True
- output = main.ONOScli.summary()
+ output = main.ONOScli1.summary()
if not output:
ready = False
if ready:
@@ -181,20 +181,20 @@
main.log.info( "Get links in the network" )
time.sleep( int ( main.params['timers']['TopoDiscovery'] ) )
- summaryResult = main.ONOScli.summary()
+ summaryResult = main.ONOScli1.summary()
linkNum = json.loads( summaryResult )[ "links" ]
- listResult = main.ONOScli.links( jsonFormat=False )
+ listResult = main.ONOScli1.links( jsonFormat=False )
main.log.info( listResult )
if linkNum < 100:
main.log.error( "Link number is wrong!" )
time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
- listResult = main.ONOScli.links( jsonFormat=False )
+ listResult = main.ONOScli1.links( jsonFormat=False )
main.log.info( listResult )
main.cleanup()
main.exit()
main.step( "Activate sdn-ip application" )
- activeSDNIPresult = main.ONOScli.activateApp( "org.onosproject.sdnip" )
+ activeSDNIPresult = main.ONOScli1.activateApp( "org.onosproject.sdnip" )
utilities.assert_equals( expect=main.TRUE,
actual=activeSDNIPresult,
onpass="Activate SDN-IP succeeded",
@@ -248,13 +248,13 @@
% main.params[ 'config' ][ 'peerNum' ] )
main.step( "Check P2P intents number from ONOS CLI" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
bgpIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
if bgpIntentsActualNum != bgpIntentsExpectedNum:
time.sleep( int( main.params['timers']['RouteDelivery'] ) )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
bgpIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
main.log.info( "bgpIntentsExpected num is:" )
@@ -280,14 +280,14 @@
allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+ getRoutesResult = main.ONOScli1.routes( jsonFormat=True )
allRoutesActual = \
main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
allRoutesStrExpected = str( sorted( allRoutesExpected ) )
allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
if allRoutesStrActual != allRoutesStrExpected:
time.sleep( int( main.params['timers']['RouteDelivery'] ) )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+ getRoutesResult = main.ONOScli1.routes( jsonFormat=True )
allRoutesActual = \
main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
@@ -303,13 +303,13 @@
onfail="Routes are wrong!" )
main.step( "Check M2S intents installed" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
routeIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
routeIntentsExpectedNum = 3
if routeIntentsActualNum != routeIntentsExpectedNum:
time.sleep( int( main.params['timers']['RouteDelivery'] ) )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
routeIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
@@ -620,9 +620,9 @@
check route number, P2P intent number, M2S intent number, ping test" )
main.log.info( "Check the flow number correctness before stopping sw11" )
- main.Functions.checkFlowNum( main, "sw11", 13 )
- main.Functions.checkFlowNum( main, "sw1", 3 )
- main.Functions.checkFlowNum( main, "sw7", 3 )
+ main.Functions.checkFlowNum( main, "sw11", 19 )
+ main.Functions.checkFlowNum( main, "sw1", 9 )
+ main.Functions.checkFlowNum( main, "sw7", 6 )
main.log.debug( main.Mininet.checkFlows( "sw11" ) )
main.log.debug( main.Mininet.checkFlows( "sw1" ) )
main.log.debug( main.Mininet.checkFlows( "sw7" ) )
@@ -671,8 +671,8 @@
check route number, P2P intent number, M2S intent number, ping test" )
main.log.info( "Check the flow status before starting sw11" )
- main.Functions.checkFlowNum( main, "sw1", 11 )
- main.Functions.checkFlowNum( main, "sw7", 5 )
+ main.Functions.checkFlowNum( main, "sw1", 17 )
+ main.Functions.checkFlowNum( main, "sw7", 8 )
main.log.debug( main.Mininet.checkFlows( "sw1" ) )
main.log.debug( main.Mininet.checkFlows( "sw7" ) )
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.topo b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.topo
index 01be5af..9ba2e9e 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.topo
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.topo
@@ -10,14 +10,14 @@
<COMPONENTS> </COMPONENTS>
</ONOSbench>
- <ONOScli>
+ <ONOScli1>
<host>127.0.0.1</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosCliDriver</type>
<connect_order>2</connect_order>
<COMPONENTS> </COMPONENTS>
- </ONOScli>
+ </ONOScli1>
<ONOS1>
<host>OC1</host>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/dependencies/Functions.py b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/dependencies/Functions.py
index dd0b29f..ad67952 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/dependencies/Functions.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/dependencies/Functions.py
@@ -7,10 +7,10 @@
main.log.info( routeNumExpected )
main.log.info( "Route number from ONOS CLI:" )
- routeNumActual = main.ONOScli.ipv4RouteNumber()
+ routeNumActual = main.ONOScli1.ipv4RouteNumber()
if routeNumActual != routeNumExpected:
time.sleep( wait )
- routeNumActual = main.ONOScli.ipv4RouteNumber()
+ routeNumActual = main.ONOScli1.ipv4RouteNumber()
main.log.info( routeNumActual )
utilities.assertEquals( \
expect = routeNumExpected, actual = routeNumActual,
@@ -24,12 +24,12 @@
main.log.info( "Intent number expected:" )
main.log.info( intentNumExpected )
main.log.info( "Intent number from ONOS CLI:" )
- jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+ jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
TYPE = "multiPointToSinglePoint" )
intentNumActual = jsonResult['installed']
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+ jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
TYPE = "multiPointToSinglePoint" )
intentNumActual = jsonResult['installed']
main.log.info( intentNumActual )
@@ -45,13 +45,13 @@
main.log.info( "Intent number expected:" )
main.log.info( intentNumExpected )
main.log.info( "Intent number from ONOS CLI:" )
- jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+ jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
TYPE = "pointToPoint" )
intentNumActual = jsonResult['installed']
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+ jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
TYPE = "pointToPoint" )
intentNumActual = jsonResult['installed']
main.log.info( intentNumActual )
diff --git a/TestON/tests/USECASE/USECASE_SegmentRouting/2x2.json b/TestON/tests/USECASE/USECASE_SegmentRouting/2x2.json
index 31b2cc8..a5ec00d 100644
--- a/TestON/tests/USECASE/USECASE_SegmentRouting/2x2.json
+++ b/TestON/tests/USECASE/USECASE_SegmentRouting/2x2.json
@@ -36,7 +36,7 @@
"name" : "Leaf-R1",
"nodeSid" : 1,
"routerIp" : "192.168.0.1",
- "routerMac" : "00:00:00:00:00:01",
+ "routerMac" : "10:00:00:00:00:01",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -47,7 +47,7 @@
"name" : "Leaf-R2",
"nodeSid" : 2,
"routerIp" : "192.168.0.2",
- "routerMac" : "00:00:00:00:00:02",
+ "routerMac" : "10:00:00:00:00:02",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -58,7 +58,7 @@
"name" : "Spine-R1",
"nodeSid" : 101,
"routerIp" : "192.168.0.101",
- "routerMac" : "00:00:00:00:01:01",
+ "routerMac" : "10:00:00:00:01:01",
"isEdgeRouter" : false,
"adjacencySids" : []
}
@@ -69,7 +69,7 @@
"name" : "Spine-R2",
"nodeSid" : 102,
"routerIp" : "192.168.0.102",
- "routerMac" : "00:00:00:00:01:02",
+ "routerMac" : "10:00:00:00:01:02",
"isEdgeRouter" : false,
"adjacencySids" : []
}
diff --git a/TestON/tests/USECASE/USECASE_SegmentRouting/4x4.json b/TestON/tests/USECASE/USECASE_SegmentRouting/4x4.json
index dee6bc3..7442359 100644
--- a/TestON/tests/USECASE/USECASE_SegmentRouting/4x4.json
+++ b/TestON/tests/USECASE/USECASE_SegmentRouting/4x4.json
@@ -64,7 +64,7 @@
"name" : "Leaf-R1",
"nodeSid" : 1,
"routerIp" : "192.168.0.1",
- "routerMac" : "00:00:00:00:00:01",
+ "routerMac" : "10:00:00:00:00:01",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -75,7 +75,7 @@
"name" : "Leaf-R2",
"nodeSid" : 2,
"routerIp" : "192.168.0.2",
- "routerMac" : "00:00:00:00:00:02",
+ "routerMac" : "10:00:00:00:00:02",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -86,7 +86,7 @@
"name" : "Leaf-R3",
"nodeSid" : 3,
"routerIp" : "192.168.0.3",
- "routerMac" : "00:00:00:00:00:03",
+ "routerMac" : "10:00:00:00:00:03",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -97,7 +97,7 @@
"name" : "Leaf-R4",
"nodeSid" : 4,
"routerIp" : "192.168.0.4",
- "routerMac" : "00:00:00:00:00:04",
+ "routerMac" : "10:00:00:00:00:04",
"isEdgeRouter" : true,
"adjacencySids" : []
}
@@ -108,7 +108,7 @@
"name" : "Spine-R1",
"nodeSid" : 101,
"routerIp" : "192.168.0.101",
- "routerMac" : "00:00:00:00:01:01",
+ "routerMac" : "10:00:00:00:01:01",
"isEdgeRouter" : false,
"adjacencySids" : []
}
@@ -119,7 +119,7 @@
"name" : "Spine-R2",
"nodeSid" : 102,
"routerIp" : "192.168.0.102",
- "routerMac" : "00:00:00:00:01:02",
+ "routerMac" : "10:00:00:00:01:02",
"isEdgeRouter" : false,
"adjacencySids" : []
}
@@ -130,7 +130,7 @@
"name" : "Spine-R3",
"nodeSid" : 103,
"routerIp" : "192.168.0.103",
- "routerMac" : "00:00:00:00:01:03",
+ "routerMac" : "10:00:00:00:01:03",
"isEdgeRouter" : false,
"adjacencySids" : []
}
@@ -141,7 +141,7 @@
"name" : "Spine-R4",
"nodeSid" : 104,
"routerIp" : "192.168.0.104",
- "routerMac" : "00:00:00:00:01:04",
+ "routerMac" : "10:00:00:00:01:04",
"isEdgeRouter" : false,
"adjacencySids" : []
}
diff --git a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.params b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.params
index 1ef9eea..15ce439 100755
--- a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.params
+++ b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.params
@@ -1,6 +1,6 @@
<PARAMS>
- <testcases>1,[2,3,4,10]*4</testcases>
+ <testcases>1,[2,3,4,4,10]*2</testcases>
<SCALE>
<size>1</size>
diff --git a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
index 9d96a43..f44966b 100755
--- a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
+++ b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
@@ -36,10 +36,10 @@
main.path = os.path.dirname( main.testFile )
main.dependencyPath = main.path + "/dependencies/"
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
- #main.json = ["4x4"]
+ #main.json = ["0x1","0x1"]
main.json = ["2x2", "2x2","4x4","4x4"]
main.args = [" ", " ", " --spine 4 --leaf 4 ", " --spine 4 --leaf 4 "]
- #main.args = [" --spine 4 --leaf 4 "]
+ #main.args = [" --spine 0 --leaf 1 "," --spine 0 --leaf 1 "]
main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
@@ -114,18 +114,12 @@
else: main.log.error( "App list is empty" )
main.case( "Package and start ONOS using apps:" + apps)
- #kill off all onos processes
- main.log.info( "Safety check, killing all ONOS processes" +
- " before initiating environment setup" )
-
- for i in range( main.maxNodes ):
- main.ONOSbench.onosDie( main.ONOSip[ i ] )
-
print "NODE COUNT = ", main.numCtrls
tempOnosIp = []
for i in range( main.numCtrls ):
tempOnosIp.append( main.ONOSip[i] )
+
onosUser = main.params[ 'ENV' ][ 'cellUser' ]
main.step("Create and Apply cell file")
main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
@@ -143,6 +137,12 @@
onpass="Successfully applied cell to " + \
"environment",
onfail="Failed to apply cell to environment " )
+ #kill off all onos processes
+ main.log.info( "Safety check, killing all ONOS processes" +
+ " before initiating environment setup" )
+
+ for i in range( main.maxNodes ):
+ main.ONOSbench.onosDie( main.ONOSip[ i ] )
main.step( "Create and Install ONOS package" )
main.jsonFile=main.json.pop(0)
@@ -193,8 +193,10 @@
#time.sleep( 2*main.startUpSleep )
#main.ONOSbench.handle.sendline( "onos-secure-ssh")
main.step( "Checking if ONOS CLI is ready" )
+ cellResult = main.CLIs[0].setCell( "temp" )
+
cliResult = main.CLIs[0].startOnosCli( main.ONOSip[ 0 ],
- commandlineTimeout=100, onosStartTimeout=600 )
+ commandlineTimeout=60, onosStartTimeout=100 )
utilities.assert_equals( expect=main.TRUE,
actual=cliResult,
onpass="ONOS CLI is ready",
@@ -216,27 +218,6 @@
main.cleanup()
main.exit()
- def CASE10( self, main ):
- '''
- Report errors/warnings/exceptions
- '''
- main.case( "Logging test for " + main.jsonFile )
- #if len(main.json) > 0 :
- main.ONOSbench.cpLogsToDir("/opt/onos/log/karaf.log",main.logdir,
- copyFileName="karaf.log."+main.jsonFile+str(len(main.json)))
- #main.ONOSbench.logReport( main.ONOSip[ 0 ],
- # [ "INFO" ],
- # "a" )
- #main.log.info("Error report: \n" )
- main.ONOSbench.logReport( main.ONOSip[ 0 ],
- [ "INFO",
- "FOLLOWER",
- "WARN",
- "flow",
- "ERROR",
- "Except" ],
- "s" )
-
def CASE3( self, main ):
"""
Start mininet
@@ -267,7 +248,7 @@
main.step(" Check whether the flow count is bigger than 80" )
count = utilities.retry( main.CLIs[0].checkFlowCount,
main.FALSE,
- kwargs={'min':80},
+ kwargs={'min':10},
attempts=10 )
utilities.assertEquals( \
expect=True,
@@ -290,37 +271,45 @@
main.ONOSbench.dumpGroups( main.ONOSip[0],
main.logdir, "groupsBefore" + main.jsonFile)
#time.sleep( 3*main.startUpSleep)
+ main.count=1
def CASE4( self, main ):
main.case( "Check full connectivity" )
main.log.report( "Check full connectivity" )
- main.step("1st Check full connectivity")
+ main.step("Check full connectivity"+str(main.count))
pa = main.Mininet1.pingall()
utilities.assert_equals( expect=main.TRUE, actual=pa,
onpass="Full connectivity successfully tested",
onfail="Full connectivity failed" )
# cleanup mininet
main.ONOSbench.dumpFlows( main.ONOSip[0],
- main.logdir, "flowsAfter" + main.jsonFile)
+ main.logdir, "flowsAfter" + str(main.count) + main.jsonFile)
main.ONOSbench.dumpGroups( main.ONOSip[0],
- main.logdir, "groupsAfter" + main.jsonFile)
- main.step("2nd Check full connectivity")
- pa = main.Mininet1.pingall()
- utilities.assert_equals( expect=main.TRUE, actual=pa,
- onpass="Full connectivity successfully tested",
- onfail="Full connectivity failed" )
+ main.logdir, "groupsAfter" + str(main.count) + main.jsonFile)
- main.ONOSbench.dumpFlows( main.ONOSip[0],
- main.logdir, "flowsAfter2nd" + main.jsonFile)
-
- main.ONOSbench.dumpGroups( main.ONOSip[0],
- main.logdir, "groupsAfter2nd" + main.jsonFile)
-
+ def CASE10( self, main ):
+ '''
+ Report errors/warnings/exceptions
+ '''
+ main.case( "Logging test for " + main.jsonFile )
+ #if len(main.json) > 0 :
main.ONOSbench.onosStop( main.ONOSip[0] )
main.Mininet1.stopNet()
-
-
+ main.ONOSbench.cpLogsToDir("/opt/onos/log/karaf.log",main.logdir,
+ copyFileName="karaf.log."+main.jsonFile+str(len(main.json)))
+ #main.ONOSbench.logReport( main.ONOSip[ 0 ],
+ # [ "INFO" ],
+ # "a" )
+ #main.log.info("Error report: \n" )
+ main.ONOSbench.logReport( main.ONOSip[ 0 ],
+ [ "INFO",
+ "FOLLOWER",
+ "WARN",
+ "flow",
+ "ERROR",
+ "Except" ],
+ "s" )