Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | 81ab48b | 2018-02-09 14:24:57 -0800 | [diff] [blame] | 2 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 3 | funcs.initialize( "USECASE" ); |
| 4 | // This is a Jenkinsfile for a scripted pipeline for the USECASE tests |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 5 | def prop = null |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 6 | prop = funcs.getProperties() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 7 | USECASE = [ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 8 | "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 Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 22 | ] |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 23 | graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 24 | graph_saved_directory = "/var/jenkins/workspace/postjob-BM/" |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 25 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 26 | echo( "Testcases:" ) |
| 27 | def testsToRun = null |
| 28 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 29 | funcs.printTestToRun( testsToRun ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 30 | |
| 31 | def tests = [:] |
| 32 | for( String test : USECASE.keySet() ){ |
| 33 | toBeRun = testsToRun.contains( test ) |
| 34 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 35 | tests[ stepName ] = funcs.runTest( test, toBeRun, prop, test, false, USECASE, graph_generator_file, graph_saved_directory ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 38 | start = funcs.getCurrentTime() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 39 | // run the tests |
| 40 | for ( test in tests.keySet() ){ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 41 | tests[ test ].call() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 42 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 43 | funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] ) |
| 44 | funcs.generateOverallGraph( prop, USECASE, graph_saved_directory ) |