Merge "Fix reporting of SR test results"
diff --git a/TestON/JenkinsFile/CHO_Graph_Generator b/TestON/JenkinsFile/CHO_Graph_Generator
new file mode 100644
index 0000000..424f9a3
--- /dev/null
+++ b/TestON/JenkinsFile/CHO_Graph_Generator
@@ -0,0 +1,53 @@
+#!groovy
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+
+fileRelated.init()
+branches = params.ONOSbranch
+hours = params.hours
+branchList = branches.tokenize( "\n;, " )
+script_file = fileRelated.trendCHO
+saving_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric5/"
+scriptDir = fileRelated.CHOScriptDir
+
+graphScript = generateGraphScript( branchList )
+
+stage( 'Generating-Graph' ){
+ node( "TestStation-Fabric5s" ){
+ runScript( graphScript )
+ }
+}
+stage( 'posting-result' ){
+ postJob()
+}
+
+def generateGraphScript( branchList ){
+ graphScript = ''''''
+ for( branch in branchList ){
+ branchDir = scriptDir + branch + "/"
+ graphScript += '''export BRANCH=''' + branchDir + '''
+ mkdir ''' + branchDir + ''';
+ if [ ! -f ''' + branchDir + '''existing.txt ]; then
+ cp *.csv ''' + branchDir + ''';
+ echo "1" > ''' + branchDir + '''existing.txt;
+ fi;
+ bash log-summary;''' + '''
+ Rscript ''' + script_file + ' ' + branchDir + 'event.csv ' +
+ branchDir + 'failure.csv ' + branchDir + 'error.csv ' +
+ branch + ' 60 ' + hours + ' ' + saving_directory + ''';
+ '''
+ print( graphScript )
+ }
+ return graphScript
+}
+def runScript( graphScript ){
+ sh '''#!/bin/bash -l
+ set -i
+ set +e
+ export PYTHONPATH=/home/sdn/TestON:/home/sdn/sts
+ cd ''' + scriptDir + ''';
+ ''' + graphScript
+}
+def postJob(){
+ jobToRun = "postjob-Fabric5"
+ build job: jobToRun, propagate: false
+}
diff --git a/TestON/JenkinsFile/FUNCJenkinsFile b/TestON/JenkinsFile/FUNCJenkinsFile
index 8592090..c063ee2 100644
--- a/TestON/JenkinsFile/FUNCJenkinsFile
+++ b/TestON/JenkinsFile/FUNCJenkinsFile
@@ -1,15 +1,18 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
funcs.initialize( "FUNC" );
+
// This is a Jenkinsfile for a scripted pipeline for the FUNC tests
def prop = null
prop = funcs.getProperties()
FUNC = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "FUNC" ]
-graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
+graph_generator_file = fileRelated.trendIndividual
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
echo( "Testcases:" )
def testsToRun = null
@@ -29,4 +32,4 @@
tests[ test ].call()
}
funcs.generateOverallGraph( prop, FUNC, graph_saved_directory )
-funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
\ No newline at end of file
+funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/FabricJenkinsfileTrigger b/TestON/JenkinsFile/FabricJenkinsfileTrigger
index da75805..ef805a9 100644
--- a/TestON/JenkinsFile/FabricJenkinsfileTrigger
+++ b/TestON/JenkinsFile/FabricJenkinsfileTrigger
@@ -1,9 +1,11 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
-triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
current_version = "master"
previous_version = "1.13"
before_previous_version = "1.12"
@@ -53,9 +55,9 @@
FUNC_choices = ""
HA_choices = ""
SR_choices = ""
-stat_graph_generator_file = "testCategoryBuildStats.R"
-pie_graph_generator_file = "testCategoryPiePassFail.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-Fabric/"
+stat_graph_generator_file = fileRelated.histogramMultiple
+pie_graph_generator_file = fileRelated.pieMultiple
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric/"
post_result = params.PostResult
if( !manually_run ){
diff --git a/TestON/JenkinsFile/HAJenkinsFile b/TestON/JenkinsFile/HAJenkinsFile
index a03b71e..7a0638d 100644
--- a/TestON/JenkinsFile/HAJenkinsFile
+++ b/TestON/JenkinsFile/HAJenkinsFile
@@ -1,15 +1,17 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
funcs.initialize( "HA" );
// This is a Jenkinsfile for a scripted pipeline for the HA tests
def prop = null
prop = funcs.getProperties()
HA = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "HA" ]
-graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
+graph_generator_file = fileRelated.trendIndividual
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
echo( "Testcases:" )
def testsToRun = null
diff --git a/TestON/JenkinsFile/JenkinsfileTrigger b/TestON/JenkinsFile/JenkinsfileTrigger
index d744a67..6625355 100644
--- a/TestON/JenkinsFile/JenkinsfileTrigger
+++ b/TestON/JenkinsFile/JenkinsfileTrigger
@@ -1,5 +1,5 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
def now = funcs.getCurrentTime()
print now.toString()
diff --git a/TestON/JenkinsFile/Overall_Graph_Generator b/TestON/JenkinsFile/Overall_Graph_Generator
index ba34a89..f08f18a 100644
--- a/TestON/JenkinsFile/Overall_Graph_Generator
+++ b/TestON/JenkinsFile/Overall_Graph_Generator
@@ -1,10 +1,12 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
-stat_graph_generator_file = "testCategoryBuildStats.R"
-pie_graph_generator_file = "testCategoryPiePassFail.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
+fileRelated.init()
+stat_graph_generator_file = fileRelated.histogramMultiple
+pie_graph_generator_file = fileRelated.pieMultiple
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
funcs.initializeTrend( "VM" )
@@ -16,4 +18,4 @@
AllTheTests,
stat_graph_generator_file,
pie_graph_generator_file,
- graph_saved_directory )
\ No newline at end of file
+ graph_saved_directory )
diff --git a/TestON/JenkinsFile/SCPFJenkinsFile b/TestON/JenkinsFile/SCPFJenkinsFile
index 741f353..5f039b5 100644
--- a/TestON/JenkinsFile/SCPFJenkinsFile
+++ b/TestON/JenkinsFile/SCPFJenkinsFile
@@ -1,7 +1,7 @@
#!groovy
-SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/PerformanceFuncs.groovy' )
+SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
SCPFfuncs.init()
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
funcs.initialize( "SCPF", SCPFfuncs );
// This is a Jenkinsfile for a scripted pipeline for the SCPF tests
def prop = null
diff --git a/TestON/JenkinsFile/SCPF_Graph_Generator b/TestON/JenkinsFile/SCPF_Graph_Generator
index 679ccd4..938faf8 100644
--- a/TestON/JenkinsFile/SCPF_Graph_Generator
+++ b/TestON/JenkinsFile/SCPF_Graph_Generator
@@ -1,7 +1,7 @@
#!groovy
-SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/PerformanceFuncs.groovy' )
+SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
SCPFfuncs.init()
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
funcs.initialize( "SCPF", SCPFfuncs );
def prop = null
@@ -25,4 +25,4 @@
for ( test in tests.keySet() ){
tests[ test ].call()
-}
\ No newline at end of file
+}
diff --git a/TestON/JenkinsFile/SRJenkinsFile b/TestON/JenkinsFile/SRJenkinsFile
index a583774..c9c00e5 100644
--- a/TestON/JenkinsFile/SRJenkinsFile
+++ b/TestON/JenkinsFile/SRJenkinsFile
@@ -1,7 +1,9 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
funcs.initialize( "SR" );
jobName = env.JOB_NAME
funcs.additionalInitForSR( jobName )
@@ -10,8 +12,8 @@
prop = funcs.getProperties()
SR = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "SR" ]
-graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/"
+graph_generator_file = fileRelated.trendIndividual
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/"
echo( "Testcases:" )
def testsToRun = null
diff --git a/TestON/JenkinsFile/Trend_Graph_Generator b/TestON/JenkinsFile/Trend_Graph_Generator
index 5f3ccfd..3430b40 100644
--- a/TestON/JenkinsFile/Trend_Graph_Generator
+++ b/TestON/JenkinsFile/Trend_Graph_Generator
@@ -1,5 +1,8 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+
+fileRelated.init()
nodeCluster = params.NodeCluster
funcs.initializeTrend( nodeCluster );
@@ -12,8 +15,8 @@
prop[ "ONOSBranch" ] = params.ONOSbranch
-graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-" + nodeCluster + ( nodeCluster == "Fabric" ? funcs.fabricOn( prop[ "ONOSBranch" ] ) : "" ) + "/"
+graph_generator_file = fileRelated.trendIndividual
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-" + nodeCluster + ( nodeCluster == "Fabric" ? funcs.fabricOn( prop[ "ONOSBranch" ] ) : "" ) + "/"
def testsToRun = null
testsToRun = funcs.getTestsToRun( Tests )
diff --git a/TestON/JenkinsFile/USECASEJenkinsFile b/TestON/JenkinsFile/USECASEJenkinsFile
index 34abfa9..6493914 100644
--- a/TestON/JenkinsFile/USECASEJenkinsFile
+++ b/TestON/JenkinsFile/USECASEJenkinsFile
@@ -1,15 +1,17 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
funcs.initialize( "USECASE" );
// This is a Jenkinsfile for a scripted pipeline for the USECASE tests
def prop = null
prop = funcs.getProperties()
USECASE = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "USECASE" ]
-graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-BM/"
+graph_generator_file = fileRelated.trendIndividual
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/"
echo( "Testcases:" )
def testsToRun = null
@@ -29,4 +31,4 @@
tests[ test ].call()
}
funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
-funcs.generateOverallGraph( prop, USECASE, graph_saved_directory )
\ No newline at end of file
+funcs.generateOverallGraph( prop, USECASE, graph_saved_directory )
diff --git a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger b/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
index 3d03048..119b427 100644
--- a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
+++ b/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
@@ -1,9 +1,11 @@
#!groovy
-funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
-test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
-triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
+funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
+triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+fileRelated.init()
current_version = "master"
previous_version = "1.13"
before_previous_version = "1.12"
@@ -56,9 +58,9 @@
FUNC_choices = ""
HA_choices = ""
SR_choices = ""
-stat_graph_generator_file = "testCategoryBuildStats.R"
-pie_graph_generator_file = "testCategoryPiePassFail.R"
-graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
+stat_graph_generator_file = fileRelated.histogramMultiple
+pie_graph_generator_file = fileRelated.pieMultiple
+graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
post_result = params.PostResult
if( !manually_run ){
@@ -381,7 +383,7 @@
}
def postToWiki( contents ){
node( testMachine ){
- workspace = "/var/jenkins/workspace/all-pipeline-trigger/"
+ workspace = fileRelated.jenkinsWorkspace + "all-pipeline-trigger/"
filename = "jenkinsSchedule.txt"
writeFile file: workspace + filename, text: contents
funcs.publishToConfluence( "false", "true",
diff --git a/TestON/JenkinsFile/GeneralFuncs.groovy b/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
similarity index 85%
rename from TestON/JenkinsFile/GeneralFuncs.groovy
rename to TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
index 70b0fe0..a0c70c9 100644
--- a/TestON/JenkinsFile/GeneralFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
@@ -6,13 +6,10 @@
def basicGraphPart( rFileName, host, port, user, pass, subject, branchName ){
return " Rscript " + rFileName + " " + host + " " + port + " " + user + " " + pass + " " + subject + " " + branchName
}
-def initBasicVars(){
- rScriptLocation = "~/OnosSystemTest/TestON/JenkinsFile/scripts/"
-}
def getTestList( tests ){
list = ""
for( String test : tests.keySet() )
list += test + ","
return list[ 0..-2 ]
}
-return this;
\ No newline at end of file
+return this;
diff --git a/TestON/JenkinsFile/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
similarity index 94%
rename from TestON/JenkinsFile/JenkinsCommonFuncs.groovy
rename to TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
index fd7253b..8c480d3 100644
--- a/TestON/JenkinsFile/JenkinsCommonFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
@@ -1,6 +1,9 @@
#!groovy
import groovy.time.*
-generalFuncs = evaluate readTrusted( 'TestON/JenkinsFile/GeneralFuncs.groovy' )
+generalFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/GeneralFuncs.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+
+fileRelated.init()
def initializeTrend( machine ){
table_name = "executed_test_tests"
@@ -9,7 +12,6 @@
this.machine = machine
isSCPF = false
isTrend = true
- generalFuncs.initBasicVars();
}
def initialize( type, SCPFfuncs ){
init( type )
@@ -22,8 +24,8 @@
SCPFfunc = null
table_name = "executed_test_tests"
result_name = "executed_test_results"
- trend_generator_file = generalFuncs.rScriptLocation + "testCategoryTrend.R"
- build_stats_generator_file = generalFuncs.rScriptLocation + "testCategoryBuildStats.R"
+ trend_generator_file = fileRelated.trendMultiple
+ build_stats_generator_file = fileRelated.histogramMultiple
isSCPF = false
}
def init( type ){
@@ -35,7 +37,6 @@
testType = type;
testMachine = "TestStation-" + machineType[ type ] + "s";
isTrend = false
- generalFuncs.initBasicVars();
}
def additionalInitForSR( branch ){
testMachine = ( ( new StringBuilder( testMachine ) ).insert( testMachine.size()-1, fabricOn( branch ) ) ).toString()
@@ -297,9 +298,9 @@
string( credentialsId: 'db_host', variable: 'host' ),
string( credentialsId: 'db_port', variable: 'port' ) ] ) {
sh '''#!/bin/bash
- ''' + generalFuncs.basicGraphPart( generalFuncs.rScriptLocation + stat_file, host, port, user, pass, type, branch ) + " \"" + testListPart + "\" latest " + save_path + '''
- ''' + getOverallPieGraph( generalFuncs.rScriptLocation + pie_file, host, port, user, pass, branch, type, pieTestListPart, 'y', save_path ) + '''
- ''' + getOverallPieGraph( generalFuncs.rScriptLocation + pie_file, host, port, user, pass, branch, type, pieTestListPart, 'n', save_path )
+ ''' + generalFuncs.basicGraphPart( stat_file, host, port, user, pass, type, branch ) + " \"" + testListPart + "\" latest " + save_path + '''
+ ''' + getOverallPieGraph( pie_file, host, port, user, pass, branch, type, pieTestListPart, 'y', save_path ) + '''
+ ''' + getOverallPieGraph( pie_file, host, port, user, pass, branch, type, pieTestListPart, 'n', save_path )
}
}
postResult( [], true )
diff --git a/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy b/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy
new file mode 100644
index 0000000..fc89730
--- /dev/null
+++ b/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy
@@ -0,0 +1,23 @@
+#!groovy
+
+def initLocation(){
+ jenkinsFolder = "~/OnosSystemTest/TestON/JenkinsFile/"
+ rScriptLocation = jenkinsFolder + "wikiGraphRScripts/"
+ jenkinsWorkspace = "/var/jenkins/workspace/"
+ SCPFSpecificLocation = rScriptLocation + "SCPFspecificGraphRScripts/"
+ CHOScriptDir = "~/CHO_Jenkins_Scripts/"
+}
+def initFiles(){
+ trendIndividual = rScriptLocation + "trendIndividualTest.R"
+ trendMultiple = rScriptLocation + "trendMultipleTests.R"
+ trendSCPF = rScriptLocation + "trendSCPF.R"
+ trendCHO = rScriptLocation + "trendCHO.R"
+ histogramMultiple = rScriptLocation + "histogramMultipleTestGroups.R"
+ pieMultiple = rScriptLocation + "pieMultipleTests.R"
+}
+def init(){
+ initLocation()
+ initFiles()
+}
+return this;
+
diff --git a/TestON/JenkinsFile/JenkinsTestONTests.groovy b/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
similarity index 100%
rename from TestON/JenkinsFile/JenkinsTestONTests.groovy
rename to TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
diff --git a/TestON/JenkinsFile/PerformanceFuncs.groovy b/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
similarity index 94%
rename from TestON/JenkinsFile/PerformanceFuncs.groovy
rename to TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
index 5077bd9..a759051 100644
--- a/TestON/JenkinsFile/PerformanceFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
@@ -1,5 +1,7 @@
#!groovy
-//generalFuncs = evaluate readTrusted( 'TestON/JenkinsFile/GeneralFuncs.groovy' )
+fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
+
+fileRelated.init()
def init(){
none = [ "" ]
batches = [ 1, 100, 1000 ]
@@ -24,7 +26,7 @@
SCPFintentInstallWithdrawLatWithFlowObj: [ flows:true, test:'SCPFintentInstallWithdrawLat --params TEST/flowObj=True', table:'intent_latency_fobj_tests', results:'intent_latency_fobj_results', file:'IntentInstallWithdrawLatDBWFO', rFile:'SCPFIntentInstallWithdrawRerouteLat.R y', extra:batches, finalResult:0 ],
SCPFmastershipFailoverLat: [ flows:false, test:'SCPFmastershipFailoverLat', table:'mastership_failover_tests', results:'mastership_failover_results', file:'mastershipFailoverLatDB', rFile:'SCPFmastershipFailoverLat.R', extra:none, finalResult:1, graphTitle:[ 'Mastership Failover Test' ], dbCols:[ 'kill_deact_avg,deact_role_avg' ], dbWhere:'AND scale=5', y_axis:'Latency (ms)' ]
]
- graph_saved_directory = "/var/jenkins/workspace/postjob-BM/"
+ graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/"
}
def getGraphCommand( rFileName, extras, host, port, user, pass, testName, branchName, isOldFlow ){
result = ""
@@ -35,14 +37,14 @@
}
def generateGraph( rFileName, batch, host, port, user, pass, testName, branchName, isOldFlow ){
- return generalFuncs.basicGraphPart( generalFuncs.rScriptLocation + rFileName, host, port, user, pass, testName, branchName ) +
+ return generalFuncs.basicGraphPart( fileRelated.SCPFSpecificLocation + rFileName, host, port, user, pass, testName, branchName ) +
" " + batch + " " + usingOldFlow( isOldFlow, testName ) + graph_saved_directory
}
def generateCombinedResultGraph( host, port, user, pass, testName, branchName, isOldFlow ){
result = ""
for ( int i=0; i< SCPF[ testName ][ 'graphTitle' ].size(); i++ ){
- result += generalFuncs.basicGraphPart( generalFuncs.rScriptLocation + "SCPFLineGraph.R", host, port, user, pass, "\"" + SCPF[ testName ][ 'graphTitle' ][ i ] + "\"", branchName ) +
+ result += generalFuncs.basicGraphPart( fileRelated.trendSCPF, host, port, user, pass, "\"" + SCPF[ testName ][ 'graphTitle' ][ i ] + "\"", branchName ) +
" " + 50 + " \"SELECT " + checkIfList( testName, 'dbCols', i ) + ", build FROM " + SCPF[ testName ][ 'table' ] + " WHERE branch=\'" + branchName + "\' " + sqlOldFlow( isOldFlow, testName ) +
checkIfList( testName, 'dbWhere', i ) + " ORDER BY date DESC LIMIT 50\" \"" + SCPF[ testName ][ 'y_axis' ] + "\" " + hasOldFlow( isOldFlow, testName ) + graph_saved_directory + ";"
}
diff --git a/TestON/JenkinsFile/TriggerFuncs.groovy b/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
similarity index 100%
rename from TestON/JenkinsFile/TriggerFuncs.groovy
rename to TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
index 0b68425..66dc505 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFbatchFlowResp.R
@@ -47,10 +47,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
index 871000f..7e8e8c2 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFcbench.R
@@ -43,10 +43,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
index c4c30b2..b34010a 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFhostLat.R
@@ -42,10 +42,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
index 2525009..c6e3503 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFmastershipFailoverLat.R
@@ -43,10 +43,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
index 70d6607..dd3d95d 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFportLat.R
@@ -43,10 +43,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
index 2afe86e..0a03b3a 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFscaleTopo.R
@@ -43,10 +43,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
index 192ac8f..8082c4a 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/SCPFspecificGraphRScripts/SCPFswitchLat.R
@@ -43,10 +43,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL ) # For databases
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R b/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
index e2c4ed8..820c538 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R
@@ -37,14 +37,18 @@
blue = "#0033FF",
light_blue = "#3399FF",
black = "#111111",
- yellow = "#EEB600",
+ yellow = "#CCCC00",
purple = "#9900FF",
gray = "#CCCCCC",
- darkerGray = "#666666" )
+ darkerGray = "#666666",
+ orange = "#FF9900",
+ magenta = "#FF00FF",
+ brown = "#993300"
+ )
}
-wrapLegend <- function(){
- guides( color = guide_legend( nrow = 2, byrow = TRUE ) )
+wrapLegend <- function( byrow=TRUE ){
+ guides( color = guide_legend( nrow = 2, byrow = byrow ) )
}
lastUpdatedLabel <- function(){
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R b/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
index 0143071..78c3fe0 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/histogramMultipleTestGroups.R
@@ -45,10 +45,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL )
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R b/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
index a9a1cd4..46f671f 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/pieMultipleTests.R
@@ -46,10 +46,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL )
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R b/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R
new file mode 100644
index 0000000..32b11e7
--- /dev/null
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendCHO.R
@@ -0,0 +1,558 @@
+# Copyright 2017 Open Networking Foundation (ONF)
+#
+# Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+# the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+# or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+#
+# TestON is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# TestON is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TestON. If not, see <http://www.gnu.org/licenses/>.
+#
+# Example script:
+# Rscript trendCHO event.csv failure.csv error.csv master 60 /path/to/save/directory/
+
+# **********************************************************
+# STEP 1: Data management.
+# **********************************************************
+
+print( "**********************************************************" )
+print( "STEP 1: Data management." )
+print( "**********************************************************" )
+
+# Command line arguments are read. Args include the database credentials, test name, branch name, and the directory to output files.
+print( "Reading commmand-line args." )
+args <- commandArgs( trailingOnly=TRUE )
+
+
+limitToDisplayIndividually <- 37 # must be less than this number to display individually
+
+event_input_file <- 1
+failure_input_file <- 2
+error_input_file <- 3
+branch_name <- 4
+time_quantum <- 5
+maxDataToDisplayParam <- 6 # the maximum amount of data to display on the graph. Last data point is most recent
+save_directory <- 7
+
+# ----------------
+# Import Libraries
+# ----------------
+
+print( "Importing libraries." )
+library( ggplot2 )
+library( reshape2 )
+library( RPostgreSQL )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+
+# -------------------
+# Check CLI Arguments
+# -------------------
+
+print( "Verifying CLI args." )
+
+if ( length( args ) != save_directory ){
+ print( "Usage: Rscript trendCHO.R <events-input-file> <failures-input-file> <errors-input-file> <branch-name> <time_quantum> <max-data-to-display> <directory-to-save-graph>" )
+ quit( status = 1 )
+}
+
+# ----------------------
+# Read From File: Events
+# ----------------------
+
+print( "Reading from file for 'events' input." )
+
+event_fileData <- read.delim2( args[ event_input_file ],
+ header = TRUE,
+ sep = ",",
+ dec = "." )
+print( "Event File Data:" )
+print( event_fileData )
+
+# ------------------------
+# Read From File: Failures
+# ------------------------
+
+print( "Reading from file for 'failure' input." )
+
+failure_fileData <- read.delim2( args[ failure_input_file ],
+ header = TRUE,
+ sep = ",",
+ dec = "." )
+print( "Failure File Data:" )
+print( failure_fileData )
+
+# ----------------------
+# Read From File: Errors
+# ----------------------
+
+print( "Reading from file for 'errors' input." )
+
+error_fileData <- read.delim2( args[ error_input_file ],
+ header = TRUE,
+ sep = ",",
+ dec = "." )
+print( "Error File Data:" )
+print( error_fileData )
+
+# -------------------------------
+# Create Title and Graph Filename
+# -------------------------------
+
+print( "Creating titles of graphs." )
+
+failedChecksTitle <- paste( "Failed Checks - ",
+ args[ branch_name ],
+ "\nFrequency per ",
+ args[ time_quantum ],
+ " Minutes - Last ",
+ args[ maxDataToDisplayParam ],
+ " Hours",
+ sep="" )
+
+eventsTitle <- paste( "Network, Application, and ONOS Events - ",
+ args[ branch_name ],
+ "\nFrequency per ",
+ args[ time_quantum ],
+ " Minutes - Last ",
+ args[ maxDataToDisplayParam ],
+ " Hours",
+ sep="" )
+
+errorsTitle <- paste( "Warnings, Errors, and Exceptions from Logs - ",
+ args[ branch_name ],
+ "\nFrequency per ",
+ args[ time_quantum ],
+ " Minutes - Last ",
+ args[ maxDataToDisplayParam ],
+ " Hours",
+ sep="" )
+
+print( "Creating graph filenames." )
+
+failedChecksFilename <- paste( args[ save_directory ],
+ "CHO_Failure-Check_",
+ args[ branch_name ],
+ "_",
+ args[ maxDataToDisplayParam ],
+ "-maxData_graph.jpg",
+ sep="" )
+
+eventsFilename <- paste( args[ save_directory ],
+ "CHO_Events_",
+ args[ branch_name ],
+ "_",
+ args[ maxDataToDisplayParam ],
+ "-maxData_graph.jpg",
+ sep="" )
+
+errorsFilename <- paste( args[ save_directory ],
+ "CHO_Errors_",
+ args[ branch_name ],
+ "_",
+ args[ maxDataToDisplayParam ],
+ "-maxData_graph.jpg",
+ sep="" )
+
+# **********************************************************
+# STEP 2: Organize data.
+# **********************************************************
+
+print( "**********************************************************" )
+print( "STEP 2: Organize Data." )
+print( "**********************************************************" )
+
+# -------------------------------------------------------
+# Verifying all required columns are present.
+# -------------------------------------------------------
+
+# ------------------
+# Verifying 'Events'
+# ------------------
+
+print( "Verifying all required columns are present for 'events'." )
+
+requiredColumns <- c( "Link.Down",
+ "Link.Up",
+ "Device.Down",
+ "Device.Up",
+ "Add.Host.Intent",
+ "Delete.Host.Intent",
+ "Add.Point.Intent",
+ "Delete.Point.Intent",
+ "ONOS.Down",
+ "ONOS.Up" )
+
+tryCatch( eventsCombined <- c( event_fileData[ requiredColumns] ),
+ error = function( e ) {
+ print( "[ERROR] One or more expected columns are missing from 'events'. Please check that the data and file are valid, then try again." )
+ print( "Required columns: " )
+ print( requiredColumns )
+ print( "Actual columns: " )
+ print( names( event_fileData ) )
+ print( "Error dump:" )
+ print( e )
+ quit( status = 1 )
+ }
+ )
+
+# --------------------
+# Verifying 'Failures'
+# --------------------
+
+print( "Verifying all required columns are present for 'failures'." )
+
+requiredColumns <- c( "Intent.Check.Failure",
+ "Flow.Check.Failure",
+ "Traffic.Check.Failure",
+ "Topo.Check.Failure",
+ "ONOS.Check.Failure" )
+
+tryCatch( failureCombined <- c( failure_fileData[ requiredColumns] ),
+ error = function( e ) {
+ print( "[ERROR] One or more expected columns are missing from 'failures'. Please check that the data and file are valid, then try again." )
+ print( "Required columns: " )
+ print( requiredColumns )
+ print( "Actual columns: " )
+ print( names( failure_fileData ) )
+ print( "Error dump:" )
+ print( e )
+ quit( status = 1 )
+ }
+ )
+
+# ------------------
+# Verifying 'Errors'
+# ------------------
+
+print( "Verifying all required columns are present for 'errors'." )
+
+requiredColumns <- c( "Test.Warnings",
+ "ONOS.Warnings",
+ "ONOS.Errors",
+ "Exceptions" )
+
+tryCatch( errorCombined <- c( error_fileData[ requiredColumns] ),
+ error = function( e ) {
+ print( "[ERROR] One or more expected columns are missing from 'errors'. Please check that the data and file are valid, then try again." )
+ print( "Required columns: " )
+ print( requiredColumns )
+ print( "Actual columns: " )
+ print( names( error_fileData ) )
+ print( "Error dump:" )
+ print( e )
+ quit( status = 1 )
+ }
+ )
+
+# -------------------------------
+# Create Events Data Frame
+# -------------------------------
+
+maxDataToDisplay <- strtoi( args[ maxDataToDisplayParam ] )
+
+# -------------------
+# 'Events' Data Frame
+# -------------------
+
+print( "Constructing data frame for 'events'." )
+
+events_dataFrame <- melt( eventsCombined )
+
+# Rename column names in events_dataFrame
+colnames( events_dataFrame ) <- c( "Events",
+ "Type" )
+
+# Format data frame so that the data is in the same order as it appeared in the file.
+events_dataFrame$Type <- as.character( events_dataFrame$Type )
+events_dataFrame$Type <- factor( events_dataFrame$Type, levels = unique( events_dataFrame$Type ) )
+
+events_dataFrame$timeStamps <- rev( gsub('^(.{11})(.*)$', '\\1\n\\2', event_fileData$Time ) )
+
+# Adding a temporary reversed iterative list to the events_dataFrame so that there are no gaps in-between build numbers.
+events_dataFrame$iterative <- rev( seq( 1, nrow( event_fileData ), by = 1 ) )
+
+# Omit any data that doesn't exist
+events_dataFrame <- na.omit( events_dataFrame )
+
+
+dataLength <- nrow( event_fileData )
+moduloFactor <- floor( dataLength / limitToDisplayIndividually ) + 1
+
+if ( dataLength > maxDataToDisplay ){
+ events_dataFrame <- events_dataFrame[ events_dataFrame$iterative >= dataLength - maxDataToDisplay, ]
+}
+
+if ( moduloFactor > 1 ){
+ events_dataFrame[ events_dataFrame$iterative %% moduloFactor != dataLength %% moduloFactor, ]$timeStamps <- ""
+}
+
+print( "'Events' Data Frame Results:" )
+print( events_dataFrame )
+
+# ---------------------
+# 'Failures' Data Frame
+# ---------------------
+
+print( "Constructing data frame for 'failures'." )
+
+failures_dataFrame <- melt( failureCombined )
+
+# Rename column names in failures_dataFrame
+colnames( failures_dataFrame ) <- c( "Failures",
+ "Type" )
+
+# Format data frame so that the data is in the same order as it appeared in the file.
+failures_dataFrame$Type <- as.character( failures_dataFrame$Type )
+failures_dataFrame$Type <- factor( failures_dataFrame$Type, levels = unique( failures_dataFrame$Type ) )
+
+failures_dataFrame$timeStamps <- rev( gsub('^(.{11})(.*)$', '\\1\n\\2', failure_fileData$Time ) )
+
+# Adding a temporary reversed iterative list to the failures_dataFrame so that there are no gaps in-between build numbers.
+failures_dataFrame$iterative <- rev( seq( 1, nrow( failure_fileData ), by = 1 ) )
+
+# Omit any data that doesn't exist
+failures_dataFrame <- na.omit( failures_dataFrame )
+
+if ( dataLength > maxDataToDisplay ){
+ failures_dataFrame <- failures_dataFrame[ failures_dataFrame$iterative >= dataLength - maxDataToDisplay, ]
+}
+
+if ( moduloFactor > 1 ){
+ failures_dataFrame[ failures_dataFrame$iterative %% moduloFactor != dataLength %% moduloFactor, ]$timeStamps <- ""
+}
+
+print( "'Failures' Data Frame Results:" )
+print( failures_dataFrame )
+
+# -------------------
+# 'Errors' Data Frame
+# -------------------
+
+print( "Constructing data frame for 'errors'." )
+
+errors_dataFrame <- melt( errorCombined )
+
+# Rename column names in errors_dataFrame
+colnames( errors_dataFrame ) <- c( "Errors",
+ "Type" )
+
+# Format data frame so that the data is in the same order as it appeared in the file.
+errors_dataFrame$Type <- as.character( errors_dataFrame$Type )
+errors_dataFrame$Type <- factor( errors_dataFrame$Type, levels = unique( errors_dataFrame$Type ) )
+
+errors_dataFrame$timeStamps <- gsub('^(.{11})(.*)$', '\\1\n\\2', error_fileData$Time )
+
+# Adding a temporary reversed iterative list to the errors_dataFrame so that there are no gaps in-between build numbers.
+errors_dataFrame$iterative <- seq( 1, nrow( error_fileData ), by = 1 )
+
+# Omit any data that doesn't exist
+errors_dataFrame <- na.omit( errors_dataFrame )
+
+if ( dataLength > maxDataToDisplay ){
+ errors_dataFrame <- errors_dataFrame[ errors_dataFrame$iterative >= dataLength - maxDataToDisplay, ]
+}
+
+if ( moduloFactor > 1 ){
+ errors_dataFrame[ errors_dataFrame$iterative %% moduloFactor != dataLength %% moduloFactor, ]$timeStamps <- ""
+}
+
+print( "'Errors' Data Frame Results:" )
+print( errors_dataFrame )
+
+# **********************************************************
+# STEP 3: Generate graphs.
+# **********************************************************
+
+print( "**********************************************************" )
+print( "STEP 3: Generate Graph." )
+print( "**********************************************************" )
+
+# -------------------
+# Main Plot Generated
+# -------------------
+
+print( "Creating main plots." )
+
+eventsPlot <- ggplot( data = events_dataFrame, aes( x = iterative,
+ y = Events,
+ color = Type ) )
+
+failuresPlot <- ggplot( data = failures_dataFrame, aes( x = iterative,
+ y = Failures,
+ color = Type ) )
+
+errorsPlot <- ggplot( data = errors_dataFrame, aes( x = iterative,
+ y = Errors,
+ color = Type ) )
+
+# ------------------------------
+# Fundamental Variables Assigned
+# ------------------------------
+
+print( "Generating fundamental graph data used in all 3 graphs." )
+
+defaultTextSize()
+
+yAxisTicksExponents <- seq( -1, floor( max( c( max( events_dataFrame$Events ), max( failures_dataFrame$Failures ), max( errors_dataFrame$Errors ) ) ) ^ 0.1 ) + 1, by=1 )
+yAxisTicks <- 10 ^ yAxisTicksExponents
+yAxisTicksLabels <- floor( yAxisTicks )
+
+yScaleConfig <- scale_y_log10( breaks = yAxisTicks,
+ labels = yAxisTicksLabels )
+xLabel <- xlab( "Time" )
+
+print( "Generating line graph." )
+
+lineGraphFormat <- geom_line( size = 0.5 )
+pointFormat <- geom_point( size = 0 )
+
+graphTheme <- graphTheme() + theme( axis.text.x = element_text( angle = 90, hjust = 1.0, vjust = 0.5, size = 11 ),
+ axis.text.y = element_text( size = 17 ) )
+
+# -------------------
+# 'Events' Graph Data
+# -------------------
+
+print( "Generating 'events' graph data." )
+
+yLabel <- ylab( "Events" )
+
+xScaleConfig <- scale_x_continuous( breaks = events_dataFrame$iterative,
+ label = events_dataFrame$timeStamps )
+
+lineColorsAndLabels <- scale_color_manual( values=c( webColor( "light_blue" ),
+ webColor( "red" ),
+ webColor( "purple" ),
+ webColor( "yellow" ),
+ webColor( "orange" ),
+ webColor( "blue" ),
+ webColor( "magenta" ),
+ webColor( "green" ),
+ webColor( "brown" ),
+ webColor( "black" )
+ ),
+ labels = c( "Link Down",
+ "Link Up",
+ "Device Down",
+ "Device Up",
+ "Add Host Intent",
+ "Delete Host Intent",
+ "Add Point Intent",
+ "Delete Point Intent",
+ "ONOS Down",
+ "ONOS Up" )
+ )
+
+title <- labs( title = eventsTitle, subtitle = lastUpdatedLabel() )
+
+result <- eventsPlot +
+ xScaleConfig +
+ yScaleConfig +
+ xLabel +
+ yLabel +
+ graphTheme +
+ title +
+ lineGraphFormat +
+ lineColorsAndLabels +
+ pointFormat
+
+# -----------------------
+# Exporting Graph to File
+# -----------------------
+
+saveGraph( eventsFilename ) # from saveGraph.R
+
+# ---------------------
+# 'Failures' Graph Data
+# ---------------------
+
+print( "Generating 'failures' graph data." )
+
+yLabel <- ylab( "Failures" )
+
+xScaleConfig <- scale_x_continuous( breaks = failures_dataFrame$iterative,
+ label = failures_dataFrame$timeStamps )
+
+lineColorsAndLabels <- scale_color_manual( values=c( webColor( "red" ),
+ webColor( "yellow" ),
+ webColor( "green" ),
+ webColor( "blue" ),
+ webColor( "magenta" )
+ ),
+ labels = c( "Intent Check Failure",
+ "Flow Check Failure",
+ "Traffic Check Failure",
+ "Topo Check Failure",
+ "ONOS Check Failure" )
+ )
+
+title <- labs( title = failedChecksTitle, subtitle = lastUpdatedLabel() )
+
+result <- failuresPlot +
+ xScaleConfig +
+ yScaleConfig +
+ xLabel +
+ yLabel +
+ graphTheme +
+ title +
+ lineGraphFormat +
+ lineColorsAndLabels + wrapLegend(byrow=FALSE) +
+ pointFormat
+
+
+# -----------------------
+# Exporting Graph to File
+# -----------------------
+
+saveGraph( failedChecksFilename ) # from saveGraph.R
+
+# ---------------------
+# 'Errors' Graph Data
+# ---------------------
+
+print( "Generating 'errors' graph data." )
+
+yLabel <- ylab( "Errors" )
+
+xScaleConfig <- scale_x_continuous( breaks = errors_dataFrame$iterative,
+ label = errors_dataFrame$timeStamps )
+
+lineColorsAndLabels <- scale_color_manual( values=c( webColor( "magenta" ),
+ webColor( "yellow" ),
+ webColor( "orange" ),
+ webColor( "red" )
+ ),
+ labels = c( "Test Warnings",
+ "ONOS Warnings",
+ "ONOS Errors",
+ "Exceptions" )
+ )
+
+title <- labs( title = errorsTitle, subtitle = lastUpdatedLabel() )
+
+result <- errorsPlot +
+ xScaleConfig +
+ yScaleConfig +
+ xLabel +
+ yLabel +
+ graphTheme +
+ title +
+ lineGraphFormat +
+ lineColorsAndLabels +
+ pointFormat
+
+# -----------------------
+# Exporting Graph to File
+# -----------------------
+
+saveGraph( errorsFilename ) # from saveGraph.R
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R b/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
index f2f46bb..93d58ed 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendIndividualTest.R
@@ -46,10 +46,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL )
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R b/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
index 524d715..f85477b 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendMultipleTests.R
@@ -41,10 +41,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL )
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R b/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
index b2c68c6..0a4968a 100644
--- a/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
+++ b/TestON/JenkinsFile/wikiGraphRScripts/trendSCPF.R
@@ -46,10 +46,10 @@
library( ggplot2 )
library( reshape2 )
library( RPostgreSQL )
-source( "dependencies/saveGraph.R" )
-source( "dependencies/fundamentalGraphData.R" )
-source( "dependencies/initSQL.R" )
-source( "dependencies/cliArgs.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/saveGraph.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/fundamentalGraphData.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/initSQL.R" )
+source( "~/OnosSystemTest/TestON/JenkinsFile/wikiGraphRScripts/dependencies/cliArgs.R" )
# -------------------
# Check CLI Arguments
diff --git a/TestON/bin/.pylint b/TestON/bin/.pylint
index 469a744..57208b9 100644
--- a/TestON/bin/.pylint
+++ b/TestON/bin/.pylint
@@ -13,7 +13,7 @@
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
-#init-hook=
+init-hook='import sys;sys.path.append("/home/sdn/TestON")'
# Profiled execution.
profile=no
@@ -136,7 +136,7 @@
bad-names=foo,bar,baz,toto,tutu,tata
# List of builtins function names that should not be used, separated by a comma
-bad-functions=map,filter,apply,inpu
+bad-functions=map,filter,apply,inpu,in,list,str
# try to find bugs in the code using type inference
@@ -244,7 +244,7 @@
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report R0402 must not be disabled)
-import-graph=
+import-graph=y
# Create a graph of external dependencies in the given file (report R0402 mus
# not be disabled)
@@ -281,7 +281,7 @@
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,XXX,TODO
+notes=FIXME,XXX,TODO,NOTE
# checks for similarities and duplicated code. This computation may be
diff --git a/TestON/bin/codecheck b/TestON/bin/codecheck
index e3769da..51b9649 100755
--- a/TestON/bin/codecheck
+++ b/TestON/bin/codecheck
@@ -30,16 +30,16 @@
autopep8 --in-place -a -a $file --ignore=$EXCLUDE,$P8IGN
elif [ -z "$2" ] || [ "$2" = "--reason" ] || [ "$2" = "--relaxed" ]; then
echo "Running pyflakes..."
- #Pyflakes is a source checker. It doesn't run the code so it is safer than other programs
- #ignoring some errors due to TestON
- pyflakes $1 | grep -v "undefined name 'main'" | grep -v "undefined name 'utilities'"
+ # Pyflakes is a source checker. It doesn't run the code so it is safer than other programs
+ # ignoring some errors due to TestON
+ pyflakes $1 | grep -v "undefined name 'main'" | grep -v "undefined name 'utilities'" | grep -v "unable to detect undefined names"
echo "Running pylint..."
- #Pylint is a static code checker
- #ignoring some errors due to TestON
+ # Pylint is a static code checker
+ # ignoring some errors due to TestON
pylint -E --rcfile=$(dirname "${BASH_SOURCE}")/.pylint $1 | grep -v "Undefined variable 'main'" | grep -v "Undefined variable 'utilities'"
echo "Running PEP8..."
- #PEP8 is a the most common python coding style standard
+ # PEP8 is a the most common python coding style standard
if [ "$2" = "--reason" ]; then
pep8 --repeat --show-source --show-pep8 --ignore=$P8IGN $1
elif [ "$2" = "--relaxed" ]; then
diff --git a/TestON/bin/findPatchScript.sh b/TestON/bin/findPatchScript.sh
new file mode 100755
index 0000000..f88f528
--- /dev/null
+++ b/TestON/bin/findPatchScript.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# Copyright 2015 Open Networking Foundation (ONF)
+#
+# Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+# the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+# or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+#
+# TestON is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# TestON is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with TestON. If not, see <http://www.gnu.org/licenses/>.
+#
+# Usage : ./findPatchScript.sh -t <testName> (optional choices : -n <# : number of run on each commit>
+# -s <# : number of commits to skip every iteration>
+
+#source $ONOS_ROOT/tools/dev/bash_profile
+
+#!/bin/bash
+usage() { echo "Usage:$0 [-t <test_name>] Optional:{ -n <number_of_running_test_on_each_commit>
+ -s <number_of_skipping_commit> }"; 1>&2; exit 1; }
+
+NUM_RUN=1
+SKIP_COMMIT=1
+LOG_FILE="/home/sdn/OnosSystemTest/TestON/logs/findCommitLog.txt"
+while getopts ":t:n:s:" ARGS; do
+ case $ARGS in
+ t)
+ TESTNAME=${OPTARG}
+ ;;
+ n)
+ NUM_RUN=${OPTARG}
+ ((NUM_RUN > 0)) || usage
+ ;;
+ s)
+ SKIP_COMMIT=${OPTARG}
+ ((SKIP_COMMIT > 0)) || usage
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+if [ -z "${TESTNAME}" ]; then
+ usage
+fi
+
+exportMsg() {
+ echo "Log exported to $LOG_FILE"
+}
+runScript() {
+ echo -n > "$LOG_FILE"
+ PREVIOUS_COMMIT=""
+ while true; do
+ TEST_RESULT="1"
+ for ((i=0; i < NUM_RUN; i++))
+ do
+ cd ~/onos
+ COMMIT=$(git log -1 --pretty=fuller | grep -m1 -Po "(?<=commit\s)\w+")
+ echo "Current Commit : $COMMIT"
+ echo "Current Commit : $COMMIT" >> "$LOG_FILE"
+ echo "1" > /tmp/findPatchResult.txt
+ cd ~/OnosSystemTest/TestON/bin
+ ./cleanup.sh
+ ./cli.py run $TESTNAME
+ TEST_RESULT=$(cat /tmp/findPatchResult.txt)
+ echo $TEST_RESULT
+ if [ "$TEST_RESULT" == "0" ]; then
+ break
+ fi
+ done
+ if [ "$TEST_RESULT" == "1" ]; then
+ echo "Found the commit that has no problem : $(tput setaf 2)$COMMIT$(tput sgr 0)"
+ echo "Found the commit that has no problem : $COMMIT" >> $LOG_FILE
+ echo "Last commit that had a problem : $(tput setaf 1)$PREVIOUS_COMMIT$(tput sgr 0)"
+ echo "Last commit that had a problem : $PREVIOUS_COMMIT" >> $LOG_FILE
+ break
+ fi
+
+ cd ~/onos
+ COMMIT=$(git log -1 --skip $SKIP_COMMIT --pretty=fuller | grep -m1 -Po "(?<=commit\s)\w+")
+ echo "New commit to be tested : $COMMIT"
+ echo "New commit to be tested : $COMMIT" >> $LOG_FILE
+ PREVIOUS_COMMIT=$COMMIT
+ STASH_RESULT=$(git stash)
+ git checkout $COMMIT
+ if [ "$STASH_RESULT" != "No local changes to save" ]; then
+ git stash pop
+ fi
+ done
+}
+
+runScript
+echo >> $LOG_FILE
+echo >> $LOG_FILE
+exportMsg
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 19449f4..978c206 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -474,6 +474,26 @@
for driver in self.driversList:
vars( self )[ driver ].write( stepHeader + "\n" + caseFooter )
+ def setCheckingPoint( self ):
+ '''
+ Using when running findPatchScript.sh. This function needs to be placed
+ on the point that has the problem.
+
+ For example, if you see unusual behavior or from the portion of the code,
+ this is where you need to put with the conditional statement.
+ If some of the latency result is much greater than usual, have if statement
+ that checks if the result is greater than some point and include this function.
+
+ This will mark the 0 to findPatchResult.txt in /tmp/ and exit the test.
+ Then from findPatchScript, it will move onto the next commit and re-run the
+ test.
+ '''
+ self.log.error( "Reached to the checking point. Will mark the result and exit the test" )
+ resultFile = open( "/tmp/findPatchResult.txt", "w" )
+ resultFile.write( "0" )
+ resultFile.close()
+ self.cleanAndExit()
+
def cleanup( self ):
'''
Print a summary of the current test's results then attempt to release
diff --git a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
index f04e878..886c672 100644
--- a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
@@ -249,6 +249,7 @@
utilities.assert_equals( expect=main.TRUE, actual=partitionResults,
onpass="Firewall rules set successfully",
onfail="Error setting firewall rules" )
+ main.Cluster.reset()
main.step( "Sleeping 60 seconds" )
time.sleep( 60 )
@@ -277,6 +278,7 @@
for node in main.partition:
main.Cluster.runningNodes[ node ].active = True
+ main.Cluster.reset()
main.step( "Checking ONOS nodes" )
nodeResults = utilities.retry( main.Cluster.nodesCheck,
diff --git a/TestON/tests/HA/HAscaling/HAscaling.py b/TestON/tests/HA/HAscaling/HAscaling.py
index e46271d..4e18b30 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.py
+++ b/TestON/tests/HA/HAscaling/HAscaling.py
@@ -226,7 +226,7 @@
activeNodes = range( 0, main.Cluster.numCtrls )
newNodes = [ x for x in activeNodes if x not in prevNodes ]
- main.Cluster.resetActive()
+ main.Cluster.clearActive()
main.step( "Start new nodes" ) # OR stop old nodes?
started = main.TRUE
for i in newNodes:
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index bbb8db7..62b8ee5 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -196,6 +196,7 @@
killResults = killResults and\
ctrl.onosStop( ctrl.ipAddress )
ctrl.active = False
+ main.Cluster.reset()
utilities.assert_equals( expect=main.TRUE, actual=killResults,
onpass="ONOS nodes stopped successfully",
onfail="ONOS nodes NOT successfully stopped" )
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 9c2d180..bf1a589 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -222,7 +222,7 @@
onpass="New cluster metadata file generated",
onfail="Failled to generate new metadata file" )
time.sleep( 5 ) # Give time for nodes to read new file
- main.Cluster.resetActive()
+ main.Cluster.clearActive()
# Note : done up to this point.
main.step( "Start new nodes" ) # OR stop old nodes?
started = main.TRUE
diff --git a/TestON/tests/dependencies/Cluster.py b/TestON/tests/dependencies/Cluster.py
index 61c141c..a67bad5 100644
--- a/TestON/tests/dependencies/Cluster.py
+++ b/TestON/tests/dependencies/Cluster.py
@@ -72,12 +72,10 @@
return ips
- def resetActive( self ):
+ def clearActive( self ):
"""
Description:
- reset the activeness of the cluster to be false
- Required:
- Returns:
+ Sets the activeness of each cluster node to be False
"""
for ctrl in self.controllers:
ctrl.active = False
@@ -126,14 +124,16 @@
def next( self ):
"""
- An iterator for the cluster's controllers that
+ An iterator for the cluster's active controllers that
resets when there are no more elements.
Returns the next controller in the cluster
"""
try:
- return self.iterator.next()
- except StopIteration:
+ node = self.iterator.next()
+ assert node.active
+ return node
+ except ( StopIteration, AssertionError ):
self.reset()
try:
return self.iterator.next()