add testcase for copying karaf logs to preserve them between
instalations of ONOS
Change-Id: If8e5c91c4a5dafde275b3241cab1a0c0477fb220
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.params b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.params
index a906f12..50bb652 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.params
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.params
@@ -5,13 +5,14 @@
# 10 - Start Mininet opticalTest Topology
# 14 - Stop Mininet
# 17 - Activate Flow Objectives
+ # 19 - Copy karaf logs from ONOS nodes to TestON log directory
# 21 - Run pingall to discover all hosts
# 22 - Send arpings to discover all hosts
# 23 - Compare ONOS Topology to Mininet Topology
# 31 - Add and test bidirectional point intents
# 32 - Add and test bidirectional host intents
- <testcases>1,[2,10,21,22,23,31,32,14,2,10,21,22,23,31,32,14]*1,[2,10,17,21,22,23,31,32,14,2,10,17,21,22,23,31,32,14]*1</testcases>
+ <testcases>1,[2,10,21,22,23,31,32,14,19,2,10,21,22,23,31,32,14,19]*1,[2,10,17,21,22,23,31,32,14,19,2,10,17,21,22,23,31,32,14,19]*1</testcases>
<SCALE>
<size>1,3,1,3</size>
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index c41a740..f4ac6ce 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -57,6 +57,7 @@
main.ONOSip = [] # List of IPs of active ONOS nodes. CASE 2
main.activeONOSip = []
main.assertReturnString = '' # Assembled assert return string
+ main.cycle = 0 # How many times FUNCintent has run through its tests
main.ONOSip = main.ONOSbench.getOnosIps()
@@ -124,6 +125,8 @@
- Connect to cli
"""
+ main.cycle += 1
+
# main.scale[ 0 ] determines the current number of ONOS controller
main.numCtrls = int( main.scale[ 0 ] )
main.flowCompiler = "Flow Rules"
@@ -302,6 +305,28 @@
onpass="Successfully activated Flow Objectives",
onfail="Failed to activate Flow Objectives" )
+ def CASE19( self, main ):
+ """
+ Copy the karaf.log files after each testcase cycle
+ """
+ main.log.report( "Copy karaf logs" )
+ main.case( "Copy karaf logs" )
+ main.caseExplanation = "Copying the karaf logs to preserve them through" +\
+ "reinstalling ONOS"
+ main.step( "Copying karaf logs" )
+ i = 0
+ for cli in main.CLIs:
+ main.node = cli
+ ip = main.ONOSip[ i ]
+ main.node.ip_address = ip
+ main.ONOSbench.scp( main.node ,
+ "/opt/onos/log/karaf.log",
+ "/tmp/karaf.log",
+ direction="from" )
+ main.ONOSbench.cpLogsToDir( "/tmp/karaf.log", main.logdir,
+ copyFileName=( "karaf.log.node{0}.cycle{1}".format( str( i + 1 ), str( main.cycle ) ) ) )
+ i += 1
+
def CASE21( self,main ):
"""
Run pingall to discover all hosts