Kailash | 8b8de74 | 2019-07-30 08:54:51 -0700 | [diff] [blame] | 1 | // Copyright 2017-present Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // voltha-2.x e2e tests |
| 16 | // uses kind-voltha to deploy voltha-2.X |
| 17 | // uses bbsim to simulate OLT/ONUs |
| 18 | |
| 19 | pipeline { |
| 20 | |
| 21 | /* no label, executor is determined by JJB */ |
| 22 | agent { |
| 23 | label "${params.executorNode}" |
| 24 | } |
| 25 | |
| 26 | stages { |
| 27 | |
| 28 | stage('Download kind-voltha') { |
| 29 | steps { |
| 30 | sh """ |
| 31 | git clone https://github.com/ciena/kind-voltha.git |
| 32 | """ |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | stage('Deploy Voltha') { |
| 37 | steps { |
| 38 | sh """ |
| 39 | cd kind-voltha/ |
| 40 | TYPE=minimal WITH_RADIUS=y USE_GO=false ./voltha up |
| 41 | """ |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | stage('Install BBSIM') { |
| 46 | steps { |
| 47 | sh """ |
| 48 | helm install --set onus_per_pon_port=${params.numOnus} ${params.EmulationMode} onf/bbsim -n bbsim |
| 49 | """ |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | stage('Run E2E Tests') { |
| 54 | steps { |
| 55 | sh ''' |
| 56 | git clone https://gerrit.opencord.org/voltha-system-tests |
| 57 | cd kind-voltha/ |
| 58 | export KUBECONFIG="$(./bin/kind get kubeconfig-path --name="voltha-minimal")" |
| 59 | export VOLTCONFIG="/home/jenkins/.volt/config-minimal" |
| 60 | export PATH=/w/workspace/kind-voltha-minimal/kind-voltha/bin:$PATH |
| 61 | cd $WORKSPACE/voltha-system-tests/tests/sanity |
| 62 | robot ${params.testTags} -v num_onus:${params.numOnus} -v timeout:${params.testTimeout} sanity.robot |
| 63 | ''' |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | post { |
| 69 | always { |
| 70 | sh ''' |
| 71 | # copy robot logs |
| 72 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs |
| 73 | cp -r $WORKSPACE/voltha-system-tests/tests/sanity/*ml ./RobotLogs |
| 74 | ''' |
| 75 | step([$class: 'RobotPublisher', |
| 76 | disableArchiveOutput: false, |
| 77 | logFileName: 'RobotLogs/log*.html', |
| 78 | otherFiles: '', |
| 79 | outputFileName: 'RobotLogs/output*.xml', |
| 80 | outputPath: '.', |
| 81 | passThreshold: 100, |
| 82 | reportFileName: 'RobotLogs/report*.html', |
| 83 | unstableThreshold: 0]); |
| 84 | archiveArtifacts artifacts: '*.log' |
| 85 | |
| 86 | } |
| 87 | } |
| 88 | } |