Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | pipeline { |
| 18 | |
| 19 | /* no label, executor is determined by JJB */ |
| 20 | agent { |
| 21 | label "${params.executorNode}" |
| 22 | } |
| 23 | |
| 24 | stages { |
Matteo Scandolo | ba342de | 2019-10-22 10:41:33 -0700 | [diff] [blame] | 25 | stage('Download BBR') { |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 26 | steps { |
| 27 | sh """ |
Matteo Scandolo | ba342de | 2019-10-22 10:41:33 -0700 | [diff] [blame] | 28 | wget https://github.com/opencord/bbsim/releases/download/v0.0.2/bbr-linux-amd64 |
| 29 | mv bbr-linux-amd64 bbr |
| 30 | chmod a+x bbr |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 31 | """ |
| 32 | } |
| 33 | } |
Matteo Scandolo | d3415f6 | 2019-10-25 15:58:18 -0700 | [diff] [blame] | 34 | stage('Pull BBSim image from DockerHub') { |
| 35 | steps { |
| 36 | sh """ |
| 37 | docker pull voltha/bbsim:master |
| 38 | """ |
| 39 | } |
| 40 | } |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 41 | stage('64 ONUs (16 ONU x 4 PONs)') { |
| 42 | steps { |
| 43 | timeout(1) { |
| 44 | sh """ |
Matteo Scandolo | 13f412d | 2019-10-25 13:37:27 -0700 | [diff] [blame] | 45 | docker rm -f bbsim || true |
Matteo Scandolo | ba342de | 2019-10-22 10:41:33 -0700 | [diff] [blame] | 46 | DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-pon 4 -onu 16" make docker-run |
| 47 | sleep 5 |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 48 | ./bbr -pon 4 -onu 16 2>&1 | tee bbr_16_4.logs |
| 49 | docker logs bbsim 2>&1 | tee bbsim_16_4.logs |
| 50 | """ |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | stage('128 ONUs (32 ONU x 4 PONs)') { |
| 55 | steps { |
| 56 | timeout(1) { |
| 57 | sh """ |
Matteo Scandolo | 13f412d | 2019-10-25 13:37:27 -0700 | [diff] [blame] | 58 | docker rm -f bbsim || true |
Matteo Scandolo | ba342de | 2019-10-22 10:41:33 -0700 | [diff] [blame] | 59 | DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-pon 4 -onu 32" make docker-run |
| 60 | sleep 5 |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 61 | ./bbr -pon 4 -onu 32 2>&1 | tee bbr_32_4.logs |
| 62 | docker logs bbsim 2>&1 | tee bbsim_32_4.logs |
| 63 | """ |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | stage('256 ONUs (32 ONU x 8 PONs)') { |
| 68 | steps { |
| 69 | timeout(1) { |
| 70 | sh """ |
Matteo Scandolo | 13f412d | 2019-10-25 13:37:27 -0700 | [diff] [blame] | 71 | docker rm -f bbsim || true |
Matteo Scandolo | ba342de | 2019-10-22 10:41:33 -0700 | [diff] [blame] | 72 | DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-pon 8 -onu 32" make docker-run |
| 73 | sleep 5 |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 74 | ./bbr -pon 8 -onu 32 2>&1 | tee bbr_32_8.logs |
| 75 | docker logs bbsim 2>&1 | tee bbsim_32_8.logs |
| 76 | """ |
| 77 | } |
| 78 | } |
| 79 | } |
Matteo Scandolo | 0dfee53 | 2019-10-21 16:20:12 -0700 | [diff] [blame] | 80 | } |
| 81 | post { |
| 82 | always { |
| 83 | archiveArtifacts artifacts: '*.logs' |
| 84 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "teo@opennetworking.org", sendToIndividuals: false]) |
| 85 | } |
| 86 | failure { |
| 87 | sh ''' |
| 88 | docker logs bbsim 2>&1 | tee bbsim_failed.logs |
| 89 | docker cp bbsim:/app/dhcp.logs dhcp_failed.logs |
| 90 | docker cp bbsim:/var/lib/dhcp/dhcpd.leases dhcpd_leases_failed.logs |
| 91 | docker cp bbsim:/app/tcpdump.logs tcpdump_failed.logs |
| 92 | docker exec bbsim bbsimctl onu list > onu_list.logs |
| 93 | ''' |
Matteo Scandolo | ecbd6a1 | 2019-10-21 10:51:03 -0700 | [diff] [blame] | 94 | } |
| 95 | } |
| 96 | } |