blob: 9d1122ebafe642cc7d5fc5002fa08ecfb7a789f4 [file] [log] [blame]
Devin Lime1346f42018-05-15 15:41:36 -07001#!groovy
Devin Limf5175192018-05-14 19:13:22 -07002// 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 SCPF-pipeline-<branch>
22
Devin Limf5175192018-05-14 19:13:22 -070023// read the dependency files
Devin Limb734ea52018-05-14 14:13:05 -070024SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
Devin Lim61643762017-12-07 15:55:38 -080025SCPFfuncs.init()
Devin Limb734ea52018-05-14 14:13:05 -070026funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
Devin Limf5175192018-05-14 19:13:22 -070027
Jon Hall6af749d2018-05-29 12:59:47 -070028// init funcs with SCPF specification
29funcs.initialize( "SCPF", SCPFfuncs )
Devin Limf5175192018-05-14 19:13:22 -070030
31// read the information from TestON.property on BM
Devin Lim90803a82017-08-29 13:41:44 -070032def prop = null
Devin Lim61643762017-12-07 15:55:38 -080033prop = funcs.getProperties()
34
Devin Limf5175192018-05-14 19:13:22 -070035// get the list of the test to run.
Devin Lim61643762017-12-07 15:55:38 -080036echo( "Testcases:" )
37def testsToRun = null
38testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
39funcs.printTestToRun( testsToRun )
40
Devin Limf5175192018-05-14 19:13:22 -070041// check if it is using old flow.
Devin Limc49c3732018-04-10 18:57:17 -070042isOldFlow = prop[ "isOldFlow" ] == "true"
Devin Lim61643762017-12-07 15:55:38 -080043SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
Devin Limf5175192018-05-14 19:13:22 -070044
45// set test to run as a list of function
Jon Hall6af749d2018-05-29 12:59:47 -070046def tests = [ : ]
47for ( String test : SCPFfuncs.SCPF.keySet() ){
Devin Lim90803a82017-08-29 13:41:44 -070048 toBeRun = testsToRun.contains( test )
49 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080050
51 pureTestName = test.replaceAll( "WithFlowObj", "" )
52 tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false, SCPFfuncs.SCPF, "", "" )
Devin Lim90803a82017-08-29 13:41:44 -070053}
54
Devin Limf5175192018-05-14 19:13:22 -070055// get start time
Devin Lim61643762017-12-07 15:55:38 -080056start = funcs.getCurrentTime()
Devin Limf5175192018-05-14 19:13:22 -070057// run the tests sequentially
Devin Lim90803a82017-08-29 13:41:44 -070058for ( test in tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080059 tests[ test ].call()
Devin Lim90803a82017-08-29 13:41:44 -070060}
Devin Limf5175192018-05-14 19:13:22 -070061
62// send result to slack after running test is done.
Jon Hall6af749d2018-05-29 12:59:47 -070063funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )