add remove batch flows cases
Change-Id: I7eca2e7c75a93c0948b1fcbbf4f15ac5233b7895
diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index d03e12e..61284d6 100644
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -1659,7 +1659,7 @@
main.log.info("Number of flows in batch: " + str( len(flowJsonList) ) )
flowJsonBatch['flows'] = flowJsonList
- pprint(flowJsonBatch)
+ #pprint(flowJsonBatch)
return flowJsonBatch
@@ -1700,7 +1700,7 @@
#main.log.info("Post response is: ", str(response[0]))
if response[0] == 200:
main.log.info( self.name + ": Successfully POST flow" )
- return main.TRUE
+ return main.TRUE, response
else:
main.log.error( "Error with REST request, response was: " +
str( response ) )
@@ -1740,7 +1740,8 @@
response = self.send( ip,
port,
method="DELETE",
- url="/flows/" + batch )
+ url="/flows/",
+ data = json.dumps(batch) )
if response:
if 200 <= response[ 0 ] <= 299:
return main.TRUE
diff --git a/TestON/tests/COMPflow/COMPflow.params b/TestON/tests/COMPflow/COMPflow.params
index b8850ee..b07779f 100755
--- a/TestON/tests/COMPflow/COMPflow.params
+++ b/TestON/tests/COMPflow/COMPflow.params
@@ -9,7 +9,7 @@
# 10 - Start mininet and verify topology
- <testcases>1,10,100,1000,100,110</testcases>
+ <testcases>1,10,100,1000,100,2000,100,110</testcases>
<SCALE>
<max>1</max>
diff --git a/TestON/tests/COMPflow/COMPflow.py b/TestON/tests/COMPflow/COMPflow.py
index 45e4de5..90e8814 100644
--- a/TestON/tests/COMPflow/COMPflow.py
+++ b/TestON/tests/COMPflow/COMPflow.py
@@ -97,8 +97,6 @@
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
@@ -119,7 +117,7 @@
onfail="Failed to apply cell to environment " )
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage(opTimeout=30)
+ packageResult = main.ONOSbench.onosPackage(opTimeout=120)
stepResult = packageResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -175,16 +173,6 @@
onpass="ONOS service is ready",
onfail="ONOS service did not start properly" )
- main.step( "Start ONOS cli" )
- cliResult = main.TRUE
- for i in range( main.numCtrls ):
- cliResult = cliResult and \
- main.CLIs[ i ].startOnosCli( main.ONOSip[ i ], onosStartTimeout=30 )
- stepResult = cliResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully start ONOS cli",
- onfail="Failed to start ONOS cli" )
def CASE10( self, main ):
'''
@@ -225,6 +213,7 @@
'''
import numpy
import time
+ from pprint import pprint
main.case( "Create a json object for the batched flows" )
@@ -233,6 +222,7 @@
main.log.info("Number of flows in a batch is:" + str(main.batchSize))
main.flowJsonBatchList = []
+ main.addedBatchList = []
postTimes = []
startSw = 1
@@ -261,14 +251,16 @@
tStartPost = time.time()
for item in main.flowJsonBatchList:
ts = time.time()
- resp = main.ONOSrest.sendFlowBatch(batch = item )
+ status, response = main.ONOSrest.sendFlowBatch(batch = item )
teBatch = time.time() - ts
postTimes.append(teBatch)
main.log.info("Batch Rest Post Elapse time is: " + str(teBatch))
+ main.addedBatchList.append(response[1])
tLastPostEnd = time.time()
main.step("Check to ensure all flows are in added state.")
+ pprint(main.addedBatchList)
resp = main.FALSE
while resp != main.TRUE:
resp = main.ONOSrest.checkFlowsState()
@@ -289,15 +281,17 @@
def CASE2000(self, main):
import time
import numpy
+ import json
rmTimes = []
main.case("Remove flow timing")
tStartRemove = time.time()
- for item in main.flowJsonBatchList:
+ for item in main.addedBatchList:
ts = time.time()
- resp = main.ONOSrest.removeFlowBatch(batch = item )
+ print(item)
+ resp = main.ONOSrest.removeFlowBatch(batch = json.loads(item) )
teBatch = time.time() - ts
rmTimes.append(teBatch)
main.log.info("Batch Rest Remove Elapse time is: " + str(teBatch))
@@ -315,9 +309,9 @@
int(main.params['CASE1000']['batchSize']) *\
int(main.params['CASE10']['numSw'])) )
main.log.info("Sum of each DELETE elapse time: " + str(numpy.sum(rmTimes)) )
- main.log.info("Total POST elapse time: " + str(tLastRemoveEnd-tStartRemove))
+ main.log.info("Total DELETE elapse time: " + str(tLastRemoveEnd-tStartRemove))
- main.log.info("Elapse time from end of last REST POST to Flows in ADDED state: " +\
+ main.log.info("Elapse time from end of last REST POST to Flows in DELETED state: " +\
str(tAllRemoved - tLastRemoveEnd))
def CASE100(self,main):