blob: 3806fc3d01506b4684495058f3da463a1f04563a [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim81ab48b2018-02-09 14:24:57 -08002funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
Devin Lim61643762017-12-07 15:55:38 -08003funcs.initialize( "USECASE" );
4// This is a Jenkinsfile for a scripted pipeline for the USECASE 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 -07007USECASE = [
Devin Lim61643762017-12-07 15:55:38 -08008 "FUNCvirNetNB" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCvirNetNB", wiki_file:"FUNCvirNetNBWiki.txt" ],
9 "FUNCbgpls" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCbgpls", wiki_file:"FUNCbgplsWiki.txt" ],
10 "VPLSBasic" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "VPLSBasic", wiki_file:"VPLSBasicWiki.txt" ],
11 "VPLSfailsafe" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "VPLSfailsafe", wiki_file:"VPLSfailsafeWiki.txt" ],
12 "PLATdockertest": [ wiki_link:"Docker Images sanity test", wiki_file:"PLATdockertestTableWiki.txt" ],
13 "SRSanity": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Sanity", wiki_file:"SRSanityWiki.txt" ],
14 "SRSwitchFailure": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Switch Failure", wiki_file:"SRSwitchFailureWiki.txt" ],
15 "SRLinkFailure": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Link Failure", wiki_file:"SRLinkFailureWiki.txt" ],
16 "SROnosFailure": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Onos node Failure", wiki_file:"SROnosFailureWiki.txt" ],
17 "SRClusterRestart": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Cluster Restart", wiki_file:"SRClusterRestartWiki.txt" ],
18 "SRDynamic": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR Dynamic Config", wiki_file:"SRDynamicWiki.txt" ],
19 "SRHighAvailability": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SR High Availability", wiki_file:"SRHighAvailabilityWiki.txt" ],
20 "USECASE_SdnipFunction": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SDNIP Function", wiki_file:"USECASE_SdnipFunctionWiki.txt" ],
21 "USECASE_SdnipFunctionCluster": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "SDNIP Function Cluster", wiki_file:"USECASE_SdnipFunctionClusterWiki.txt" ]
Devin Lim90803a82017-08-29 13:41:44 -070022]
Jeremy Ronquillo2d2649d2017-09-14 12:53:06 -070023graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
Devin Lim61643762017-12-07 15:55:38 -080024graph_saved_directory = "/var/jenkins/workspace/postjob-BM/"
Devin Lim90803a82017-08-29 13:41:44 -070025
Devin Lim61643762017-12-07 15:55:38 -080026echo( "Testcases:" )
27def testsToRun = null
28testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
29funcs.printTestToRun( testsToRun )
Devin Lim90803a82017-08-29 13:41:44 -070030
31def tests = [:]
32for( String test : USECASE.keySet() ){
33 toBeRun = testsToRun.contains( test )
34 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080035 tests[ stepName ] = funcs.runTest( test, toBeRun, prop, test, false, USECASE, graph_generator_file, graph_saved_directory )
Devin Lim90803a82017-08-29 13:41:44 -070036}
37
Devin Lim61643762017-12-07 15:55:38 -080038start = funcs.getCurrentTime()
Devin Lim90803a82017-08-29 13:41:44 -070039// run the tests
40for ( test in tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080041 tests[ test ].call()
Devin Lim90803a82017-08-29 13:41:44 -070042}
Devin Lim61643762017-12-07 15:55:38 -080043funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )
44funcs.generateOverallGraph( prop, USECASE, graph_saved_directory )