blob: b856536bc81eb3d1d79d5f93268ca3d610891018 [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim61643762017-12-07 15:55:38 -08002funcs = evaluate readTrusted( 'JenkinsCommonFuncs.groovy' )
3funcs.initialize( "HA" );
Devin Lim90803a82017-08-29 13:41:44 -07004// This is a Jenkinsfile for a scripted pipeline for the HA tests
Devin Lim90803a82017-08-29 13:41:44 -07005def prop = null
Devin Lim61643762017-12-07 15:55:38 -08006prop = funcs.getProperties()
Devin Lim90803a82017-08-29 13:41:44 -07007HA = [
Devin Lim61643762017-12-07 15:55:38 -08008"HAsanity" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Sanity", wiki_file:"HAsanityWiki.txt" ],
9"HAswapNodes" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Swap Nodes", wiki_file:"HAswapNodesWiki.txt" ],
10"HAscaling" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Scaling", wiki_file:"HAscalingWiki.txt" ],
11"HAclusterRestart" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Cluster Restart", wiki_file:"HAclusterRestartWiki.txt" ],
12"HAstopNodes" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Stop Nodes", wiki_file:"HAstopNodes.txt" ],
13"HAfullNetPartition" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Full Network Partition", wiki_file:"HAfullNetPartitionWiki.txt" ],
14"HAsingleInstanceRestart" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Single Instance Restart", wiki_file:"HAsingleInstanceRestartWiki.txt" ],
15"HAupgrade" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Upgrade", wiki_file:"HAupgradeWiki.txt" ],
16"HAupgradeRollback" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "HA Upgrade Rollback", wiki_file:"HAupgradeRollbackWiki.txt" ] ]
Devin Lim90803a82017-08-29 13:41:44 -070017
Jeremy Ronquillo2d2649d2017-09-14 12:53:06 -070018graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
Devin Lim61643762017-12-07 15:55:38 -080019graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
Devin Lim90803a82017-08-29 13:41:44 -070020
Devin Lim61643762017-12-07 15:55:38 -080021echo( "Testcases:" )
Devin Lim90803a82017-08-29 13:41:44 -070022def testsToRun = null
Devin Lim61643762017-12-07 15:55:38 -080023testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
24funcs.printTestToRun( testsToRun )
Devin Lim90803a82017-08-29 13:41:44 -070025
26def tests = [:]
27for( String test : HA.keySet() ){
28 toBeRun = testsToRun.contains( test )
29 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080030 tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, HA, graph_generator_file, graph_saved_directory )
Devin Lim90803a82017-08-29 13:41:44 -070031}
32
Devin Lim61643762017-12-07 15:55:38 -080033start = funcs.getCurrentTime()
Devin Lim90803a82017-08-29 13:41:44 -070034// run the tests
35for ( test in tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080036 tests[ test ].call()
Devin Lim90803a82017-08-29 13:41:44 -070037}
Devin Lim61643762017-12-07 15:55:38 -080038funcs.generateOverallGraph( prop, HA, graph_saved_directory )
39funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )