Dumping flows on each test now
Change-Id: Iec628582c76b287868d7ee405dbed128d93cc3fe
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index e1d298a..93026c2 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -2139,6 +2139,9 @@
main.cleanup()
main.exit()
+ def checkFlowCount(self, min=0, timeout=60 ):
+ count = int(self.getTotalFlowsNum( timeout=timeout ))
+ return count if (count > min) else False
def checkFlowsState( self, isPENDING=True, timeout=60 ):
"""
@@ -2291,7 +2294,7 @@
return totalFlows
- return totalFlows
+ return int(totalFlows)
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 4b28e8e..118563c 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1609,6 +1609,30 @@
main.cleanup()
main.exit()
+ def dumpFlows(self,ONOSIp, destDir, filename="flows" ):
+ """
+ Dump Flow Tables to a desired directory.
+ For debugging purposes, you may want to use
+ this function to capture flows at a given point in time.
+ Localtime will be attached to the filename
+
+ Required:
+ * ONOSIp: the IP of the target ONOS instance
+ * destDir: specify directory to copy to.
+ ex ) /tmp/
+ Optional:
+ * fileName: Name of the file
+ """
+
+ localtime = time.strftime( '%x %X' )
+ localtime = localtime.replace( "/", "" )
+ localtime = localtime.replace( " ", "_" )
+ localtime = localtime.replace( ":", "" )
+ if destDir[ -1: ] != "/":
+ destDir += "/"
+ cmd="flows > "+ str( destDir ) + str( filename ) + localtime
+ return self.onosCli(ONOSIp,cmd)
+
def cpLogsToDir( self, logToCopy,
destDir, copyFileName="" ):
"""