blob: a9f54412e20e280e024f865f92005fc117a4f7cc [file] [log] [blame]
---
# ONOS System Test Pipeline jobs
- test-free-job-boiler-plate: &test-free-job-boiler-plate
name: test-free-job-boiler-plate
project-type: freestyle
- init-station-plate: &init-station-plate
name: init-station-plate
station-type:
- 'VM'
- 'BM'
- 'Fabric'
- 'Fabric2'
- 'Fabric3'
- init-station-plate-clean: &init-station-plate-clean
name: init-station-plate-clean
clean-station-type:
- 'BM'
- 'Fabric'
- 'Fabric2'
- 'Fabric3'
- 'Fabric4'
- 'Fabric5'
- job-free-version-plate: &job-free-version-plate
name: job-free-version-plate
version:
- '1.11'
- '1.12'
- '1.13'
- 'master'
- 'manually'
- test-free-init-procedure-plate: &test-free-init-procedure-plate
name: test-free-init-procedure-plate
project: OnosSystemTest
stream: 'master'
- inject-env-variable-plate: &inject-env-variable-plate
name: inject-env-variable-plate
wrappers:
- inject:
properties-file: '/var/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/jenkins/TestONOS.property
echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property
override-build-parameters: true
# post_Job
- job-template:
name: postjob-{station-type}
description: |
<!-- Managed by Jenkins Job Builder -->
Click on the "Last Successful Artifacts" to view all of the graphs (also accessible when logged out).<br />
<font color="red">Unless debugging, DO NOT MANUALLY BUILD THIS PIPELINE.</font><br />
<br />
Created by Devin Lim - devin@opennetworking.org<br />
Copyright (c) 2017 Open Networking Foundation (ONF)
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 1
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-{station-type}s'
publishers:
- image-gallery:
- gallery-type: archived-images-gallery
title: 'Test result'
includes: '*.jpg'
- archive:
artifacts: '*.jpg'
- job-template:
name: test-station-log-cleanup-VM
description: |
<!-- Managed by Jenkins Job Builder -->
clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
<<: *test-free-job-boiler-plate
<<: *inject-env-variable-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'DAYS_OLD'
default: '15'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-VMs'
triggers:
- timed: '01 08 1,15 * *'
builders:
- shell: !include-raw-escape: vm-bm-clean-up.sh
- job-template:
name: test-station-log-cleanup-{clean-station-type}
description: |
<!-- Managed by Jenkins Job Builder -->
clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than $DAYS_OLD days.
<<: *test-free-job-boiler-plate
<<: *inject-env-variable-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'DAYS_OLD'
default: '30'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-{clean-station-type}s'
triggers:
- timed: '01 08 1 * *'
builders:
- shell: !include-raw-escape: vm-bm-clean-up.sh
- job-template:
name: test-station-log-cleanup-CHO
description: |
<!-- Managed by Jenkins Job Builder -->
<<: *test-free-job-boiler-plate
wrappers:
- inject:
properties-file: '/var/lib/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
echo "WikiPrefix=$WikiPrefix" >> /var/lib/jenkins/TestONOS.property
override-build-parameters: true
# post_Job
properties:
- build-discarder:
num-to-keep: 15
parameters:
- string:
name: 'DAYS_OLD'
default: '15'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-CHOs'
triggers:
- timed: '@daily'
builders:
- shell: !include-raw-escape: cho-clean-up.sh
- job-template:
name: QA-check-style
description: |
<!-- Managed by Jenkins Job Builder -->
<h3>ONOS QA Code Style:</h3>
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 />
All .py files that are in the most recent patchset will be style checked.<br />
<br />
Jenkins User will give +1 if all files pass the style check, -1 if there is at least one style check failure.<br />
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 />
<br />
Click on the link in the Gerrit patchset comment to view the results of the style check.<br />
Alternatively, you can check the console output to view the files checked and style check raw output.<br />
<br />
You may also manually run this job by selecting "Build with Parameters", then providing the 5-digit change number from Gerrit.<br />
<br />
<h3>Important Notes:</h3>
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 />
Build numbers that are 1 build apart may NOT necessarily correspond to the same patchset!<br />
Manually running this job will NOT leave a comment after the most recent patchset in Gerrit.<br />
<br />
<h3>Style Check PEP8 Exclusions:</h3>
This job mainly follows PEP8 style check, but excludes many errors and warnings.<br />
The following errors and warnings are excluded from the PEP8 check portion of the job:
<ul>
<li>E251</li>
<li>E201</li>
<li>E302</li>
<li>E202</li>
<li>E126</li>
<li>E127</li>
<li>E203</li>
<li>E226</li>
<li>E501</li>
<li>W391</li>
</ul>
<h3>Credits:</h3>
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 />
The check style portion of the job is modeled from "HA-Jobs/codecheck_test"<br />
Created by Jeremy Ronquillo: jeremyr@opennetworking.org or j_ronquillo@u.pacific.edu<br />
<br />
Copyright (c) 2017 Open Networking Foundation (ONF)
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 100
parameters:
- string:
name: 'GERRIT_CHANGE_NUMBER'
default: ''
description: '5-digit number that corresponds to the patch set change on Gerrit.'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
concurrent: true
node: 'TestStation-Jeremys'
triggers:
- gerrit:
server-name: 'OnosSystemTest Project Gerrit'
trigger-on:
- patchset-created-event:
exclude-drafts: false
exclude-trivial-rebase: false
exclude-no-code-change: false
- draft-published-event
- comment-added-contains-event:
comment-contains-value: '(?i)^.*recheck$'
projects:
- project-compare-type: PLAIN
project-pattern: '{project}'
branches:
- branch-compare-type: ANT
branch-pattern: '**/master'
- branch-compare-type: ANT
branch-pattern: '**/onos-1.[11-20]'
wrappers:
- lf-infra-wrappers:
build-timeout: 1800
jenkins-ssh-credential: '{jenkins-ssh-credential}'
builders:
- shell: !include-raw-escape: check-style.sh
publishers:
- warnings:
workspace-file-scanners:
- file-pattern: pep8Result.txt
scanner: Pep8
total-thresholds:
unstable:
total-all: 1
- job-template:
name: delta-nightly
description: |
<!-- Managed by Jenkins Job Builder -->
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'NIGHTLY_FILE_NAME'
default: ''
description: |
Name of ONOS nightly build file <br />
will be set to the latest file if not specified here
- string:
name: 'ONOS_VERSION'
default: '1.11.0'
description: 'Version number in ONOS nightly build file'
- string:
name: 'DELTA_PATH'
default: '/home/sdn'
description: 'Path of DELTA project'
- string:
name: 'WIKI_PREFIX'
default: 'master'
- bool:
name: 'CLEANUP'
default: true
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-BMs'
wrappers:
- inject:
properties-file: '/var/jenkins/TestONOS.property'
builders:
- shell: !include-raw-escape: delta-script.sh
publishers:
- plot:
- title: 'DELTA Test Results for master'
group: 'DELTA-nightly'
yaxis: 'Number of test cases'
style: line
series:
- file: 'DELTA-nightly.csv'
format: 'csv'
# Todo : add confluence ( use pipeline for post build ..? )
- job-template:
name: init-CHO
description: |
<!-- Managed by Jenkins Job Builder -->
1) Set a specific onos branch to test; <br />
2) pull and checkout the branch; <br />
3) build onos and package to tar.gz <br />
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'ONOSBranch'
default: 'master'
description: |
set onos branch to test. default to "master", <br />
but can also be set at "onos-1.2", etc. <br />
This parameter is also use to trigger where the test results to be posted
- string:
name: 'ONOSJVMHeap'
default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
description: 'onos cell jvm heap size setting'
- string:
name: 'TestONBranch'
default: 'master'
description: 'sets TestON branch'
- string:
name: 'ONOSTag'
default: ''
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric5s'
wrappers:
- inject:
properties-file: '/var/lib/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
override-build-parameters: true
builders:
- shell: !include-raw-escape: cho-init.sh
- job-template:
name: running-CHO
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric5s'
triggers:
- reverse:
jobs: 'init-CHO'
result: 'failure'
builders:
- shell: !include-raw-escape: running-cho.sh
- job-template:
name: post-CHO-{branch}
<<: *test-free-job-boiler-plate
properties:
- lf-infra-properties:
project: '{project}'
build-days-to-keep: 7
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric5s'
triggers:
- timed: 'H/60 * * * *'
wrappers:
- inject:
properties-file: '/var/jenkins/TestONOS.property'
builders:
- shell: !include-raw-escape: cho-post-sdn.sh
publishers:
- plot:
- title: 'Network, Application and ONOS Events (per hour)'
group: 'CHOTestMonkey'
num-builds: '72'
yaxis: 'Number of Events'
style: line
logarithmic-yaxis: true
series:
- file: 'event.csv'
format: 'csv'
- title: 'Failed Checks (per hour)'
group: 'CHOTestMonkey'
num-builds: '72'
yaxis: 'Number of Failed Checks'
style: line
logarithmic-yaxis: true
series:
- file: 'failure.csv'
format: 'csv'
- title: 'Warnings, Errors and Exceptions from Logs (per hour)'
group: 'CHOTestMonkey'
num-builds: '72'
yaxis: 'Number of Warnings or Errors'
style: line
logarithmic-yaxis: true
series:
- file: 'error.csv'
format: 'csv'
- job-template:
name: 'SR-log-{sr-version}'
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 50
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric3s'
publishers:
- archive:
artifacts: '*'
- job-template:
name: 'SR-log-{sr-versions}'
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 50
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric2s'
publishers:
- archive:
artifacts: '*'
- job-template:
name: test-HA
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
days-to-keep: 5
num-to-keep: 100
parameters:
- string:
name: 'TEST_NAME'
default: 'HAbackupRecover'
description: 'The name of the TestON test suite'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Jons'
triggers:
- reverse:
jobs: 'test-HA'
result: 'failure'
builders:
- shell: !include-raw-escape: test-ha.sh
publishers:
- plot:
- title: 'Test job results'
group: 'Test-HA'
yaxis: 'Number of test cases'
style: line
series:
- file: 'results.csv'
format: 'csv'
- title: 'Timers'
group: 'Test-HA'
yaxis: 'Time in seconds'
style: line
series:
- file: 'Timers.csv'
format: 'csv'
- post-tasks:
- escalate-status: true
script: |
if [ -e ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt ] && ! grep -q "FAIL" ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt
then
exit 0
else
exit 1
fi
- project:
name: post-result-jobs
project-name: post-result-jobs
<<: *test-free-init-procedure-plate
<<: *init-station-plate
jobs:
- 'postjob-{station-type}'
- project:
name: cleanup-jobs
project-name: cleanup-jobs
<<: *test-free-init-procedure-plate
<<: *init-station-plate
<<: *init-station-plate-clean
jobs:
- 'test-station-log-cleanup-VM'
- 'test-station-log-cleanup-{clean-station-type}'
- 'test-station-log-cleanup-CHO'
- project:
name: check-style
project-name: check-style
<<: *test-free-init-procedure-plate
jobs:
- 'QA-check-style'
- project:
name: delta-test
project-name: delta-test
<<: *test-free-init-procedure-plate
jobs:
- 'delta-nightly'
- project:
name: cho-tests
project-name: cho-tests
<<: *test-free-init-procedure-plate
jobs:
- 'init-CHO'
- 'running-CHO'
- 'post-CHO-{branch}':
branch:
- 'master'
- '1.13'
- '1.12'
- project:
name: log-pipeline
project-name: 'log-pipeline'
<<: *test-free-init-procedure-plate
sr-version:
- '1.11'
- '1.12'
sr-versions:
- 'master'
- '1.13'
jobs:
- 'SR-log-{sr-version}'
- 'SR-log-{sr-versions}'
- project:
name: personal-station
project-name: 'personal-station'
<<: *test-free-init-procedure-plate
jobs:
- 'test-HA'