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 dependency Jenkins script. |
| 22 | // it has some common functions that runs test and generate graph. |
| 23 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 24 | import groovy.time.TimeCategory |
| 25 | import groovy.time.TimeDuration |
| 26 | |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 27 | generalFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/GeneralFuncs.groovy' ) |
| 28 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 29 | |
| 30 | fileRelated.init() |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 31 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 32 | def initializeTrend( machine ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 33 | // For initializing any trend graph jobs |
| 34 | // machine : Either VM,BM, or Fabric# |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 35 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 36 | table_name = "executed_test_tests" |
| 37 | result_name = "executed_test_results" |
| 38 | testMachine = "TestStation-" + machine + "s" |
| 39 | this.machine = machine |
| 40 | isSCPF = false |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 41 | hasArgs = false |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 42 | isTrend = true |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 43 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 44 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 45 | def initialize( type, SCPFfuncs ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 46 | // Initializing for SCPF tests |
| 47 | // type : type of the test ( SR,FUNC,SCPF... ) |
| 48 | // Passing the SCPFfunction which will be PerformanceFuncs.groovy |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 49 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 50 | init( type ) |
| 51 | SCPFfunc = SCPFfuncs |
| 52 | isSCPF = true |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 53 | hasArgs = true // Has TestON cli arguments to be added when running the test |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 54 | machine = machineType[ type ] |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 55 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 56 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 57 | def initialize( type ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 58 | // initializing for FUNC,HA,SR, and USECASE |
| 59 | // type : type of the test ( SR,FUNC,SCPF... ) |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 60 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 61 | init( type ) |
| 62 | SCPFfunc = null |
| 63 | table_name = "executed_test_tests" |
| 64 | result_name = "executed_test_results" |
| 65 | trend_generator_file = fileRelated.trendMultiple |
| 66 | build_stats_generator_file = fileRelated.histogramMultiple |
| 67 | isSCPF = false |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 68 | hasArgs = false |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 69 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 70 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 71 | def init( type ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 72 | // type : type of the test ( SR,FUNC,SCPF... ) |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 73 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 74 | machineType = [ "FUNC": "VM", |
| 75 | "HA": "VM", |
| 76 | "SR": "Fabric", |
| 77 | "SCPF": "BM", |
| 78 | "USECASE": "BM" ] |
| 79 | testType = type |
| 80 | testMachine = "TestStation-" + machineType[ type ] + "s" |
| 81 | isTrend = false |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 82 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 83 | |
Devin Lim | 86e4053 | 2018-04-06 12:44:06 -0700 | [diff] [blame] | 84 | def additionalInitForSR( branch ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 85 | // additional setup for SegmentRouting tests to determine the machine depends on the branch it is running. |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 86 | // branch : branch of the onos. ( master, 2.0, 1.15... ) |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 87 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 88 | testMachine = ( ( new StringBuilder( testMachine ) ).insert( testMachine.size() - 1, fabricOn( branch ) ) ). |
| 89 | toString() |
| 90 | if ( isTrend ){ |
| 91 | machine += fabricOn( branch ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 92 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 93 | else { |
| 94 | machineType[ testType ] += fabricOn( branch ) |
| 95 | } |
| 96 | print testMachine |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 97 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 98 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 99 | def fabricOn( branch ){ |
| 100 | // gets the fabric machines with the branch of onos. |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 101 | // branch : master, 2.0, 1.15... |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 102 | // branch.reverse().take(4).reverse() will get last 4 characters of the string. |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 103 | switch ( branch.reverse().take( 3 ).reverse() ){ |
| 104 | case "ter": return "4" |
| 105 | case "2.0": return "3" |
| 106 | case ".15": return "2" |
| 107 | case ".14": return "3" |
| 108 | case ".13": return "2" |
| 109 | case ".12": return "3" |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 110 | default: return "4" |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | def printType(){ |
| 115 | // print the test type and test machine that was initialized. |
| 116 | |
| 117 | echo testType |
| 118 | echo testMachine |
| 119 | } |
| 120 | |
| 121 | def getProperties(){ |
| 122 | // get the properties of the test by reading the TestONOS.property |
| 123 | |
| 124 | node( testMachine ) { |
| 125 | return readProperties( file: '/var/jenkins/TestONOS.property' ) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | def getTestsToRun( testList ){ |
| 130 | // get test to run by tokenizing the list. |
| 131 | |
| 132 | testList.tokenize( "\n;, " ) |
| 133 | } |
| 134 | |
| 135 | def getCurrentTime(){ |
| 136 | // get time of the PST zone. |
| 137 | |
| 138 | TimeZone.setDefault( TimeZone.getTimeZone( 'PST' ) ) |
| 139 | return new Date() |
| 140 | } |
| 141 | |
| 142 | def getTotalTime( start, end ){ |
| 143 | // get total time of the test using start and end time. |
| 144 | |
| 145 | return TimeCategory.minus( end, start ) |
| 146 | } |
| 147 | |
| 148 | def printTestToRun( testList ){ |
| 149 | // printout the list of the test in the list. |
| 150 | |
| 151 | for ( String test : testList ){ |
| 152 | println test |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | def sendResultToSlack( start, isManualRun, branch ){ |
| 157 | // send the result of the test to the slack when it is not manually running. |
| 158 | // start : start time of the test |
| 159 | // isManualRun : string that is whether "false" or "true" |
| 160 | // branch : branch of the onos. |
| 161 | |
| 162 | try { |
| 163 | if ( isManualRun == "false" ){ |
| 164 | end = getCurrentTime() |
| 165 | TimeDuration duration = TimeCategory.minus( end, start ) |
| 166 | slackSend( color: "#5816EE", |
| 167 | message: testType + "-" + branch + " tests ended at: " + end.toString() + |
| 168 | "\nTime took : " + duration ) |
| 169 | } |
| 170 | } |
| 171 | catch ( all ){ |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | def initAndRunTest( testName, testCategory ){ |
| 176 | // Bash script that will |
| 177 | // Initialize the environment to the machine and run the test. |
| 178 | // testName : name of the test |
| 179 | // testCategory : (SR,FUNC ... ) |
| 180 | |
| 181 | return '''#!/bin/bash -l |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 182 | set -i # interactive |
| 183 | set +e |
| 184 | shopt -s expand_aliases # expand alias in non-interactive mode |
| 185 | export PYTHONUNBUFFERED=1 |
| 186 | ifconfig |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 187 | echo "ONOS Branch is: $ONOSBranch" |
| 188 | echo "TestON Branch is: $TestONBranch" |
| 189 | echo "Test date: " |
| 190 | date |
| 191 | cd ~ |
| 192 | export PATH=$PATH:onos/tools/test/bin |
| 193 | timeout 240 stc shutdown | head -100 |
| 194 | timeout 240 stc teardown | head -100 |
| 195 | timeout 240 stc shutdown | head -100 |
| 196 | cd ~/OnosSystemTest/TestON/bin |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 197 | git log | head |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 198 | ./cleanup.sh -f |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 199 | ''' + "./cli.py run " + |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 200 | ( !hasArgs ? testName : testCategory[ testName ][ 'test' ] ) + |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 201 | " --params GRAPH/nodeCluster=" + machineType[ testType ] + ''' |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 202 | ./cleanup.sh -f |
| 203 | # cleanup config changes |
| 204 | cd ~/onos/tools/package/config |
| 205 | git clean -df''' |
| 206 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 207 | |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 208 | def copyLogs(){ |
| 209 | // bash script to copy the logs and other necessary element for SR tests. |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 210 | |
| 211 | result = "" |
| 212 | if ( testType == "SR" ){ |
| 213 | result = ''' |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 214 | sudo rm /var/jenkins/workspace/SR-log-${WikiPrefix}/* |
| 215 | sudo cp *karaf.log.* /var/jenkins/workspace/SR-log-${WikiPrefix}/ |
| 216 | sudo cp *Flows* /var/jenkins/workspace/SR-log-${WikiPrefix}/ |
| 217 | sudo cp *Groups* /var/jenkins/workspace/SR-log-${WikiPrefix}/ |
Devin Lim | a7b97a4 | 2018-04-09 14:26:38 -0700 | [diff] [blame] | 218 | sudo cp *.tar.gz /var/jenkins/workspace/SR-log-${WikiPrefix}/ |
Devin Lim | 6faa3f9 | 2018-05-01 13:16:25 -0700 | [diff] [blame] | 219 | sudo cp t3-* /var/jenkins/workspace/SR-log-${WikiPrefix}/ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 220 | ''' |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 221 | } |
| 222 | return result |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 223 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 224 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 225 | def cleanAndCopyFiles( testName ){ |
| 226 | // clean up some files that were in the folder and copy the new files from the log |
| 227 | // testName : name of the test |
| 228 | |
| 229 | return '''#!/bin/bash -i |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 230 | set +e |
| 231 | echo "ONOS Branch is: ${ONOSBranch}" |
| 232 | echo "TestON Branch is: ${TestONBranch}" |
| 233 | echo "Job name is: "''' + testName + ''' |
| 234 | echo "Workspace is: ${WORKSPACE}/" |
| 235 | echo "Wiki page to post is: ${WikiPrefix}-" |
| 236 | # remove any leftover files from previous tests |
| 237 | sudo rm ${WORKSPACE}/*Wiki.txt |
| 238 | sudo rm ${WORKSPACE}/*Summary.txt |
| 239 | sudo rm ${WORKSPACE}/*Result.txt |
| 240 | sudo rm ${WORKSPACE}/*.csv |
| 241 | #copy files to workspace |
| 242 | cd `ls -t ~/OnosSystemTest/TestON/logs/*/ | head -1 | sed 's/://'` |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 243 | ''' + copyLogs() + ''' |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 244 | sudo cp *.txt ${WORKSPACE}/ |
| 245 | sudo cp *.csv ${WORKSPACE}/ |
| 246 | cd ${WORKSPACE}/ |
| 247 | for i in *.csv |
| 248 | do mv "$i" "$WikiPrefix"-"$i" |
| 249 | done |
| 250 | ls -al |
| 251 | cd ''' |
| 252 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 253 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 254 | def fetchLogs( testName ){ |
| 255 | // fetch the logs of onos from onos nodes to onos System Test logs |
| 256 | // testName: name of the test |
| 257 | |
| 258 | return '''#!/bin/bash |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 259 | set +e |
| 260 | cd ~/OnosSystemTest/TestON/logs |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 261 | echo "TestON test name is: "''' + testName + ''' |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 262 | TestONlogDir=$(ls -t | grep ${TEST_NAME}_ |head -1) |
| 263 | echo "########################################################################################" |
| 264 | echo "##### copying ONOS logs from all nodes to TestON/logs directory: ${TestONlogDir}" |
| 265 | echo "########################################################################################" |
| 266 | cd $TestONlogDir |
| 267 | if [ $? -eq 1 ] |
| 268 | then |
| 269 | echo "Job name does not match any test suite name to move log!" |
| 270 | else |
| 271 | pwd |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 272 | for i in $OC{1..7}; do onos-fetch-logs $i || echo log does not exist for onos $i; done |
| 273 | for i in $OC{1..7}; do atomix-fetch-logs $i || echo log does not exist for atomix $i; done |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 274 | fi |
| 275 | cd''' |
| 276 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 277 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 278 | def isPostingResult( manual, postresult ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 279 | // check if it is posting the result. |
| 280 | // posting when it is automatically running or has postResult condition from the manual run |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 281 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 282 | return manual == "false" || postresult == "true" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 283 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 284 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 285 | def postResult( prop, graphOnly ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 286 | // post the result by triggering postjob. |
| 287 | // prop : property dictionary that was read from the machine. |
| 288 | // graphOnly : if it is graph generating job |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 289 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 290 | if ( graphOnly || isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){ |
| 291 | def post = build job: "postjob-" + ( graphOnly ? machine : machineType[ testType ] ), propagate: false |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 292 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 293 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 294 | |
| 295 | def postLogs( testName, prefix ){ |
| 296 | // posting logs of the onos jobs specifically SR tests |
| 297 | // testName : name of the test |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 298 | // prefix : branch prefix ( master, 2.0, 1.15 ... ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 299 | |
| 300 | resultURL = "" |
| 301 | if ( testType == "SR" ){ |
| 302 | def post = build job: "SR-log-" + prefix, propagate: false |
| 303 | resultURL = post.getAbsoluteUrl() |
| 304 | } |
| 305 | return resultURL |
| 306 | } |
| 307 | |
| 308 | def getSlackChannel(){ |
| 309 | // get name of the slack channel. |
| 310 | // if the test is SR, it will return sr-failures |
| 311 | |
| 312 | return "#" + ( testType == "SR" ? "sr-failures" : "jenkins-related" ) |
| 313 | } |
| 314 | |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 315 | def analyzeResult( prop, workSpace, pureTestName, testName, resultURL, wikiLink, isSCPF ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 316 | // analyzing the result of the test and send to slack if the test was failed. |
| 317 | // prop : property dictionary |
| 318 | // workSpace : workSpace where the result file is saved |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 319 | // pureTestName : TestON name of the test |
| 320 | // testName : Jenkins name of the test. Example: SCPFflowTPFobj |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 321 | // resultURL : url for the logs for SR tests. Will not be posted if it is empty |
| 322 | // wikiLink : link of the wiki page where the result was posted |
| 323 | // isSCPF : Check if it is SCPF. If so, it won't post the wiki link. |
| 324 | |
| 325 | node( testMachine ) { |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 326 | def resultContents = readFile( workSpace + "/" + pureTestName + "Result.txt" ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 327 | resultContents = resultContents.split( "\n" ) |
| 328 | if ( resultContents[ 0 ] == "1" ){ |
| 329 | print "All passed" |
| 330 | } |
| 331 | else { |
| 332 | print "Failed" |
| 333 | if ( prop[ "manualRun" ] == "false" ){ |
| 334 | slackSend( channel: getSlackChannel(), |
| 335 | color: "FF0000", |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 336 | message: "[" + prop[ "ONOSBranch" ] + "]" + testName + " : Failed!\n" + |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 337 | resultContents[ 1 ] + "\n" + |
| 338 | "[TestON log] : \n" + |
| 339 | "https://jenkins.onosproject.org/blue/organizations/jenkins/${ env.JOB_NAME }/detail/${ env.JOB_NAME }/${ env.BUILD_NUMBER }/pipeline" + |
| 340 | ( isSCPF ? "" : ( "\n[Result on Wiki] : \n" + |
| 341 | "https://wiki.onosproject.org/display/ONOS/" + |
| 342 | wikiLink.replaceAll( "\\s", "+" ) ) ) + |
| 343 | ( resultURL != "" ? ( "\n[Karaf log] : \n" + |
| 344 | resultURL + "artifact/" ) : "" ), |
| 345 | teamDomain: 'onosproject' ) |
| 346 | } |
| 347 | Failed |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
Devin Lim | e89761a | 2018-03-16 17:52:57 -0700 | [diff] [blame] | 352 | def publishToConfluence( isManualRun, isPostResult, wikiLink, file ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 353 | // publish HTML script to wiki confluence |
| 354 | // isManualRun : string "true" "false" |
| 355 | // isPostResult : string "true" "false" |
| 356 | // wikiLink : link of the wiki page to publish |
| 357 | // file : name of the file to be published |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 358 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 359 | if ( isPostingResult( isManualRun, isPostResult ) ){ |
| 360 | publishConfluence siteName: 'wiki.onosproject.org', pageName: wikiLink, spaceName: 'ONOS', |
| 361 | attachArchivedArtifacts: true, buildIfUnstable: true, |
| 362 | editorList: [ confluenceWritePage( confluenceFile( file ) ) ] |
| 363 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 364 | |
| 365 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 366 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 367 | def runTest( testName, toBeRun, prop, pureTestName, graphOnly, testCategory, graph_generator_file, |
| 368 | graph_saved_directory ){ |
| 369 | // run the test on the machine that contains all the steps : init and run test, copy files, publish result ... |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 370 | // testName : name of the test in Jenkins |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 371 | // toBeRun : boolean value whether the test will be run or not. If not, it won't be run but shows up with empty |
| 372 | // result on pipeline view |
| 373 | // prop : dictionary property on the machine |
| 374 | // pureTestName : Pure name of the test. ( ex. pureTestName of SCPFflowTpFobj will be SCPFflowTp ) |
| 375 | // graphOnly : check if it is generating graph job. If so, it will only generate the generating graph part |
Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame] | 376 | // testCategory : Map for the test suit ( SCPF, SR, FUNC, ... ) which contains information about the tests |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 377 | // graph_generator_file : Rscript file with the full path. |
| 378 | // graph_saved_directory : where the generated graph will be saved to. |
| 379 | |
| 380 | return { |
| 381 | catchError { |
| 382 | stage( testName ) { |
| 383 | if ( toBeRun ){ |
| 384 | def workSpace = "/var/jenkins/workspace/" + testName |
| 385 | def fileContents = "" |
| 386 | node( testMachine ) { |
| 387 | withEnv( [ 'ONOSBranch=' + prop[ "ONOSBranch" ], |
You Wang | 8e4f4c0 | 2019-01-03 10:49:46 -0800 | [diff] [blame] | 388 | 'ONOSJAVAOPTS=' + prop[ "ONOSJAVAOPTS" ], |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 389 | 'TestONBranch=' + prop[ "TestONBranch" ], |
| 390 | 'ONOSTag=' + prop[ "ONOSTag" ], |
| 391 | 'WikiPrefix=' + prop[ "WikiPrefix" ], |
| 392 | 'WORKSPACE=' + workSpace ] ) { |
| 393 | if ( !graphOnly ){ |
You Wang | 6d17194 | 2018-10-17 11:45:05 -0700 | [diff] [blame] | 394 | if ( isSCPF ){ |
| 395 | // Remove the old database file |
| 396 | sh SCPFfunc.cleanupDatabaseFile( testName ) |
| 397 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 398 | sh initAndRunTest( testName, testCategory ) |
| 399 | // For the Wiki page |
| 400 | sh cleanAndCopyFiles( pureTestName ) |
| 401 | } |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 402 | databaseAndGraph( prop, testName, pureTestName, graphOnly, |
| 403 | graph_generator_file, graph_saved_directory ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 404 | if ( !graphOnly ){ |
| 405 | sh fetchLogs( pureTestName ) |
| 406 | if ( !isSCPF ){ |
| 407 | publishToConfluence( prop[ "manualRun" ], prop[ "postResult" ], |
| 408 | testCategory[ testName ][ 'wiki_link' ], |
| 409 | workSpace + "/" + testCategory[ testName ][ 'wiki_file' ] ) |
| 410 | } |
| 411 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 412 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 413 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 414 | postResult( prop, graphOnly ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 415 | if ( !graphOnly ){ |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 416 | def resultURL = postLogs( testName, prop[ "WikiPrefix" ] ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 417 | analyzeResult( prop, workSpace, pureTestName, testName, resultURL, |
| 418 | isSCPF ? "" : testCategory[ testName ][ 'wiki_link' ], |
| 419 | isSCPF ) |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 425 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 426 | |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 427 | def databaseAndGraph( prop, testName, pureTestName, graphOnly, graph_generator_file, graph_saved_directory ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 428 | // part where it insert the data into the database. |
| 429 | // It will use the predefined encrypted variables from the Jenkins. |
| 430 | // prop : property dictionary that was read from the machine |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 431 | // testName : Jenkins name for the test |
| 432 | // pureTestName : TestON name for the test |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 433 | // graphOnly : boolean whether it is graph only or not |
| 434 | // graph_generator_file : Rscript file with the full path. |
| 435 | // graph_saved_directory : where the generated graph will be saved to. |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 436 | if ( graphOnly || isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){ |
| 437 | // Post Results |
| 438 | withCredentials( [ |
| 439 | string( credentialsId: 'db_pass', variable: 'pass' ), |
| 440 | string( credentialsId: 'db_user', variable: 'user' ), |
| 441 | string( credentialsId: 'db_host', variable: 'host' ), |
| 442 | string( credentialsId: 'db_port', variable: 'port' ) ] ) { |
| 443 | def database_command = generalFuncs.database_command_create( pass, host, port, user ) + |
| 444 | ( !isSCPF ? sqlCommand( testName ) : SCPFfunc.sqlCommand( testName ) ) |
| 445 | sh '''#!/bin/bash |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 446 | export DATE=\$(date +%F_%T) |
| 447 | cd ~ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 448 | pwd ''' + ( graphOnly ? "" : |
Jon Hall | 8b1e92c | 2018-06-13 14:07:22 -0700 | [diff] [blame] | 449 | ( !isSCPF ? databasePart( prop[ "WikiPrefix" ], pureTestName, database_command ) : |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 450 | SCPFfunc.databasePart( testName, database_command ) ) ) + ''' |
| 451 | ''' + ( !isSCPF ? graphGenerating( host, port, user, pass, testName, prop, graph_saved_directory, |
| 452 | graph_generator_file ) : |
| 453 | SCPFfunc.getGraphGeneratingCommand( host, port, user, pass, testName, prop ) ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 454 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 455 | } |
| 456 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 457 | |
| 458 | def generateCategoryStatsGraph( testMachineOn, manualRun, postresult, stat_file, pie_file, type, branch, testListPart, |
| 459 | save_path, pieTestListPart ){ |
| 460 | // function that will generate the category stat graphs for the overall test. |
| 461 | // testMachineOn : the machine the graph will be generated. It will be TestStation-VMs for the most cases |
| 462 | // manualRun : string of "true" or "false" |
| 463 | // postresult : string of "true" or "false" |
| 464 | // stat_file : file name with full path for Rscript for the stat graph |
| 465 | // pie_file : file name with full path for Rscript for the pie graph |
| 466 | // type : type of the test ( USECASE, FUNC, HA ) |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 467 | // branch : branch of the test ( master, onos-2.0, onos-1.15 ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 468 | // testListPart : list of the test to be included |
| 469 | // save_path : path that will save the graphs to |
| 470 | // pieTestListPart : list of the test for pie graph |
| 471 | |
| 472 | if ( isPostingResult( manualRun, postresult ) ){ |
| 473 | node( testMachineOn ) { |
| 474 | |
| 475 | withCredentials( [ |
| 476 | string( credentialsId: 'db_pass', variable: 'pass' ), |
| 477 | string( credentialsId: 'db_user', variable: 'user' ), |
| 478 | string( credentialsId: 'db_host', variable: 'host' ), |
| 479 | string( credentialsId: 'db_port', variable: 'port' ) ] ) { |
| 480 | sh '''#!/bin/bash |
| 481 | ''' + generalFuncs.basicGraphPart( stat_file, host, port, user, pass, type, |
| 482 | branch ) + " \"" + testListPart + "\" latest " + save_path + ''' |
| 483 | ''' + getOverallPieGraph( pie_file, host, port, user, pass, branch, type, pieTestListPart, 'y', |
| 484 | save_path ) + ''' |
| 485 | ''' + |
| 486 | getOverallPieGraph( pie_file, host, port, user, pass, branch, type, pieTestListPart, 'n', save_path ) |
| 487 | } |
| 488 | } |
| 489 | postResult( [ ], true ) |
| 490 | } |
| 491 | } |
| 492 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 493 | def makeTestList( list, commaNeeded ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 494 | // make the list of the test in to a string. |
| 495 | // list : list of the test |
| 496 | // commaNeeded : if comma is needed for the string |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 497 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 498 | return generalFuncs.getTestList( list ) + ( commaNeeded ? "," : "" ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 499 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 500 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 501 | def createStatsList( testCategory, list, semiNeeded ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 502 | // make the list for stats |
| 503 | // testCategory : category of the test |
| 504 | // list : list of the test |
| 505 | // semiNeeded: if semi colon is needed |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 506 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 507 | return testCategory + "-" + generalFuncs.getTestList( list ) + ( semiNeeded ? ";" : "" ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 508 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 509 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 510 | def generateOverallGraph( prop, testCategory, graph_saved_directory ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 511 | // generate the overall graph for the test |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 512 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 513 | if ( isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){ |
| 514 | node( testMachine ) { |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 515 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 516 | withCredentials( [ |
| 517 | string( credentialsId: 'db_pass', variable: 'pass' ), |
| 518 | string( credentialsId: 'db_user', variable: 'user' ), |
| 519 | string( credentialsId: 'db_host', variable: 'host' ), |
| 520 | string( credentialsId: 'db_port', variable: 'port' ) ] ) { |
| 521 | testList = generalFuncs.getTestList( testCategory ) |
| 522 | sh '''#!/bin/bash |
| 523 | ''' + |
| 524 | generalFuncs.basicGraphPart( trend_generator_file, host, port, |
| 525 | user, pass, testType, |
| 526 | prop[ "ONOSBranch" ] ) + " " + testList + " 20 " + graph_saved_directory |
| 527 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 528 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 529 | postResult( prop, false ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 530 | } |
| 531 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 532 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 533 | def getOverallPieGraph( file, host, port, user, pass, branch, type, testList, yOrN, path ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 534 | // Rcommand for the pie graph |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 535 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 536 | return generalFuncs.basicGraphPart( file, host, port, user, pass, type, branch ) + |
| 537 | " \"" + testList + "\" latest " + yOrN + " " + path |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 538 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 539 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 540 | def sqlCommand( testName ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 541 | // get the inserting sqlCommand for non-SCPF tests. |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 542 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 543 | return "\"INSERT INTO " + table_name + " VALUES('\$DATE','" + result_name + "','" + |
| 544 | testName + "',\$BUILD_NUMBER, '\$ONOSBranch', \$line);\" " |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 545 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 546 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 547 | def graphGenerating( host, port, user, pass, testName, prop, graph_saved_directory, graph_generator_file ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 548 | // get the graphGenerating R command for non-SCPF tests |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 549 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 550 | return generalFuncs.basicGraphPart( graph_generator_file, host, port, user, pass, testName, |
| 551 | prop[ "ONOSBranch" ] ) + " 20 " + graph_saved_directory |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 552 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 553 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 554 | def databasePart( wikiPrefix, testName, database_command ){ |
| 555 | // to read and insert the data from .csv to the database |
| 556 | |
| 557 | return ''' |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 558 | sed 1d ''' + workSpace + "/" + wikiPrefix + "-" + testName + '''.csv | while read line |
| 559 | do |
| 560 | echo \$line |
| 561 | echo ''' + database_command + ''' |
| 562 | done ''' |
| 563 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 564 | |
| 565 | def generateStatGraph( testMachineOn, onos_branch, AllTheTests, stat_graph_generator_file, pie_graph_generator_file, |
| 566 | graph_saved_directory ){ |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 567 | // Will generate the stats graph. |
| 568 | |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 569 | testListPart = createStatsList( "FUNC", AllTheTests[ "FUNC" ], true ) + |
| 570 | createStatsList( "HA", AllTheTests[ "HA" ], true ) + |
| 571 | createStatsList( "USECASE", AllTheTests[ "USECASE" ], false ) |
| 572 | pieTestList = makeTestList( AllTheTests[ "FUNC" ], true ) + |
| 573 | makeTestList( AllTheTests[ "HA" ], true ) + |
| 574 | makeTestList( AllTheTests[ "USECASE" ], false ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 575 | generateCategoryStatsGraph( testMachineOn, "false", "true", stat_graph_generator_file, pie_graph_generator_file, |
| 576 | "ALL", onos_branch, testListPart, graph_saved_directory, pieTestList ) |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 577 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 578 | |
Jeremy Ronquillo | f78a6ca | 2018-03-12 09:20:57 -0700 | [diff] [blame] | 579 | def branchWithPrefix( branch ){ |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 580 | // get the branch with the prefix ( "onos-" ) |
Jeremy Ronquillo | f78a6ca | 2018-03-12 09:20:57 -0700 | [diff] [blame] | 581 | return ( ( branch != "master" ) ? "onos-" : "" ) + branch |
| 582 | } |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 583 | |
You Wang | fe3877b | 2018-08-02 11:48:35 -0700 | [diff] [blame] | 584 | def testBranchWithPrefix( branch ){ |
| 585 | // get TestON branch with the prefix ( "onos-" ) |
You Wang | 8f12d7d | 2018-11-09 13:47:23 -0800 | [diff] [blame] | 586 | if ( branch == "1.12" ) |
You Wang | fe3877b | 2018-08-02 11:48:35 -0700 | [diff] [blame] | 587 | return "onos-1.13" |
You Wang | 8f12d7d | 2018-11-09 13:47:23 -0800 | [diff] [blame] | 588 | else if ( branch == "1.13" ) |
You Wang | fe3877b | 2018-08-02 11:48:35 -0700 | [diff] [blame] | 589 | return "onos-1.13" |
You Wang | 8f12d7d | 2018-11-09 13:47:23 -0800 | [diff] [blame] | 590 | else if ( branch == "1.14" ) |
You Wang | da4b144 | 2018-11-29 12:31:22 -0800 | [diff] [blame] | 591 | return "onos-1.15" |
You Wang | 8f12d7d | 2018-11-09 13:47:23 -0800 | [diff] [blame] | 592 | else if ( branch == "1.15" ) |
You Wang | da4b144 | 2018-11-29 12:31:22 -0800 | [diff] [blame] | 593 | return "onos-1.15" |
You Wang | dba6c9f | 2018-12-21 11:58:55 -0800 | [diff] [blame] | 594 | else if ( branch == "2.0" ) |
| 595 | return "master" |
You Wang | fe3877b | 2018-08-02 11:48:35 -0700 | [diff] [blame] | 596 | else |
| 597 | return "master" |
| 598 | } |
| 599 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 600 | return this |