blob: 974b7520b6c201f14ad8cb70656ef6db79a58bae [file] [log] [blame]
Matteo Scandoloecbd6a12019-10-21 10:51:03 -07001/*
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 {
Zack Williamsce46e7e2019-10-29 11:27:40 -070021 label "${params.buildNode}"
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070022 }
23
24 stages {
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070025 stage('Build BBR') {
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070026 steps {
27 sh """
Matteo Scandolo6866b8c2019-10-28 16:15:24 -070028 make build
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070029 """
30 }
31 }
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070032 stage('Build BBSim') {
Matteo Scandolod3415f62019-10-25 15:58:18 -070033 steps {
34 sh """
35 docker pull voltha/bbsim:master
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070036 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=candidate make docker-build
Matteo Scandolod3415f62019-10-25 15:58:18 -070037 """
38 }
39 }
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070040 stage('64 ONUs (16 ONU x 4 PONs)') {
41 steps {
42 timeout(1) {
43 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070044 docker rm -f bbsim || true
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070045 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=candidate DOCKER_RUN_ARGS="-pon 4 -onu 16" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070046 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070047 ./bbr -pon 4 -onu 16 -logfile bbr_16_4.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070048 docker logs bbsim 2>&1 | tee bbsim_16_4.logs
49 """
50 }
51 }
52 }
53 stage('128 ONUs (32 ONU x 4 PONs)') {
54 steps {
55 timeout(1) {
56 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070057 docker rm -f bbsim || true
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070058 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=candidate DOCKER_RUN_ARGS="-pon 4 -onu 32" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070059 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070060 ./bbr -pon 4 -onu 32 -logfile bbr_32_4.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070061 docker logs bbsim 2>&1 | tee bbsim_32_4.logs
62 """
63 }
64 }
65 }
66 stage('256 ONUs (32 ONU x 8 PONs)') {
67 steps {
68 timeout(1) {
69 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070070 docker rm -f bbsim || true
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070071 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=candidate DOCKER_RUN_ARGS="-pon 8 -onu 32" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070072 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070073 ./bbr -pon 8 -onu 32 -logfile bbr_32_8.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070074 docker logs bbsim 2>&1 | tee bbsim_32_8.logs
75 """
76 }
77 }
78 }
Matteo Scandolo0dfee532019-10-21 16:20:12 -070079 }
80 post {
81 always {
82 archiveArtifacts artifacts: '*.logs'
83 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "teo@opennetworking.org", sendToIndividuals: false])
84 }
85 failure {
86 sh '''
87 docker logs bbsim 2>&1 | tee bbsim_failed.logs
88 docker cp bbsim:/app/dhcp.logs dhcp_failed.logs
89 docker cp bbsim:/var/lib/dhcp/dhcpd.leases dhcpd_leases_failed.logs
90 docker cp bbsim:/app/tcpdump.logs tcpdump_failed.logs
91 docker exec bbsim bbsimctl onu list > onu_list.logs
92 '''
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070093 }
94 }
95}