Devin Lim | e1346f4 | 2018-05-15 15:41:36 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 2 | // Copyright 2017 Open Networking Foundation (ONF) |
| 3 | // |
| 4 | // Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | // the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | // or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | // |
| 8 | // TestON is free software: you can redistribute it and/or modify |
| 9 | // it under the terms of the GNU General Public License as published by |
| 10 | // the Free Software Foundation, either version 2 of the License, or |
| 11 | // (at your option) any later version. |
| 12 | // |
| 13 | // TestON is distributed in the hope that it will be useful, |
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | // GNU General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | // This is the Jenkins script for manual-graph-generator-trend |
| 22 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 23 | // read the dependency functions |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 24 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
| 25 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 26 | |
| 27 | fileRelated.init() |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 28 | |
| 29 | // read the node cluster ( VM or BM or Fabrics ) from the Jenkins job. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 30 | nodeCluster = params.NodeCluster |
| 31 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 32 | funcs.initializeTrend( nodeCluster ); |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 33 | |
| 34 | // do additional check for Fabric since it will be different depends on which branch it is running on. |
Devin Lim | 981f80b | 2018-04-09 11:25:59 -0700 | [diff] [blame] | 35 | if( nodeCluster == "Fabric" ) |
| 36 | funcs.additionalInitForSR( params.ONOSbranch ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 37 | def prop = null |
| 38 | prop = funcs.getProperties() |
| 39 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 40 | // get the list of the tests from the parameters. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 41 | def Tests = params.Test |
| 42 | prop[ "ONOSBranch" ] = params.ONOSbranch |
| 43 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 44 | // set some of the paths of the file and directory |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 45 | graph_generator_file = fileRelated.trendIndividual |
| 46 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-" + nodeCluster + ( nodeCluster == "Fabric" ? funcs.fabricOn( prop[ "ONOSBranch" ] ) : "" ) + "/" |
Devin Lim | 86e4053 | 2018-04-06 12:44:06 -0700 | [diff] [blame] | 47 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 48 | def testsToRun = null |
| 49 | testsToRun = funcs.getTestsToRun( Tests ) |
| 50 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 51 | // set functions into the dictionary. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 52 | def tests = [:] |
| 53 | for( String test : testsToRun ){ |
| 54 | println test |
| 55 | tests[ test ] = funcs.runTest( test, true, prop, test, true, [], graph_generator_file, graph_saved_directory ) |
| 56 | } |
| 57 | |
Devin Lim | 767c983 | 2018-05-15 16:21:52 -0700 | [diff] [blame] | 58 | for ( test in tests.keySet() ){ |
| 59 | tests[ test ].call() |
| 60 | } |