blob: 26391aad98981f715cffa8b746e79c3e12779060 [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'
15
Devin Lim323c9872018-01-30 19:57:58 -080016- job-free-version-plate: &job-free-version-plate
17 name: job-free-version-plate
18 version:
19 - '1.11'
20 - '1.12'
21 - 'master'
22 - 'manually'
23
Devin Lim49200ec2018-01-19 16:17:41 -080024- test-free-init-procedure-plate: &test-free-init-procedure-plate
25 name: test-free-init-procedure-plate
26 project: OnosSystemTest
27 stream: 'master'
28
29- inject-env-variable-plate: &inject-env-variable-plate
30 name: inject-env-variable-plate
31 wrappers:
32 - inject:
33 properties-file: '/var/jenkins/TestONOS.property'
34 script-content: |
35 echo "ONOSBranch=$ONOSBranch" > /var/jenkins/TestONOS.property
36 echo "TestONBranch=$TestONBranch" >> /var/jenkins/TestONOS.property
37 echo "ONOSTag=$ONOSTag" >> /var/jenkins/TestONOS.property
38 echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property
39 override-build-parameters: true
40
41# post_Job
42- job-template:
43 name: postjob-{station-type}
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -080044 description: |
45 <!-- Managed by Jenkins Job Builder -->
46 Click on the "Last Successful Artifacts" to view all of the graphs (also accessible when logged out).<br />
47 <font color="red">Unless debugging, DO NOT MANUALLY BUILD THIS PIPELINE.</font><br />
48 <br />
49 Created by Devin Lim - devin@opennetworking.org<br />
50 Copyright (c) 2017 Open Networking Foundation (ONF)
Devin Lim49200ec2018-01-19 16:17:41 -080051
52 <<: *test-free-job-boiler-plate
53
54 properties:
55
56 - build-discarder:
57 num-to-keep: 1
58
59 parameters:
60
61 - lf-infra-parameters:
62 project: '{project}'
63 branch: '{stream}'
64 stream: '{stream}'
65 lftools-version: '{lftools-version}'
66
67 node: 'TestStation-{station-type}s'
68
69 publishers:
70
Devin Limb00d26a2018-02-01 17:27:59 -080071 - image-gallery:
72 - gallery-type: archived-images-gallery
73 title: 'Test result'
74 includes: '*.jpg'
Devin Lim49200ec2018-01-19 16:17:41 -080075
76 - archive:
77 artifacts: '*.jpg'
78
Devin Lim49200ec2018-01-19 16:17:41 -080079- job-template:
80 name: test-station-log-cleanup-VM
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -080081 description: |
82 <!-- Managed by Jenkins Job Builder -->
83 clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
Devin Lim49200ec2018-01-19 16:17:41 -080084
85 <<: *test-free-job-boiler-plate
86 <<: *inject-env-variable-plate
87 properties:
88
89 - build-discarder:
90 num-to-keep: 30
91
92 parameters:
93
94 - string:
95 name: 'DAYS_OLD'
96 default: '15'
97
98 - lf-infra-parameters:
99 project: '{project}'
100 branch: '{stream}'
101 stream: '{stream}'
102 lftools-version: '{lftools-version}'
103
104 node: 'TestStation-VMs'
105
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800106 triggers:
107 - timed: '01 08 1,15 * *'
Devin Lim49200ec2018-01-19 16:17:41 -0800108 builders:
109
Devin Limb00d26a2018-02-01 17:27:59 -0800110 - shell: !include-raw-escape: vm-bm-clean-up.sh
Devin Lim49200ec2018-01-19 16:17:41 -0800111
112- job-template:
113 name: test-station-log-cleanup-BM
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800114 description: |
115 <!-- Managed by Jenkins Job Builder -->
116 clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
Devin Lim49200ec2018-01-19 16:17:41 -0800117
118 <<: *test-free-job-boiler-plate
119 <<: *inject-env-variable-plate
120 properties:
121
122 - build-discarder:
123 num-to-keep: 30
124
125 parameters:
126
127 - string:
128 name: 'DAYS_OLD'
129 default: '30'
130
131 - lf-infra-parameters:
132 project: '{project}'
133 branch: '{stream}'
134 stream: '{stream}'
135 lftools-version: '{lftools-version}'
136
137 node: 'TestStation-BMs'
138
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800139 triggers:
140 - timed: '01 08 1 * *'
Devin Lim49200ec2018-01-19 16:17:41 -0800141
142 builders:
143
Devin Limb00d26a2018-02-01 17:27:59 -0800144 - shell: !include-raw-escape: vm-bm-clean-up.sh
Devin Lim49200ec2018-01-19 16:17:41 -0800145
146- job-template:
147 name: test-station-log-cleanup-CHO
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800148 description: |
149 <!-- Managed by Jenkins Job Builder -->
150
151
Devin Lim49200ec2018-01-19 16:17:41 -0800152
153 <<: *test-free-job-boiler-plate
154 <<: *inject-env-variable-plate
155 properties:
156
157 - build-discarder:
158 num-to-keep: 15
159
160 parameters:
161
162 - string:
163 name: 'DAYS_OLD'
164 default: '15'
165
166 - lf-infra-parameters:
167 project: '{project}'
168 branch: '{stream}'
169 stream: '{stream}'
170 lftools-version: '{lftools-version}'
171
172 node: 'TestStation-CHOs'
173
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800174 triggers:
175 - timed: '@daily'
Devin Lim49200ec2018-01-19 16:17:41 -0800176 builders:
177
Devin Limb00d26a2018-02-01 17:27:59 -0800178 - shell: !include-raw-escape: cho-clean-up.sh
Devin Lim18f459d2018-01-26 19:20:30 -0800179
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800180- job-template:
181 name: QA-check-style
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800182 description: |
183 <!-- Managed by Jenkins Job Builder -->
184 <h3>ONOS QA Code Style:</h3>
185 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 />
186 All .py files that are in the most recent patchset will be style checked.<br />
187 <br />
188 Jenkins User will give +1 if all files pass the style check, -1 if there is at least one style check failure.<br />
189 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 />
190 <br />
191 Click on the link in the Gerrit patchset comment to view the results of the style check.<br />
192 Alternatively, you can check the console output to view the files checked and style check raw output.<br />
193 <br />
194 You may also manually run this job by selecting "Build with Parameters", then providing the 5-digit change number from Gerrit.<br />
195 <br />
196 <h3>Important Notes:</h3>
197 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 />
198 Build numbers that are 1 build apart may NOT necessarily correspond to the same patchset!<br />
199 Manually running this job will NOT leave a comment after the most recent patchset in Gerrit.<br />
200 <br />
201 <h3>Style Check PEP8 Exclusions:</h3>
202 This job mainly follows PEP8 style check, but excludes many errors and warnings.<br />
203 The following errors and warnings are excluded from the PEP8 check portion of the job:
204 <ul>
205 <li>E251</li>
206 <li>E201</li>
207 <li>E302</li>
208 <li>E202</li>
209 <li>E126</li>
210 <li>E127</li>
211 <li>E203</li>
212 <li>E226</li>
213 <li>E501</li>
214 <li>W391</li>
215 </ul>
216 <h3>Credits:</h3>
217 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 />
218 The check style portion of the job is modeled from "HA-Jobs/codecheck_test"<br />
219 Created by Jeremy Ronquillo: jeremyr@opennetworking.org or j_ronquillo@u.pacific.edu<br />
220 <br />
221 Copyright (c) 2017 Open Networking Foundation (ONF)
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800222
223 <<: *test-free-job-boiler-plate
224 properties:
225
226 - build-discarder:
Devin Lim18f459d2018-01-26 19:20:30 -0800227 num-to-keep: 100
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800228
229 parameters:
230
231 - string:
Devin Lim18f459d2018-01-26 19:20:30 -0800232 name: 'GERRIT_CHANGE_NUMBER'
233 default: ''
234 description: '5-digit number that corresponds to the patch set change on Gerrit.'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800235
236 - lf-infra-parameters:
237 project: '{project}'
238 branch: '{stream}'
239 stream: '{stream}'
240 lftools-version: '{lftools-version}'
241
Devin Lim18f459d2018-01-26 19:20:30 -0800242 concurrent: true
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800243
Devin Lim18f459d2018-01-26 19:20:30 -0800244 node: 'TestStation-Jeremys'
245
Devin Lim323c9872018-01-30 19:57:58 -0800246 triggers:
247 - gerrit:
Devin Lim491d92b2018-02-09 10:41:45 -0800248 server-name: 'OnosSystemTest Project Gerrit'
Devin Lim323c9872018-01-30 19:57:58 -0800249 trigger-on:
250 - patchset-created-event:
251 exclude-drafts: false
252 exclude-trivial-rebase: false
253 exclude-no-code-change: false
254 - draft-published-event
255 - comment-added-contains-event:
256 comment-contains-value: '(?i)^.*recheck$'
257 projects:
258 - project-compare-type: PLAIN
259 project-pattern: '{project}'
260 branches:
261 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800262 branch-pattern: '**/master'
Devin Limb00d26a2018-02-01 17:27:59 -0800263 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800264 branch-pattern: '**/onos-1.[11-20]'
Devin Lim323c9872018-01-30 19:57:58 -0800265 wrappers:
266 - lf-infra-wrappers:
267 build-timeout: 1800
268 jenkins-ssh-credential: '{jenkins-ssh-credential}'
269
Devin Lim18f459d2018-01-26 19:20:30 -0800270 builders:
Devin Lime65e71c2018-02-09 15:01:33 -0800271 - shell: !include-raw-escape: check-style.sh
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800272
Devin Limb00d26a2018-02-01 17:27:59 -0800273 publishers:
274 - warnings:
275 workspace-file-scanners:
276 - file-pattern: pep8Result.txt
277 scanner: Pep8
Devin Lime65e71c2018-02-09 15:01:33 -0800278 total-thresholds:
279 unstable:
280 total-all: 1
Devin Lim323c9872018-01-30 19:57:58 -0800281
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800282- job-template:
283 name: delta-nightly
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800284 description: |
285 <!-- Managed by Jenkins Job Builder -->
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800286
287 <<: *test-free-job-boiler-plate
288 properties:
289
290 - build-discarder:
291 num-to-keep: 30
292
293 parameters:
294
295 - string:
296 name: 'NIGHTLY_FILE_NAME'
297 default: ''
298 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800299 Name of ONOS nightly build file <br />
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800300 will be set to the latest file if not specified here
301
302 - string:
303 name: 'ONOS_VERSION'
304 default: '1.11.0'
305 description: 'Version number in ONOS nightly build file'
306
307 - string:
308 name: 'DELTA_PATH'
309 default: '/home/sdn'
310 description: 'Path of DELTA project'
311
312 - string:
313 name: 'WIKI_PREFIX'
314 default: 'master'
315
316 - bool:
317 name: 'CLEANUP'
318 default: true
319
320 - lf-infra-parameters:
321 project: '{project}'
322 branch: '{stream}'
323 stream: '{stream}'
324 lftools-version: '{lftools-version}'
325
326 node: 'TestStation-BMs'
327
328 wrappers:
329 - inject:
330 properties-file: '/var/jenkins/TestONOS.property'
331
332 builders:
333
334 - shell: !include-raw-escape: delta-script.sh
335
Devin Limb00d26a2018-02-01 17:27:59 -0800336 publishers:
337 - plot:
338 - title: 'DELTA Test Results for master'
339 group: 'DELTA-nightly'
340 yaxis: 'Number of test cases'
341 style: line
342 series:
343 - file: 'DELTA-nightly.csv'
344 format: 'csv'
345
346 # Todo : add confluence ( use pipeline for post build ..? )
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800347
Devin Lim18f459d2018-01-26 19:20:30 -0800348- job-template:
349 name: init-CHO
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800350 description: |
351 <!-- Managed by Jenkins Job Builder -->
352 1) Set a specific onos branch to test; <br />
353 2) pull and checkout the branch; <br />
354 3) build onos and package to tar.gz <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800355
356 <<: *test-free-job-boiler-plate
357 properties:
358
359 - build-discarder:
360 num-to-keep: 30
361
362 parameters:
363
364 - string:
365 name: 'ONOSBranch'
366 default: 'master'
367 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800368 set onos branch to test. default to "master", <br />
369 but can also be set at "onos-1.2", etc. <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800370 This parameter is also use to trigger where the test results to be posted
371
372 - string:
373 name: 'ONOSJVMHeap'
374 default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
375 description: 'onos cell jvm heap size setting'
376
377 - string:
378 name: 'TestONBranch'
379 default: 'master'
380 description: 'sets TestON branch'
381
382 - string:
383 name: 'ONOSTag'
384 default: ''
385
386 - lf-infra-parameters:
387 project: '{project}'
388 branch: '{stream}'
389 stream: '{stream}'
390 lftools-version: '{lftools-version}'
391
392 node: 'TestStation-CHOs'
393
394 wrappers:
395 - inject:
396 properties-file: '/var/lib/jenkins/TestONOS.property'
397 script-content: |
398 echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
399 echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
400 echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
401
402 override-build-parameters: true
403
404 builders:
405
406 - shell: !include-raw-escape: cho-init.sh
407
408- job-template:
409 name: running-CHO
410
411 <<: *test-free-job-boiler-plate
412 properties:
413
414 - build-discarder:
415 num-to-keep: 30
416
417 parameters:
418
419 - lf-infra-parameters:
420 project: '{project}'
421 branch: '{stream}'
422 stream: '{stream}'
423 lftools-version: '{lftools-version}'
424
425 node: 'TestStation-CHOs'
426 triggers:
427 - reverse:
428 jobs: 'init-CHO'
429 result: 'failure'
430
431 builders:
432
433 - shell: !include-raw-escape: running-cho.sh
434
435- job-template:
436 name: post-CHO-master
437
438 <<: *test-free-job-boiler-plate
439 properties:
440 - lf-infra-properties:
441 project: '{project}'
442 build-days-to-keep: 7
443
444 parameters:
445
446 - lf-infra-parameters:
447 project: '{project}'
448 branch: '{stream}'
449 stream: '{stream}'
450 lftools-version: '{lftools-version}'
451
452 node: 'TestStation-CHOs'
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800453 triggers:
454 - timed: 'H/60 * * * *'
Devin Lim18f459d2018-01-26 19:20:30 -0800455 wrappers:
456 - inject:
457 properties-file: '/var/lib/jenkins/TestONOS.property'
458 builders:
459
460 - shell: !include-raw-escape: cho-post.sh
Devin Limb00d26a2018-02-01 17:27:59 -0800461 publishers:
462 - plot:
463 - title: 'Network, Application and ONOS Events (per hour)'
464 group: 'CHOTestMonkey'
465 num-builds: '72'
466 yaxis: 'Number of Events'
467 style: line
468 logarithmic-yaxis: true
469 series:
470 - file: 'event.csv'
471 format: 'csv'
472 - title: 'Failed Checks (per hour)'
473 group: 'CHOTestMonkey'
474 num-builds: '72'
475 yaxis: 'Number of Failed Checks'
476 style: line
477 logarithmic-yaxis: true
478 series:
479 - file: 'failure.csv'
480 format: 'csv'
481 - title: 'Warnings, Errors and Exceptions from Logs (per hour)'
482 group: 'CHOTestMonkey'
483 num-builds: '72'
484 yaxis: 'Number of Warnings or Errors'
485 style: line
486 logarithmic-yaxis: true
487 series:
488 - file: 'error.csv'
489 format: 'csv'
Devin Lim18f459d2018-01-26 19:20:30 -0800490
Devin Lim323c9872018-01-30 19:57:58 -0800491- job-template:
492 name: 'SR-log-{version}'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800493
Devin Lim323c9872018-01-30 19:57:58 -0800494 <<: *test-free-job-boiler-plate
495 properties:
496
497 - build-discarder:
498 num-to-keep: 30
499
500 parameters:
501
502 - lf-infra-parameters:
503 project: '{project}'
504 branch: '{stream}'
505 stream: '{stream}'
506 lftools-version: '{lftools-version}'
507
508 node: 'TestStation-VMs'
509 publishers:
510
511 - archive:
Devin Limb00d26a2018-02-01 17:27:59 -0800512 artifacts: '*'
513
514- job-template:
515 name: test-HA
516
517 <<: *test-free-job-boiler-plate
518 properties:
519
520 - build-discarder:
521
522 days-to-keep: 5
523 num-to-keep: 100
524
525 parameters:
526
527 - string:
528 name: 'TEST_NAME'
529 default: 'HAbackupRecover'
530 description: 'The name of the TestON test suite'
531
532 - lf-infra-parameters:
533 project: '{project}'
534 branch: '{stream}'
535 stream: '{stream}'
536 lftools-version: '{lftools-version}'
537
538 node: 'TestStation-Jons'
539 triggers:
540 - reverse:
541 jobs: 'test-HA'
542 result: 'failure'
543
544 builders:
545
546 - shell: !include-raw-escape: test-ha.sh
547
548 publishers:
549 - plot:
550 - title: 'Test job results'
551 group: 'Test-HA'
552 yaxis: 'Number of test cases'
553 style: line
554 series:
555 - file: 'results.csv'
556 format: 'csv'
557
558 - title: 'Timers'
559 group: 'Test-HA'
560 yaxis: 'Time in seconds'
561 style: line
562 series:
563 - file: 'Timers.csv'
564 format: 'csv'
565
566 - post-tasks:
567 - escalate-status: true
568 script: |
569 if [ -e ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt ] && ! grep -q "FAIL" ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt
570 then
571 exit 0
572 else
573 exit 1
574 fi
Devin Lim49200ec2018-01-19 16:17:41 -0800575
576- project:
577 name: post-result-jobs
578 project-name: post-result-jobs
579
580 <<: *test-free-init-procedure-plate
581 <<: *init-station-plate
582 jobs:
583 - 'postjob-{station-type}'
584
585- project:
586 name: cleanup-jobs
587 project-name: cleanup-jobs
588
589 <<: *test-free-init-procedure-plate
590 <<: *init-station-plate
591 jobs:
592 - 'test-station-log-cleanup-VM'
593 - 'test-station-log-cleanup-BM'
594 - 'test-station-log-cleanup-CHO'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800595
596- project:
597 name: check-style
598 project-name: check-style
599
600 <<: *test-free-init-procedure-plate
601 jobs:
602 - 'QA-check-style'
603
604- project:
605 name: delta-test
606 project-name: delta-test
607
608 <<: *test-free-init-procedure-plate
609 jobs:
610 - 'delta-nightly'
Devin Lim7d7cd992018-01-25 14:12:40 -0800611
Devin Lim18f459d2018-01-26 19:20:30 -0800612- project:
613 name: cho-tests
614 project-name: cho-tests
615
616 <<: *test-free-init-procedure-plate
617 jobs:
618 - 'init-CHO'
619 - 'running-CHO'
620 - 'post-CHO-master'
Devin Lim323c9872018-01-30 19:57:58 -0800621
622
623- project:
624 name: log-pipeline
625
626 <<: *job-free-version-plate
627
628 project-name: 'log-pipeline'
629
630 <<: *test-free-init-procedure-plate
631
632 jobs:
633 - 'SR-log-{version}'
Devin Limb00d26a2018-02-01 17:27:59 -0800634
635- project:
636 name: personnel-station
637
638 project-name: 'log-pipeline'
639
640 <<: *test-free-init-procedure-plate
641
642 jobs:
643 - 'test-HA'
Devin Lim157404d2018-02-09 16:44:19 -0800644