blob: 798170902fb11f6e067bf3433b267b4e0b106c1e [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
155 <<: *inject-env-variable-plate
156 properties:
157
158 - build-discarder:
159 num-to-keep: 15
160
161 parameters:
162
163 - string:
164 name: 'DAYS_OLD'
165 default: '15'
166
167 - lf-infra-parameters:
168 project: '{project}'
169 branch: '{stream}'
170 stream: '{stream}'
171 lftools-version: '{lftools-version}'
172
173 node: 'TestStation-CHOs'
174
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800175 triggers:
176 - timed: '@daily'
Devin Lim49200ec2018-01-19 16:17:41 -0800177 builders:
178
Devin Limb00d26a2018-02-01 17:27:59 -0800179 - shell: !include-raw-escape: cho-clean-up.sh
Devin Lim18f459d2018-01-26 19:20:30 -0800180
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800181- job-template:
182 name: QA-check-style
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800183 description: |
184 <!-- Managed by Jenkins Job Builder -->
185 <h3>ONOS QA Code Style:</h3>
186 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 />
187 All .py files that are in the most recent patchset will be style checked.<br />
188 <br />
189 Jenkins User will give +1 if all files pass the style check, -1 if there is at least one style check failure.<br />
190 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 />
191 <br />
192 Click on the link in the Gerrit patchset comment to view the results of the style check.<br />
193 Alternatively, you can check the console output to view the files checked and style check raw output.<br />
194 <br />
195 You may also manually run this job by selecting "Build with Parameters", then providing the 5-digit change number from Gerrit.<br />
196 <br />
197 <h3>Important Notes:</h3>
198 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 />
199 Build numbers that are 1 build apart may NOT necessarily correspond to the same patchset!<br />
200 Manually running this job will NOT leave a comment after the most recent patchset in Gerrit.<br />
201 <br />
202 <h3>Style Check PEP8 Exclusions:</h3>
203 This job mainly follows PEP8 style check, but excludes many errors and warnings.<br />
204 The following errors and warnings are excluded from the PEP8 check portion of the job:
205 <ul>
206 <li>E251</li>
207 <li>E201</li>
208 <li>E302</li>
209 <li>E202</li>
210 <li>E126</li>
211 <li>E127</li>
212 <li>E203</li>
213 <li>E226</li>
214 <li>E501</li>
215 <li>W391</li>
216 </ul>
217 <h3>Credits:</h3>
218 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 />
219 The check style portion of the job is modeled from "HA-Jobs/codecheck_test"<br />
220 Created by Jeremy Ronquillo: jeremyr@opennetworking.org or j_ronquillo@u.pacific.edu<br />
221 <br />
222 Copyright (c) 2017 Open Networking Foundation (ONF)
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800223
224 <<: *test-free-job-boiler-plate
225 properties:
226
227 - build-discarder:
Devin Lim18f459d2018-01-26 19:20:30 -0800228 num-to-keep: 100
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800229
230 parameters:
231
232 - string:
Devin Lim18f459d2018-01-26 19:20:30 -0800233 name: 'GERRIT_CHANGE_NUMBER'
234 default: ''
235 description: '5-digit number that corresponds to the patch set change on Gerrit.'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800236
237 - lf-infra-parameters:
238 project: '{project}'
239 branch: '{stream}'
240 stream: '{stream}'
241 lftools-version: '{lftools-version}'
242
Devin Lim18f459d2018-01-26 19:20:30 -0800243 concurrent: true
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800244
Devin Lim18f459d2018-01-26 19:20:30 -0800245 node: 'TestStation-Jeremys'
246
Devin Lim323c9872018-01-30 19:57:58 -0800247 triggers:
248 - gerrit:
Devin Lim491d92b2018-02-09 10:41:45 -0800249 server-name: 'OnosSystemTest Project Gerrit'
Devin Lim323c9872018-01-30 19:57:58 -0800250 trigger-on:
251 - patchset-created-event:
252 exclude-drafts: false
253 exclude-trivial-rebase: false
254 exclude-no-code-change: false
255 - draft-published-event
256 - comment-added-contains-event:
257 comment-contains-value: '(?i)^.*recheck$'
258 projects:
259 - project-compare-type: PLAIN
260 project-pattern: '{project}'
261 branches:
262 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800263 branch-pattern: '**/master'
Devin Limb00d26a2018-02-01 17:27:59 -0800264 - branch-compare-type: ANT
Devin Lim491d92b2018-02-09 10:41:45 -0800265 branch-pattern: '**/onos-1.[11-20]'
Devin Lim323c9872018-01-30 19:57:58 -0800266 wrappers:
267 - lf-infra-wrappers:
268 build-timeout: 1800
269 jenkins-ssh-credential: '{jenkins-ssh-credential}'
270
Devin Lim18f459d2018-01-26 19:20:30 -0800271 builders:
Devin Lime65e71c2018-02-09 15:01:33 -0800272 - shell: !include-raw-escape: check-style.sh
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800273
Devin Limb00d26a2018-02-01 17:27:59 -0800274 publishers:
275 - warnings:
276 workspace-file-scanners:
277 - file-pattern: pep8Result.txt
278 scanner: Pep8
Devin Lime65e71c2018-02-09 15:01:33 -0800279 total-thresholds:
280 unstable:
281 total-all: 1
Devin Lim323c9872018-01-30 19:57:58 -0800282
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800283- job-template:
284 name: delta-nightly
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800285 description: |
286 <!-- Managed by Jenkins Job Builder -->
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800287
288 <<: *test-free-job-boiler-plate
289 properties:
290
291 - build-discarder:
292 num-to-keep: 30
293
294 parameters:
295
296 - string:
297 name: 'NIGHTLY_FILE_NAME'
298 default: ''
299 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800300 Name of ONOS nightly build file <br />
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800301 will be set to the latest file if not specified here
302
303 - string:
304 name: 'ONOS_VERSION'
305 default: '1.11.0'
306 description: 'Version number in ONOS nightly build file'
307
308 - string:
309 name: 'DELTA_PATH'
310 default: '/home/sdn'
311 description: 'Path of DELTA project'
312
313 - string:
314 name: 'WIKI_PREFIX'
315 default: 'master'
316
317 - bool:
318 name: 'CLEANUP'
319 default: true
320
321 - lf-infra-parameters:
322 project: '{project}'
323 branch: '{stream}'
324 stream: '{stream}'
325 lftools-version: '{lftools-version}'
326
327 node: 'TestStation-BMs'
328
329 wrappers:
330 - inject:
331 properties-file: '/var/jenkins/TestONOS.property'
332
333 builders:
334
335 - shell: !include-raw-escape: delta-script.sh
336
Devin Limb00d26a2018-02-01 17:27:59 -0800337 publishers:
338 - plot:
339 - title: 'DELTA Test Results for master'
340 group: 'DELTA-nightly'
341 yaxis: 'Number of test cases'
342 style: line
343 series:
344 - file: 'DELTA-nightly.csv'
345 format: 'csv'
346
347 # Todo : add confluence ( use pipeline for post build ..? )
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800348
Devin Lim18f459d2018-01-26 19:20:30 -0800349- job-template:
350 name: init-CHO
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800351 description: |
352 <!-- Managed by Jenkins Job Builder -->
353 1) Set a specific onos branch to test; <br />
354 2) pull and checkout the branch; <br />
355 3) build onos and package to tar.gz <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800356
357 <<: *test-free-job-boiler-plate
358 properties:
359
360 - build-discarder:
361 num-to-keep: 30
362
363 parameters:
364
365 - string:
366 name: 'ONOSBranch'
367 default: 'master'
368 description: |
Jeremy Ronquillo34e993b2018-02-07 10:43:15 -0800369 set onos branch to test. default to "master", <br />
370 but can also be set at "onos-1.2", etc. <br />
Devin Lim18f459d2018-01-26 19:20:30 -0800371 This parameter is also use to trigger where the test results to be posted
372
373 - string:
374 name: 'ONOSJVMHeap'
375 default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
376 description: 'onos cell jvm heap size setting'
377
378 - string:
379 name: 'TestONBranch'
380 default: 'master'
381 description: 'sets TestON branch'
382
383 - string:
384 name: 'ONOSTag'
385 default: ''
386
387 - lf-infra-parameters:
388 project: '{project}'
389 branch: '{stream}'
390 stream: '{stream}'
391 lftools-version: '{lftools-version}'
392
393 node: 'TestStation-CHOs'
394
395 wrappers:
396 - inject:
397 properties-file: '/var/lib/jenkins/TestONOS.property'
398 script-content: |
399 echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
400 echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
401 echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
402
403 override-build-parameters: true
404
405 builders:
406
407 - shell: !include-raw-escape: cho-init.sh
408
409- job-template:
410 name: running-CHO
411
412 <<: *test-free-job-boiler-plate
413 properties:
414
415 - build-discarder:
416 num-to-keep: 30
417
418 parameters:
419
420 - lf-infra-parameters:
421 project: '{project}'
422 branch: '{stream}'
423 stream: '{stream}'
424 lftools-version: '{lftools-version}'
425
426 node: 'TestStation-CHOs'
427 triggers:
428 - reverse:
429 jobs: 'init-CHO'
430 result: 'failure'
431
432 builders:
433
434 - shell: !include-raw-escape: running-cho.sh
435
436- job-template:
437 name: post-CHO-master
438
439 <<: *test-free-job-boiler-plate
440 properties:
441 - lf-infra-properties:
442 project: '{project}'
443 build-days-to-keep: 7
444
445 parameters:
446
447 - lf-infra-parameters:
448 project: '{project}'
449 branch: '{stream}'
450 stream: '{stream}'
451 lftools-version: '{lftools-version}'
452
453 node: 'TestStation-CHOs'
Devin Lim2b5ef2e2018-02-27 14:05:08 -0800454 triggers:
455 - timed: 'H/60 * * * *'
Devin Lim18f459d2018-01-26 19:20:30 -0800456 wrappers:
457 - inject:
458 properties-file: '/var/lib/jenkins/TestONOS.property'
459 builders:
460
461 - shell: !include-raw-escape: cho-post.sh
Devin Limb00d26a2018-02-01 17:27:59 -0800462 publishers:
463 - plot:
464 - title: 'Network, Application and ONOS Events (per hour)'
465 group: 'CHOTestMonkey'
466 num-builds: '72'
467 yaxis: 'Number of Events'
468 style: line
469 logarithmic-yaxis: true
470 series:
471 - file: 'event.csv'
472 format: 'csv'
473 - title: 'Failed Checks (per hour)'
474 group: 'CHOTestMonkey'
475 num-builds: '72'
476 yaxis: 'Number of Failed Checks'
477 style: line
478 logarithmic-yaxis: true
479 series:
480 - file: 'failure.csv'
481 format: 'csv'
482 - title: 'Warnings, Errors and Exceptions from Logs (per hour)'
483 group: 'CHOTestMonkey'
484 num-builds: '72'
485 yaxis: 'Number of Warnings or Errors'
486 style: line
487 logarithmic-yaxis: true
488 series:
489 - file: 'error.csv'
490 format: 'csv'
Devin Lim18f459d2018-01-26 19:20:30 -0800491
Devin Lim323c9872018-01-30 19:57:58 -0800492- job-template:
493 name: 'SR-log-{version}'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800494
Devin Lim323c9872018-01-30 19:57:58 -0800495 <<: *test-free-job-boiler-plate
496 properties:
497
498 - build-discarder:
Devin Lim1c4753e2018-03-23 15:31:38 -0700499 num-to-keep: 50
Devin Lim323c9872018-01-30 19:57:58 -0800500
501 parameters:
502
503 - lf-infra-parameters:
504 project: '{project}'
505 branch: '{stream}'
506 stream: '{stream}'
507 lftools-version: '{lftools-version}'
508
509 node: 'TestStation-VMs'
510 publishers:
511
512 - archive:
Devin Limb00d26a2018-02-01 17:27:59 -0800513 artifacts: '*'
514
515- job-template:
516 name: test-HA
517
518 <<: *test-free-job-boiler-plate
519 properties:
520
521 - build-discarder:
522
523 days-to-keep: 5
524 num-to-keep: 100
525
526 parameters:
527
528 - string:
529 name: 'TEST_NAME'
530 default: 'HAbackupRecover'
531 description: 'The name of the TestON test suite'
532
533 - lf-infra-parameters:
534 project: '{project}'
535 branch: '{stream}'
536 stream: '{stream}'
537 lftools-version: '{lftools-version}'
538
539 node: 'TestStation-Jons'
540 triggers:
541 - reverse:
542 jobs: 'test-HA'
543 result: 'failure'
544
545 builders:
546
547 - shell: !include-raw-escape: test-ha.sh
548
549 publishers:
550 - plot:
551 - title: 'Test job results'
552 group: 'Test-HA'
553 yaxis: 'Number of test cases'
554 style: line
555 series:
556 - file: 'results.csv'
557 format: 'csv'
558
559 - title: 'Timers'
560 group: 'Test-HA'
561 yaxis: 'Time in seconds'
562 style: line
563 series:
564 - file: 'Timers.csv'
565 format: 'csv'
566
567 - post-tasks:
568 - escalate-status: true
569 script: |
570 if [ -e ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt ] && ! grep -q "FAIL" ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt
571 then
572 exit 0
573 else
574 exit 1
575 fi
Devin Lim49200ec2018-01-19 16:17:41 -0800576
577- project:
578 name: post-result-jobs
579 project-name: post-result-jobs
580
581 <<: *test-free-init-procedure-plate
582 <<: *init-station-plate
583 jobs:
584 - 'postjob-{station-type}'
585
586- project:
587 name: cleanup-jobs
588 project-name: cleanup-jobs
589
590 <<: *test-free-init-procedure-plate
591 <<: *init-station-plate
592 jobs:
593 - 'test-station-log-cleanup-VM'
594 - 'test-station-log-cleanup-BM'
595 - 'test-station-log-cleanup-CHO'
Devin Lim9c8fa3e2018-01-24 16:47:15 -0800596
597- project:
598 name: check-style
599 project-name: check-style
600
601 <<: *test-free-init-procedure-plate
602 jobs:
603 - 'QA-check-style'
604
605- project:
606 name: delta-test
607 project-name: delta-test
608
609 <<: *test-free-init-procedure-plate
610 jobs:
611 - 'delta-nightly'
Devin Lim7d7cd992018-01-25 14:12:40 -0800612
Devin Lim18f459d2018-01-26 19:20:30 -0800613- project:
614 name: cho-tests
615 project-name: cho-tests
616
617 <<: *test-free-init-procedure-plate
618 jobs:
619 - 'init-CHO'
620 - 'running-CHO'
621 - 'post-CHO-master'
Devin Lim323c9872018-01-30 19:57:58 -0800622
623
624- project:
625 name: log-pipeline
626
627 <<: *job-free-version-plate
628
629 project-name: 'log-pipeline'
630
631 <<: *test-free-init-procedure-plate
632
633 jobs:
634 - 'SR-log-{version}'
Devin Limb00d26a2018-02-01 17:27:59 -0800635
636- project:
637 name: personnel-station
638
639 project-name: 'log-pipeline'
640
641 <<: *test-free-init-procedure-plate
642
643 jobs:
644 - 'test-HA'
Devin Lim157404d2018-02-09 16:44:19 -0800645