blob: 60d1213a395190a1ca364b1287a1b69ee12cc808 [file] [log] [blame]
Devin Lim49200ec2018-01-19 16:17:41 -08001---
2# ONOS System Test Pipeline jobs
3
Devin Lim49200ec2018-01-19 16:17:41 -08004
5- test-free-job-boiler-plate: &test-free-job-boiler-plate
6 name: test-free-job-boiler-plate
7
8 project-type: freestyle
9
10- init-station-plate: &init-station-plate
11 name: init-station-plate
12 station-type:
13 - 'VM'
14 - 'BM'
Devin Lim1c4753e2018-03-23 15:31:38 -070015 - 'Fabric'
Devin Lim49200ec2018-01-19 16:17:41 -080016
Devin Lim323c9872018-01-30 19:57:58 -080017- job-free-version-plate: &job-free-version-plate
18 name: job-free-version-plate
19 version:
20 - '1.11'
21 - '1.12'
22 - 'master'
23 - 'manually'
24
Devin Lim49200ec2018-01-19 16:17:41 -080025- test-free-init-procedure-plate: &test-free-init-procedure-plate
26 name: test-free-init-procedure-plate
27 project: OnosSystemTest
28 stream: 'master'
29
30- inject-env-variable-plate: &inject-env-variable-plate
31 name: inject-env-variable-plate
32 wrappers:
33 - inject:
34 properties-file: '/var/jenkins/TestONOS.property'
35 script-content: |
36 echo "ONOSBranch=$ONOSBranch" > /var/jenkins/TestONOS.property
37 echo "TestONBranch=$TestONBranch" >> /var/jenkins/TestONOS.property
38 echo "ONOSTag=$ONOSTag" >> /var/jenkins/TestONOS.property
39 echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property
40 override-build-parameters: true
41
42# post_Job
43- job-template:
44 name: postjob-{station-type}
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -080045 description: |
46 <!-- Managed by Jenkins Job Builder -->
47 Click on the "Last Successful Artifacts" to view all of the graphs (also accessible when logged out).<br />
48 <font color="red">Unless debugging, DO NOT MANUALLY BUILD THIS PIPELINE.</font><br />
49 <br />
50 Created by Devin Lim - devin@opennetworking.org<br />
51 Copyright (c) 2017 Open Networking Foundation (ONF)
Devin Lim49200ec2018-01-19 16:17:41 -080052
53 <<: *test-free-job-boiler-plate
54
55 properties:
56
57 - build-discarder:
58 num-to-keep: 1
59
60 parameters:
61
62 - lf-infra-parameters:
63 project: '{project}'
64 branch: '{stream}'
65 stream: '{stream}'
66 lftools-version: '{lftools-version}'
67
68 node: 'TestStation-{station-type}s'
69
70 publishers:
71
Devin Limb00d26a2018-02-01 17:27:59 -080072 - image-gallery:
73 - gallery-type: archived-images-gallery
74 title: 'Test result'
75 includes: '*.jpg'
Devin Lim49200ec2018-01-19 16:17:41 -080076
77 - archive:
78 artifacts: '*.jpg'
79
Devin Lim49200ec2018-01-19 16:17:41 -080080- job-template:
81 name: test-station-log-cleanup-VM
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -080082 description: |
83 <!-- Managed by Jenkins Job Builder -->
84 clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
Devin Lim49200ec2018-01-19 16:17:41 -080085
86 <<: *test-free-job-boiler-plate
87 <<: *inject-env-variable-plate
88 properties:
89
90 - build-discarder:
91 num-to-keep: 30
92
93 parameters:
94
95 - string:
96 name: 'DAYS_OLD'
97 default: '15'
98
99 - lf-infra-parameters:
100 project: '{project}'
101 branch: '{stream}'
102 stream: '{stream}'
103 lftools-version: '{lftools-version}'
104
105 node: 'TestStation-VMs'
106
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800107 triggers:
108 - timed: '01 08 1,15 * *'
Devin Lim49200ec2018-01-19 16:17:41 -0800109 builders:
110
Devin Limb00d26a2018-02-01 17:27:59 -0800111 - shell: !include-raw-escape: vm-bm-clean-up.sh
Devin Lim49200ec2018-01-19 16:17:41 -0800112
113- job-template:
114 name: test-station-log-cleanup-BM
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800115 description: |
116 <!-- Managed by Jenkins Job Builder -->
117 clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
Devin Lim49200ec2018-01-19 16:17:41 -0800118
119 <<: *test-free-job-boiler-plate
120 <<: *inject-env-variable-plate
121 properties:
122
123 - build-discarder:
124 num-to-keep: 30
125
126 parameters:
127
128 - string:
129 name: 'DAYS_OLD'
130 default: '30'
131
132 - lf-infra-parameters:
133 project: '{project}'
134 branch: '{stream}'
135 stream: '{stream}'
136 lftools-version: '{lftools-version}'
137
138 node: 'TestStation-BMs'
139
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800140 triggers:
141 - timed: '01 08 1 * *'
Devin Lim49200ec2018-01-19 16:17:41 -0800142
143 builders:
144
Devin Limb00d26a2018-02-01 17:27:59 -0800145 - shell: !include-raw-escape: vm-bm-clean-up.sh
Devin Lim49200ec2018-01-19 16:17:41 -0800146
147- job-template:
148 name: test-station-log-cleanup-CHO
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800149 description: |
150 <!-- Managed by Jenkins Job Builder -->
151
152
Devin Lim49200ec2018-01-19 16:17:41 -0800153
154 <<: *test-free-job-boiler-plate
Devin Limc284c982018-03-30 12:13:00 -0700155 wrappers:
156 - inject:
157 properties-file: '/var/lib/jenkins/TestONOS.property'
158 script-content: |
159 echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
160 echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
161 echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
162 echo "WikiPrefix=$WikiPrefix" >> /var/lib/jenkins/TestONOS.property
163 override-build-parameters: true
164
165 # post_Job
Devin Lim49200ec2018-01-19 16:17:41 -0800166 properties:
167
168 - build-discarder:
169 num-to-keep: 15
170
171 parameters:
172
173 - string:
174 name: 'DAYS_OLD'
175 default: '15'
176
177 - lf-infra-parameters:
178 project: '{project}'
179 branch: '{stream}'
180 stream: '{stream}'
181 lftools-version: '{lftools-version}'
182
183 node: 'TestStation-CHOs'
184
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800185 triggers:
186 - timed: '@daily'
Devin Lim49200ec2018-01-19 16:17:41 -0800187 builders:
188
Devin Limb00d26a2018-02-01 17:27:59 -0800189 - shell: !include-raw-escape: cho-clean-up.sh
Devin Lim18f459d2018-01-26 19:20:30 -0800190
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800191- job-template:
192 name: QA-check-style
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800193 description: |
194 <!-- Managed by Jenkins Job Builder -->
195 <h3>ONOS QA Code Style:</h3>
196 At Open Networking Foundation, we have adopted the <a href="https://github.com/mininet/mininet/wiki/Mininet-Python-Style">Mininet Python Style</a> for our drivers and testcases. The one exception is that TestON does not correctly parse multiline comments in testcases when the ending triple double quotes are on the same line as the comment. Therefore, in the testcases, the ending triple double quotes must be on it's own line.<br />
197 All .py files that are in the most recent patchset will be style checked.<br />
198 <br />
199 Jenkins User will give +1 if all files pass the style check, -1 if there is at least one style check failure.<br />
200 Jenkins will not comment on Gerrit if there are no .py files to test. This is caused by failing the job with exit code 2.<br />
201 <br />
202 Click on the link in the Gerrit patchset comment to view the results of the style check.<br />
203 Alternatively, you can check the console output to view the files checked and style check raw output.<br />
204 <br />
205 You may also manually run this job by selecting "Build with Parameters", then providing the 5-digit change number from Gerrit.<br />
206 <br />
207 <h3>Important Notes:</h3>
208 A build that is "Unstable" has failed the style check. A build with state "Error" means that there were no .py files to check.<br />
209 Build numbers that are 1 build apart may NOT necessarily correspond to the same patchset!<br />
210 Manually running this job will NOT leave a comment after the most recent patchset in Gerrit.<br />
211 <br />
212 <h3>Style Check PEP8 Exclusions:</h3>
213 This job mainly follows PEP8 style check, but excludes many errors and warnings.<br />
214 The following errors and warnings are excluded from the PEP8 check portion of the job:
215 <ul>
216 <li>E251</li>
217 <li>E201</li>
218 <li>E302</li>
219 <li>E202</li>
220 <li>E126</li>
221 <li>E127</li>
222 <li>E203</li>
223 <li>E226</li>
224 <li>E501</li>
225 <li>W391</li>
226 </ul>
227 <h3>Credits:</h3>
228 This job is modeled from <a href="https://jenkins.onosproject.org/view/all/job/onos-master-release-build-verify/">onos-master-release-build-verify</a><br />
229 The check style portion of the job is modeled from "HA-Jobs/codecheck_test"<br />
230 Created by Jeremy Ronquillo: jeremyr@opennetworking.org or j_ronquillo@u.pacific.edu<br />
231 <br />
232 Copyright (c) 2017 Open Networking Foundation (ONF)
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800233
234 <<: *test-free-job-boiler-plate
235 properties:
236
237 - build-discarder:
Devin Lim18f459d2018-01-26 19:20:30 -0800238 num-to-keep: 100
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800239
240 parameters:
241
242 - string:
Devin Lim18f459d2018-01-26 19:20:30 -0800243 name: 'GERRIT_CHANGE_NUMBER'
244 default: ''
245 description: '5-digit number that corresponds to the patch set change on Gerrit.'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800246
247 - lf-infra-parameters:
248 project: '{project}'
249 branch: '{stream}'
250 stream: '{stream}'
251 lftools-version: '{lftools-version}'
252
Devin Lim18f459d2018-01-26 19:20:30 -0800253 concurrent: true
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800254
Devin Lim18f459d2018-01-26 19:20:30 -0800255 node: 'TestStation-Jeremys'
256
Devin Lim323c9872018-01-30 19:57:58 -0800257 triggers:
258 - gerrit:
Devin Lim491d92b2018-02-09 10:41:45 -0800259 server-name: 'OnosSystemTest Project Gerrit'
Devin Lim323c9872018-01-30 19:57:58 -0800260 trigger-on:
261 - patchset-created-event:
262 exclude-drafts: false
263 exclude-trivial-rebase: false
264 exclude-no-code-change: false
265 - draft-published-event
266 - comment-added-contains-event:
267 comment-contains-value: '(?i)^.*recheck$'
268 projects:
269 - project-compare-type: PLAIN
270 project-pattern: '{project}'
271 branches:
272 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800273 branch-pattern: '**/master'
Devin Limb00d26a2018-02-01 17:27:59 -0800274 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800275 branch-pattern: '**/onos-1.[11-20]'
Devin Lim323c9872018-01-30 19:57:58 -0800276 wrappers:
277 - lf-infra-wrappers:
278 build-timeout: 1800
279 jenkins-ssh-credential: '{jenkins-ssh-credential}'
280
Devin Lim18f459d2018-01-26 19:20:30 -0800281 builders:
Devin Lime65e71c2018-02-09 15:01:33 -0800282 - shell: !include-raw-escape: check-style.sh
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800283
Devin Limb00d26a2018-02-01 17:27:59 -0800284 publishers:
285 - warnings:
286 workspace-file-scanners:
287 - file-pattern: pep8Result.txt
288 scanner: Pep8
Devin Lime65e71c2018-02-09 15:01:33 -0800289 total-thresholds:
290 unstable:
291 total-all: 1
Devin Lim323c9872018-01-30 19:57:58 -0800292
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800293- job-template:
294 name: delta-nightly
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800295 description: |
296 <!-- Managed by Jenkins Job Builder -->
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800297
298 <<: *test-free-job-boiler-plate
299 properties:
300
301 - build-discarder:
302 num-to-keep: 30
303
304 parameters:
305
306 - string:
307 name: 'NIGHTLY_FILE_NAME'
308 default: ''
309 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800310 Name of ONOS nightly build file <br />
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800311 will be set to the latest file if not specified here
312
313 - string:
314 name: 'ONOS_VERSION'
315 default: '1.11.0'
316 description: 'Version number in ONOS nightly build file'
317
318 - string:
319 name: 'DELTA_PATH'
320 default: '/home/sdn'
321 description: 'Path of DELTA project'
322
323 - string:
324 name: 'WIKI_PREFIX'
325 default: 'master'
326
327 - bool:
328 name: 'CLEANUP'
329 default: true
330
331 - lf-infra-parameters:
332 project: '{project}'
333 branch: '{stream}'
334 stream: '{stream}'
335 lftools-version: '{lftools-version}'
336
337 node: 'TestStation-BMs'
338
339 wrappers:
340 - inject:
341 properties-file: '/var/jenkins/TestONOS.property'
342
343 builders:
344
345 - shell: !include-raw-escape: delta-script.sh
346
Devin Limb00d26a2018-02-01 17:27:59 -0800347 publishers:
348 - plot:
349 - title: 'DELTA Test Results for master'
350 group: 'DELTA-nightly'
351 yaxis: 'Number of test cases'
352 style: line
353 series:
354 - file: 'DELTA-nightly.csv'
355 format: 'csv'
356
357 # Todo : add confluence ( use pipeline for post build ..? )
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800358
Devin Lim18f459d2018-01-26 19:20:30 -0800359- job-template:
360 name: init-CHO
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800361 description: |
362 <!-- Managed by Jenkins Job Builder -->
363 1) Set a specific onos branch to test; <br />
364 2) pull and checkout the branch; <br />
365 3) build onos and package to tar.gz <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800366
367 <<: *test-free-job-boiler-plate
368 properties:
369
370 - build-discarder:
371 num-to-keep: 30
372
373 parameters:
374
375 - string:
376 name: 'ONOSBranch'
377 default: 'master'
378 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800379 set onos branch to test. default to "master", <br />
380 but can also be set at "onos-1.2", etc. <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800381 This parameter is also use to trigger where the test results to be posted
382
383 - string:
384 name: 'ONOSJVMHeap'
385 default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
386 description: 'onos cell jvm heap size setting'
387
388 - string:
389 name: 'TestONBranch'
390 default: 'master'
391 description: 'sets TestON branch'
392
393 - string:
394 name: 'ONOSTag'
395 default: ''
396
397 - lf-infra-parameters:
398 project: '{project}'
399 branch: '{stream}'
400 stream: '{stream}'
401 lftools-version: '{lftools-version}'
402
403 node: 'TestStation-CHOs'
404
405 wrappers:
406 - inject:
407 properties-file: '/var/lib/jenkins/TestONOS.property'
408 script-content: |
409 echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
410 echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
411 echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
412
413 override-build-parameters: true
414
415 builders:
416
417 - shell: !include-raw-escape: cho-init.sh
418
419- job-template:
420 name: running-CHO
421
422 <<: *test-free-job-boiler-plate
423 properties:
424
425 - build-discarder:
426 num-to-keep: 30
427
428 parameters:
429
430 - lf-infra-parameters:
431 project: '{project}'
432 branch: '{stream}'
433 stream: '{stream}'
434 lftools-version: '{lftools-version}'
435
436 node: 'TestStation-CHOs'
437 triggers:
438 - reverse:
439 jobs: 'init-CHO'
440 result: 'failure'
441
442 builders:
443
444 - shell: !include-raw-escape: running-cho.sh
445
446- job-template:
447 name: post-CHO-master
448
449 <<: *test-free-job-boiler-plate
450 properties:
451 - lf-infra-properties:
452 project: '{project}'
453 build-days-to-keep: 7
454
455 parameters:
456
457 - lf-infra-parameters:
458 project: '{project}'
459 branch: '{stream}'
460 stream: '{stream}'
461 lftools-version: '{lftools-version}'
462
463 node: 'TestStation-CHOs'
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800464 triggers:
465 - timed: 'H/60 * * * *'
Devin Lim18f459d2018-01-26 19:20:30 -0800466 wrappers:
467 - inject:
468 properties-file: '/var/lib/jenkins/TestONOS.property'
469 builders:
470
471 - shell: !include-raw-escape: cho-post.sh
Devin Limb00d26a2018-02-01 17:27:59 -0800472 publishers:
473 - plot:
474 - title: 'Network, Application and ONOS Events (per hour)'
475 group: 'CHOTestMonkey'
476 num-builds: '72'
477 yaxis: 'Number of Events'
478 style: line
479 logarithmic-yaxis: true
480 series:
481 - file: 'event.csv'
482 format: 'csv'
483 - title: 'Failed Checks (per hour)'
484 group: 'CHOTestMonkey'
485 num-builds: '72'
486 yaxis: 'Number of Failed Checks'
487 style: line
488 logarithmic-yaxis: true
489 series:
490 - file: 'failure.csv'
491 format: 'csv'
492 - title: 'Warnings, Errors and Exceptions from Logs (per hour)'
493 group: 'CHOTestMonkey'
494 num-builds: '72'
495 yaxis: 'Number of Warnings or Errors'
496 style: line
497 logarithmic-yaxis: true
498 series:
499 - file: 'error.csv'
500 format: 'csv'
Devin Lim18f459d2018-01-26 19:20:30 -0800501
Devin Lim323c9872018-01-30 19:57:58 -0800502- job-template:
503 name: 'SR-log-{version}'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800504
Devin Lim323c9872018-01-30 19:57:58 -0800505 <<: *test-free-job-boiler-plate
506 properties:
507
508 - build-discarder:
Devin Lim1c4753e2018-03-23 15:31:38 -0700509 num-to-keep: 50
Devin Lim323c9872018-01-30 19:57:58 -0800510
511 parameters:
512
513 - lf-infra-parameters:
514 project: '{project}'
515 branch: '{stream}'
516 stream: '{stream}'
517 lftools-version: '{lftools-version}'
518
Devin Limdc298c92018-03-24 13:47:08 -0700519 node: 'TestStation-Fabrics'
Devin Lim323c9872018-01-30 19:57:58 -0800520 publishers:
521
522 - archive:
Devin Limb00d26a2018-02-01 17:27:59 -0800523 artifacts: '*'
524
525- job-template:
526 name: test-HA
527
528 <<: *test-free-job-boiler-plate
529 properties:
530
531 - build-discarder:
532
533 days-to-keep: 5
534 num-to-keep: 100
535
536 parameters:
537
538 - string:
539 name: 'TEST_NAME'
540 default: 'HAbackupRecover'
541 description: 'The name of the TestON test suite'
542
543 - lf-infra-parameters:
544 project: '{project}'
545 branch: '{stream}'
546 stream: '{stream}'
547 lftools-version: '{lftools-version}'
548
549 node: 'TestStation-Jons'
550 triggers:
551 - reverse:
552 jobs: 'test-HA'
553 result: 'failure'
554
555 builders:
556
557 - shell: !include-raw-escape: test-ha.sh
558
559 publishers:
560 - plot:
561 - title: 'Test job results'
562 group: 'Test-HA'
563 yaxis: 'Number of test cases'
564 style: line
565 series:
566 - file: 'results.csv'
567 format: 'csv'
568
569 - title: 'Timers'
570 group: 'Test-HA'
571 yaxis: 'Time in seconds'
572 style: line
573 series:
574 - file: 'Timers.csv'
575 format: 'csv'
576
577 - post-tasks:
578 - escalate-status: true
579 script: |
580 if [ -e ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt ] && ! grep -q "FAIL" ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt
581 then
582 exit 0
583 else
584 exit 1
585 fi
Devin Lim49200ec2018-01-19 16:17:41 -0800586
587- project:
588 name: post-result-jobs
589 project-name: post-result-jobs
590
591 <<: *test-free-init-procedure-plate
592 <<: *init-station-plate
593 jobs:
594 - 'postjob-{station-type}'
595
596- project:
597 name: cleanup-jobs
598 project-name: cleanup-jobs
599
600 <<: *test-free-init-procedure-plate
601 <<: *init-station-plate
602 jobs:
603 - 'test-station-log-cleanup-VM'
604 - 'test-station-log-cleanup-BM'
605 - 'test-station-log-cleanup-CHO'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800606
607- project:
608 name: check-style
609 project-name: check-style
610
611 <<: *test-free-init-procedure-plate
612 jobs:
613 - 'QA-check-style'
614
615- project:
616 name: delta-test
617 project-name: delta-test
618
619 <<: *test-free-init-procedure-plate
620 jobs:
621 - 'delta-nightly'
Devin Lim7d7cd992018-01-25 14:12:40 -0800622
Devin Lim18f459d2018-01-26 19:20:30 -0800623- project:
624 name: cho-tests
625 project-name: cho-tests
626
627 <<: *test-free-init-procedure-plate
628 jobs:
629 - 'init-CHO'
630 - 'running-CHO'
631 - 'post-CHO-master'
Devin Lim323c9872018-01-30 19:57:58 -0800632
633
634- project:
635 name: log-pipeline
636
637 <<: *job-free-version-plate
638
639 project-name: 'log-pipeline'
640
641 <<: *test-free-init-procedure-plate
642
643 jobs:
644 - 'SR-log-{version}'
Devin Limb00d26a2018-02-01 17:27:59 -0800645
646- project:
647 name: personnel-station
648
649 project-name: 'log-pipeline'
650
651 <<: *test-free-init-procedure-plate
652
653 jobs:
654 - 'test-HA'
Devin Lim157404d2018-02-09 16:44:19 -0800655