blob: 4c6f0212403835372df1293ed4a15a19e9d9871c [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 dependency Jenkins script.
22// it has some general functionality of making database command, basic graph part, and get list of the test
23
Devin Limf5175192018-05-14 19:13:22 -070024// make the init part of the database command
Devin Lim61643762017-12-07 15:55:38 -080025def database_command_create( pass, host, port, user ){
Jon Hall6af749d2018-05-29 12:59:47 -070026 return pass + "|psql --host=" + host + " --port=" + port + " --username=" + user + " --password --dbname onostest -c "
Devin Lim61643762017-12-07 15:55:38 -080027}
Devin Limf5175192018-05-14 19:13:22 -070028
29// make the basic graph part for the Rscript
Devin Lim61643762017-12-07 15:55:38 -080030def basicGraphPart( rFileName, host, port, user, pass, subject, branchName ){
Jon Hall6af749d2018-05-29 12:59:47 -070031 return " Rscript " + rFileName + " " + host + " " + port + " " + user + " " + pass + " " + subject + " " + branchName
Devin Lim61643762017-12-07 15:55:38 -080032}
Devin Limf5175192018-05-14 19:13:22 -070033
34// get the list of the test as dictionary then return as a string
Devin Lim61643762017-12-07 15:55:38 -080035def getTestList( tests ){
Jon Hall6af749d2018-05-29 12:59:47 -070036 def list = ""
37 for ( String test : tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080038 list += test + ","
Jon Hall6af749d2018-05-29 12:59:47 -070039 }
Devin Lim61643762017-12-07 15:55:38 -080040 return list[ 0..-2 ]
41}
Jon Hall6af749d2018-05-29 12:59:47 -070042
43return this