blob: 98831b727e3e04ec7ad2c9c43f90b832aef43ed5 [file] [log] [blame]
Matteo Scandolo4b006ae2020-11-09 16:14:40 -08001// Copyright 2019-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// deploy VOLTHA using kind-voltha and performs a scale test
16
17pipeline {
18
19 /* no label, executor is determined by JJB */
20 agent {
21 label "${params.buildNode}"
22 }
23 options {
Matteo Scandolof7ca6312020-11-16 15:57:15 -080024 timeout(time: 120, unit: 'MINUTES')
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080025 }
26 environment {
27 JENKINS_NODE_COOKIE="dontKillMe" // do not kill processes after the build is done
28 KUBECONFIG="$HOME/.kube/config"
29 SSHPASS="karaf"
30 PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
31 SCHEDULE_ON_CONTROL_NODES="yes"
32 FANCY=0
33 WAIT_ON_DOWN="yes"
34 WITH_SIM_ADAPTERS="no"
35 WITH_RADIUS="${withRadius}"
36 WITH_BBSIM="yes"
37 LEGACY_BBSIM_INDEX="no"
38 DEPLOY_K8S="no"
39 CONFIG_SADIS="external"
40 WITH_KAFKA="yes"
41 WITH_ETCD="yes"
42 VOLTHA_ETCD_PORT=9999
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080043 INFRA_NS="infra"
44
45 // configurable options
46 WITH_EAPOL="${withEapol}"
47 WITH_DHCP="${withDhcp}"
48 WITH_IGMP="${withIgmp}"
49 VOLTHA_LOG_LEVEL="${logLevel}"
50 NUM_OF_BBSIM="${olts}"
51 NUM_OF_OPENONU="${openonuAdapterReplicas}"
52 NUM_OF_ONOS="${onosReplicas}"
53 NUM_OF_ATOMIX="${atomixReplicas}"
54 NUM_OF_KAFKA="${kafkaReplicas}"
55 NUM_OF_ETCD="${etcdReplicas}"
56 WITH_PPROF="${withProfiling}"
57 EXTRA_HELM_FLAGS="${extraHelmFlags} " // note that the trailing space is required to separate the parameters from appends done later
58 VOLTHA_CHART="${volthaChart}"
59 VOLTHA_BBSIM_CHART="${bbsimChart}"
60 VOLTHA_ADAPTER_OPEN_OLT_CHART="${openoltAdapterChart}"
61 VOLTHA_ADAPTER_OPEN_ONU_CHART="${openonuAdapterChart}"
62 ONOS_CLASSIC_CHART="${onosChart}"
63 RADIUS_CHART="${radiusChart}"
64
65 APPS_TO_LOG="etcd kafka onos-onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim radius"
66 LOG_FOLDER="$WORKSPACE/logs"
67
68 GERRIT_PROJECT="${GERRIT_PROJECT}"
69 }
70
71 stages {
72 stage ('Cleanup') {
73 steps {
74 timeout(time: 11, unit: 'MINUTES') {
75 sh returnStdout: false, script: """
Matteo Scandolobe823242020-11-20 13:48:13 -080076 helm repo add stable https://charts.helm.sh/stable
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080077 helm repo add onf https://charts.opencord.org
78 helm repo add cord https://charts.opencord.org
79 helm repo add onos https://charts.onosproject.org
80 helm repo add atomix https://charts.atomix.io
81 helm repo add bbsim-sadis https://ciena.github.io/bbsim-sadis-server/charts
82 helm repo update
83
84 # removing ETCD port forward
85 P_ID="\$(ps e -ww -A | grep "_TAG=etcd-port-forward" | grep -v grep | awk '{print \$1}')"
86 if [ -n "\$P_ID" ]; then
87 kill -9 \$P_ID
88 fi
89
Matteo Scandolo9fe8cad2020-11-13 12:54:19 -080090 NAMESPACES="voltha1 voltha2 infra default"
91 for NS in \$NAMESPACES
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080092 do
Matteo Scandolo9fe8cad2020-11-13 12:54:19 -080093 for hchart in \$(helm list -n \$NS -q | grep -E -v 'docker-registry|kafkacat');
94 do
95 echo "Purging chart: \${hchart}"
96 helm delete -n \$NS "\${hchart}"
97 done
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080098 done
Matteo Scandolo4b006ae2020-11-09 16:14:40 -080099
100 test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down
101
Matteo Scandolobe823242020-11-20 13:48:13 -0800102 ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800103
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800104 cd $WORKSPACE
105 rm -rf $WORKSPACE/*
106 """
107 }
108 }
109 }
110 stage('Clone kind-voltha') {
111 steps {
112 checkout([
113 $class: 'GitSCM',
114 userRemoteConfigs: [[
115 url: "https://gerrit.opencord.org/kind-voltha",
116 refspec: "${kindVolthaChange}"
117 ]],
118 branches: [[ name: "master", ]],
119 extensions: [
120 [$class: 'WipeWorkspace'],
121 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
122 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
123 ],
124 ])
125 script {
126 sh(script:"""
127 if [ '${kindVolthaChange}' != '' ] ; then
128 cd $WORKSPACE/kind-voltha;
129 git fetch https://gerrit.opencord.org/kind-voltha ${kindVolthaChange} && git checkout FETCH_HEAD
130 fi
131 """)
132 }
133 }
134 }
135 stage('Clone voltha-system-tests') {
136 steps {
137 checkout([
138 $class: 'GitSCM',
139 userRemoteConfigs: [[
140 url: "https://gerrit.opencord.org/voltha-system-tests",
141 refspec: "${volthaSystemTestsChange}"
142 ]],
143 branches: [[ name: "${release}", ]],
144 extensions: [
145 [$class: 'WipeWorkspace'],
146 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
147 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
148 ],
149 ])
150 script {
151 sh(script:"""
152 if [ '${volthaSystemTestsChange}' != '' ] ; then
153 cd $WORKSPACE/voltha-system-tests;
154 git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
155 fi
156 """)
157 }
158 }
159 }
160 stage('Build patch') {
161 when {
162 expression {
163 return params.GERRIT_PROJECT
164 }
165 }
166 steps {
167 sh """
168 git clone https://\$GERRIT_HOST/\$GERRIT_PROJECT
169 cd \$GERRIT_PROJECT
170 git fetch https://\$GERRIT_HOST/\$GERRIT_PROJECT \$GERRIT_REFSPEC && git checkout FETCH_HEAD
171
172 DOCKER_REGISTRY=${dockerRegistry}/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=voltha-scale make docker-build
173 DOCKER_REGISTRY=${dockerRegistry}/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=voltha-scale make docker-push
174 """
175 }
176 }
177 stage('Deploy common infrastructure') {
178 // includes monitoring, kafka, etcd
179 steps {
180 sh '''
181 if [ ${withMonitoring} = true ] ; then
Matteo Scandolod4d55b72020-11-25 12:29:07 -0800182 helm install -n $INFRA_NS nem-monitoring cord/nem-monitoring \
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800183 -f $HOME/voltha-scale/grafana.yaml \
184 --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \
185 --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
186 fi
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800187 '''
188 }
189 }
190 stage('Deploy VOLTHA infrastructure') {
191 steps {
192 sh returnStdout: false, script: '''
Matteo Scandolo128ee7a2020-12-03 14:16:54 -0800193
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800194 cd $WORKSPACE/kind-voltha/
195
Matteo Scandolof6656562020-11-16 14:45:44 -0800196 export ETCD_CHART=$HOME/teone/helm-charts/etcd
197 export KAFKA_CHART=$HOME/teone/helm-charts/kafka
Matteo Scandolob28a97b2020-11-13 10:58:32 -0800198
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800199 # KAFKA config
Matteo Scandolof6656562020-11-16 14:45:44 -0800200 export NUM_OF_KAFKA=${kafkaReplicas}
201 export EXTRA_HELM_FLAGS+=' --set prometheus.kafka.enabled=true,prometheus.operator.enabled=true,prometheus.jmx.enabled=true,prometheus.operator.serviceMonitor.namespace=default '
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800202
203 # ETCD config
Matteo Scandolof6656562020-11-16 14:45:44 -0800204 export EXTRA_HELM_FLAGS+=" --set memoryMode=${inMemoryEtcdStorage} "
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800205
206 NAME=infra JUST_INFRA=y ./voltha up
207
208 # Forward the ETCD port onto $VOLTHA_ETCD_PORT
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800209 _TAG=etcd-port-forward kubectl -n \$INFRA_NS port-forward --address 0.0.0.0 -n default service/etcd $VOLTHA_ETCD_PORT:2379&
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800210 '''
211 }
212 }
213 stage('Deploy Voltha') {
214 steps {
215 deploy_voltha_stacks(params.volthaStacks)
216 }
217 }
218 stage('Start logging') {
219 steps {
220 sh returnStdout: false, script: '''
221 # start logging with kail
222
223 mkdir -p $LOG_FOLDER
224
225 list=($APPS_TO_LOG)
226 for app in "${list[@]}"
227 do
228 echo "Starting logs for: ${app}"
229 _TAG=kail-$app kail -l app=$app --since 1h > $LOG_FOLDER/$app.log&
230 done
231 '''
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800232 }
233 }
234 stage('Configuration') {
235 steps {
236 script {
237 sh returnStdout: false, script: """
Matteo Scandolo68978752020-12-02 12:23:42 -0800238
Matteo Scandoloffe19c92020-11-24 15:25:25 -0800239 # TODO this needs to be repeated per stack
240 # kubectl exec \$(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print \$1}') -- bbsimctl log ${logLevel.toLowerCase()} false
241
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800242 #Setting link discovery
243 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${withLLDP}
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800244 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flow.impl.FlowRuleManager allowExtraneousRules true
245 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flow.impl.FlowRuleManager importExtraneousRules true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800246 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager accumulatorMaxBatchMillis 1000
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800247 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager accumulatorMaxIdleMillis 500
248
Matteo Scandoloffe19c92020-11-24 15:25:25 -0800249 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.onosproject
250 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.opencord
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800251
252 # Set Flows/Ports/Meters poll frequency
253 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${onosStatInterval}
254 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${onosStatInterval}
255
256 if [ ${withFlows} = false ]; then
257 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt
258 fi
259
260 if [ ${withMibTemplate} = true ] ; then
261 rm -f BBSM-12345123451234512345-00000000000001-v1.json
262 wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800263 cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl -n \$INFRA_NS exec -it \$(kubectl -n \$INFRA_NS get pods -l app=etcd | awk 'NR==2{print \$1}') -- etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800264 fi
265
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800266 if [ ${withPcap} = true ] && [ ${volthaStacks} -eq 1 ] ; then
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800267 # Start the tcp-dump in ofagent
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800268 export OF_AGENT=\$(kubectl -n \$INFRA_NS get pods -l app=ofagent -o name)
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800269 kubectl exec \$OF_AGENT -- apk update
270 kubectl exec \$OF_AGENT -- apk add tcpdump
271 kubectl exec \$OF_AGENT -- mv /usr/sbin/tcpdump /usr/bin/tcpdump
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800272 _TAG=ofagent-tcpdump kubectl -n \$INFRA_NS exec \$OF_AGENT -- tcpdump -nei eth0 -w out.pcap&
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800273
274 # Start the tcp-dump in radius
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800275 export RADIUS=\$(kubectl -n \$INFRA_NS get pods -l app=radius -o name)
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800276 kubectl exec \$RADIUS -- apt-get update
277 kubectl exec \$RADIUS -- apt-get install -y tcpdump
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800278 _TAG=radius-tcpdump kubectl -n \$INFRA_NS exec \$RADIUS -- tcpdump -w out.pcap&
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800279
280 # Start the tcp-dump in ONOS
281 for i in \$(seq 0 \$ONOSES); do
282 INSTANCE="onos-onos-classic-\$i"
283 kubectl exec \$INSTANCE -- apt-get update
284 kubectl exec \$INSTANCE -- apt-get install -y tcpdump
285 kubectl exec \$INSTANCE -- mv /usr/sbin/tcpdump /usr/bin/tcpdump
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800286 _TAG=\$INSTANCE kubectl -n \$INFRA_NS exec \$INSTANCE -- /usr/bin/tcpdump -nei eth0 port 1812 -w out.pcap&
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800287 done
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800288 else
289 echo "PCAP not supported for multiple VOLTHA stacks"
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800290 fi
291 """
292 }
293 }
294 }
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800295 stage('Setup Test') {
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800296 steps {
297 sh '''
298 mkdir -p $WORKSPACE/RobotLogs
299 cd $WORKSPACE/voltha-system-tests
300 make vst_venv
301 '''
302 sh '''
Matteo Scandolod1430a72020-12-04 15:14:44 -0800303 if [ ${withProfiling} = true ] && [ ${volthaStacks} -eq 1 ]; then
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800304 mkdir -p $LOG_FOLDER/pprof
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800305 cat << EOF > $WORKSPACE/pprof.sh
306timestamp() {
307 date +"%T"
308}
309
310i=0
311while [[ true ]]; do
312 ((i++))
313 ts=$(timestamp)
314 go tool pprof -png http://127.0.0.1:6060/debug/pprof/heap > $LOG_FOLDER/pprof/rw-core-heap-\\$i-\\$ts.png
315 go tool pprof -png http://127.0.0.1:6060/debug/pprof/goroutine > $LOG_FOLDER/pprof/rw-core-goroutine-\\$i-\\$ts.png
316 curl -o $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=10
317 go tool pprof -png $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.png
318
319 go tool pprof -png http://127.0.0.1:6061/debug/pprof/heap > $LOG_FOLDER/pprof/openolt-heap-\\$i-\\$ts.png
320 go tool pprof -png http://127.0.0.1:6061/debug/pprof/goroutine > $LOG_FOLDER/pprof/openolt-goroutine-\\$i-\\$ts.png
321 curl -o $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.pprof http://127.0.0.1:6061/debug/pprof/profile?seconds=10
322 go tool pprof -png $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.png
323
324 go tool pprof -png http://127.0.0.1:6062/debug/pprof/heap > $LOG_FOLDER/pprof/ofagent-heap-\\$i-\\$ts.png
325 go tool pprof -png http://127.0.0.1:6062/debug/pprof/goroutine > $LOG_FOLDER/pprof/ofagent-goroutine-\\$i-\\$ts.png
326 curl -o $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.pprof http://127.0.0.1:6062/debug/pprof/profile?seconds=10
327 go tool pprof -png $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.png
328
329 sleep 10
330done
331EOF
332
333 _TAG="pprof"
334 _TAG=$_TAG bash $WORKSPACE/pprof.sh &
Matteo Scandolod1430a72020-12-04 15:14:44 -0800335 else
336 echo "Profiling not supported for multiple VOLTHA stacks"
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800337 fi
338 '''
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800339 }
340 }
341 stage('Run Test') {
342 steps {
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800343 test_voltha_stacks(params.volthaStacks)
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800344 }
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800345 }
346 }
347 post {
348 always {
349 // collect result, done in the "post" step so it's executed even in the
350 // event of a timeout in the tests
351 sh '''
352
353 # stop the kail processes
354 list=($APPS_TO_LOG)
355 for app in "${list[@]}"
356 do
357 echo "Stopping logs for: ${app}"
358 _TAG="kail-$app"
359 P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')"
360 if [ -n "$P_IDS" ]; then
361 echo $P_IDS
362 for P_ID in $P_IDS; do
363 kill -9 $P_ID
364 done
365 fi
366 done
367
Matteo Scandolod1430a72020-12-04 15:14:44 -0800368 if [ ${withPcap} = true ] && [ ${volthaStacks} -eq 1 ]; then
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800369 # stop ofAgent tcpdump
370 P_ID="\$(ps e -ww -A | grep "_TAG=ofagent-tcpdump" | grep -v grep | awk '{print \$1}')"
371 if [ -n "\$P_ID" ]; then
372 kill -9 \$P_ID
373 fi
374
375 # stop radius tcpdump
376 P_ID="\$(ps e -ww -A | grep "_TAG=radius-tcpdump" | grep -v grep | awk '{print \$1}')"
377 if [ -n "\$P_ID" ]; then
378 kill -9 \$P_ID
379 fi
380
381 # stop onos tcpdump
382 LIMIT=$(($NUM_OF_ONOS - 1))
383 for i in $(seq 0 $LIMIT); do
384 INSTANCE="onos-onos-classic-$i"
385 P_ID="\$(ps e -ww -A | grep "_TAG=$INSTANCE" | grep -v grep | awk '{print \$1}')"
386 if [ -n "\$P_ID" ]; then
387 kill -9 \$P_ID
388 fi
389 done
390
391 # copy the file
392 export OF_AGENT=$(kubectl get pods -l app=ofagent | awk 'NR==2{print $1}') || true
393 kubectl cp $OF_AGENT:out.pcap $LOG_FOLDER/ofagent.pcap || true
394
395 export RADIUS=$(kubectl get pods -l app=radius | awk 'NR==2{print $1}') || true
396 kubectl cp $RADIUS:out.pcap $LOG_FOLDER/radius.pcap || true
397
398 LIMIT=$(($NUM_OF_ONOS - 1))
399 for i in $(seq 0 $LIMIT); do
400 INSTANCE="onos-onos-classic-$i"
401 kubectl cp $INSTANCE:out.pcap $LOG_FOLDER/$INSTANCE.pcap || true
402 done
403 fi
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800404 '''
405 sh '''
Matteo Scandolod1430a72020-12-04 15:14:44 -0800406 if [ ${withProfiling} = true ] && [ ${volthaStacks} -eq 1 ]; then
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800407 _TAG="pprof"
408 P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')"
409 if [ -n "$P_IDS" ]; then
410 echo $P_IDS
411 for P_ID in $P_IDS; do
412 kill -9 $P_ID
413 done
414 fi
415 fi
416 '''
417 plot([
418 csvFileName: 'scale-test.csv',
419 csvSeries: [
420 [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
421 [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
422 [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
423 [file: 'plots/plot-voltha-openolt-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
424 [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
425 [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
426 [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
427 [file: 'plots/plot-voltha-openolt-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
428 [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
429 [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
430 ],
Matteo Scandolod1430a72020-12-04 15:14:44 -0800431 group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (Stacks: ${params.volthaStacks}, OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800432 ])
433 step([$class: 'RobotPublisher',
434 disableArchiveOutput: false,
Matteo Scandolod4064492020-11-13 10:48:30 -0800435 logFileName: 'RobotLogs/**/log.html',
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800436 otherFiles: '',
Matteo Scandolod4064492020-11-13 10:48:30 -0800437 outputFileName: 'RobotLogs/**/output.xml',
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800438 outputPath: '.',
439 passThreshold: 100,
Matteo Scandolod4064492020-11-13 10:48:30 -0800440 reportFileName: 'RobotLogs/**/report.html',
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800441 unstableThreshold: 0]);
442 // get all the logs from kubernetes PODs
443 sh returnStdout: false, script: '''
444
445 # store information on running charts
Matteo Scandolod4064492020-11-13 10:48:30 -0800446 helm ls --all-namespaces > $LOG_FOLDER/helm-list.txt || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800447
448 # store information on the running pods
Matteo Scandolod4d55b72020-11-25 12:29:07 -0800449 kubectl get pods --all-namespaces -o wide > $LOG_FOLDER/pods.txt || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800450 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt || true
451 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt || true
452
453 # copy the ONOS logs directly from the container to avoid the color codes
Matteo Scandolobe823242020-11-20 13:48:13 -0800454 printf '%s\n' $(kubectl -n \$INFRA_NS get pods -l app=onos-onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c "kubectl -n \$INFRA_NS cp #:${karafHome}/data/log/karaf.log $LOG_FOLDER/#.log" || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800455
456 # get radius logs out of the container
Matteo Scandolod4064492020-11-13 10:48:30 -0800457 kubectl -n \$INFRA_NS cp $(kubectl -n \$INFRA_NS get pods -l app=radius --no-headers | awk '{print $1}'):/var/log/freeradius/radius.log $LOG_FOLDER//radius.log || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800458 '''
459 // dump all the BBSim(s) ONU information
Matteo Scandolod4064492020-11-13 10:48:30 -0800460 script {
461 for (int i = 1; i <= params.volthaStacks.toInteger(); i++) {
462 stack_ns="voltha"+i
463 sh """
464 BBSIM_IDS=\$(kubectl -n ${stack_ns} get pods | grep bbsim | grep -v server | awk '{print \$1}')
465 IDS=(\$BBSIM_IDS)
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800466
Matteo Scandolod4064492020-11-13 10:48:30 -0800467 for bbsim in "\${IDS[@]}"
468 do
Matteo Scandolod1430a72020-12-04 15:14:44 -0800469 kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl onu list > $LOG_FOLDER/${stack_ns}/\$bbsim-device-list.txt || true
470 kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl service list > $LOG_FOLDER/${stack_ns}/\$bbsim-service-list.txt || true
Matteo Scandolod4064492020-11-13 10:48:30 -0800471 done
472 """
473 }
474 }
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800475 // get ONOS debug infos
476 sh '''
477
478 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 apps -a -s > $LOG_FOLDER/onos-apps.txt || true
479 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 nodes > $LOG_FOLDER/onos-nodes.txt || true
480 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 masters > $LOG_FOLDER/onos-masters.txt || true
481 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 roles > $LOG_FOLDER/onos-roles.txt || true
482
483 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports > $LOG_FOLDER/onos-ports-list.txt || true
484 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 hosts > $LOG_FOLDER/onos-hosts-list.txt || true
485
486 if [ ${withFlows} = true ] ; then
487 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-olts > $LOG_FOLDER/onos-olt-list.txt || true
488 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s > $LOG_FOLDER/onos-flows-list.txt || true
489 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 meters > $LOG_FOLDER/onos-meters-list.txt || true
490 fi
491
492 if [ ${provisionSubscribers} = true ]; then
493 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-subscribers > $LOG_FOLDER/onos-programmed-subscribers.txt || true
494 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-meters > $LOG_FOLDER/onos-programmed-meters.txt || true
495 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-bpmeter-mappings > $LOG_FOLDER/onos-bpmeter-mappings.txt || true
496 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-failed-subscribers > $LOG_FOLDER/onos-failed-subscribers.txt || true
497 fi
498
499 if [ ${withEapol} = true ] ; then
500 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users > $LOG_FOLDER/onos-aaa-users.txt || true
501 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-statistics > $LOG_FOLDER/onos-aaa-statistics.txt || true
502 fi
503
504 if [ ${withDhcp} = true ] ; then
505 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations > $LOG_FOLDER/onos-dhcp-allocations.txt || true
506 fi
507 '''
508 // collect etcd metrics
509 sh '''
510 mkdir -p $WORKSPACE/etcd-metrics
511 curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_debugging_mvcc_keys_total' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-key-count.json || true
512 curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=grpc_server_handled_total{grpc_service="etcdserverpb.KV"}' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-rpc-count.json || true
513 curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_debugging_mvcc_db_total_size_in_bytes' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-db-size.json || true
514 curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_disk_backend_commit_duration_seconds_sum' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-backend-write-time.json || true
515 '''
516 // get VOLTHA debug infos
517 script {
Matteo Scandolod4064492020-11-13 10:48:30 -0800518 for (int i = 1; i <= params.volthaStacks.toInteger(); i++) {
519 stack_ns="voltha"+i
520 voltcfg="~/.volt/config-voltha"+i
Matteo Scandolod4064492020-11-13 10:48:30 -0800521 try {
522 sh """
Matteo Scandolod1430a72020-12-04 15:14:44 -0800523 voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list -o json > $LOG_FOLDER/${stack_ns}/device-list.json || true
524 python -m json.tool $LOG_FOLDER/${stack_ns}/device-list.json > $LOG_FOLDER/${stack_ns}/voltha-devices-list.json || true
525 rm $LOG_FOLDER/${stack_ns}/device-list.json || true
526 voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list > $LOG_FOLDER/${stack_ns}/voltha-devices-list.txt || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800527
Matteo Scandolod4064492020-11-13 10:48:30 -0800528 DEVICE_LIST=
Matteo Scandolod1430a72020-12-04 15:14:44 -0800529 printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns}-m 8MB device flows # > $LOG_FOLDER/${stack_ns}/voltha-device-flows-#.txt" || true
530 printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device port list --format 'table{{.PortNo}}\t{{.Label}}\t{{.Type}}\t{{.AdminState}}\t{{.OperStatus}}' # > $LOG_FOLDER/${stack_ns}/voltha-device-ports-#.txt" || true
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800531
Matteo Scandolod1430a72020-12-04 15:14:44 -0800532 printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice flows # > $LOG_FOLDER/${stack_ns}/voltha-logicaldevice-flows-#.txt" || true
533 printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice port list # > $LOG_FOLDER/${stack_ns}/voltha-logicaldevice-ports-#.txt" || true
Matteo Scandolod4064492020-11-13 10:48:30 -0800534 """
535 } catch(e) {
536 sh '''
537 echo "Can't get device list from voltclt"
538 '''
539 }
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800540 }
541 }
542 // get cpu usage by container
543 sh '''
544 if [ ${withMonitoring} = true ] ; then
545 cd $WORKSPACE/voltha-system-tests
546 source ./vst_venv/bin/activate
547 sleep 60 # we have to wait for prometheus to collect all the information
548 python tests/scale/sizing.py -o $WORKSPACE/plots || true
549 fi
550 '''
Matteo Scandolod1430a72020-12-04 15:14:44 -0800551 archiveArtifacts artifacts: 'kind-voltha/install-*.log,execution-time-*.txt,logs/*,logs/pprof/*,RobotLogs/**/*,plots/*,etcd-metrics/*'
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800552 }
553 }
554}
555
556def deploy_voltha_stacks(numberOfStacks) {
557 for (int i = 1; i <= numberOfStacks.toInteger(); i++) {
558 stage("Deploy VOLTHA stack " + i) {
559 sh returnStdout: false, script: """
560 cd $WORKSPACE/kind-voltha/
561
562 export NAME=voltha${i}
563 export VOLTHA_NS=voltha${i}
564 export ADAPTER_NS=voltha${i}
565 export BBSIM_NS=voltha${i}
566 export BBSIM_BASE_INDEX=${i}
567 export WITH_ETCD=etcd.\$INFRA_NS.svc:2379
568 export WITH_KAFKA=kafka.\$INFRA_NS.svc:9092
569 export WITH_ONOS=onos-onos-classic-hs.\$INFRA_NS.svc:6653
570
571 export EXTRA_HELM_FLAGS+=' '
572
573 # Load the release defaults
574 if [ '${release.trim()}' != 'master' ]; then
575 source $WORKSPACE/kind-voltha/releases/${release}
576 EXTRA_HELM_FLAGS+=" ${extraHelmFlags} "
577 fi
578
579 # BBSim custom image handling
580 if [ '${bbsimImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'bbsim' ]; then
581 IFS=: read -r bbsimRepo bbsimTag <<< '${bbsimImg.trim()}'
582 EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag "
583 fi
584
585 # VOLTHA and ofAgent custom image handling
586 # NOTE to override the rw-core image in a released version you must set the ofAgent image too
587 # TODO split ofAgent and voltha-go
588 if [ '${rwCoreImg.trim()}' != '' ] && [ '${ofAgentImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-go' ]; then
589 IFS=: read -r rwCoreRepo rwCoreTag <<< '${rwCoreImg.trim()}'
590 IFS=: read -r ofAgentRepo ofAgentTag <<< '${ofAgentImg.trim()}'
591 EXTRA_HELM_FLAGS+="--set images.rw_core.repository=\$rwCoreRepo,images.rw_core.tag=\$rwCoreTag,images.ofagent.repository=\$ofAgentRepo,images.ofagent.tag=\$ofAgentTag "
592 fi
593
594 # OpenOLT custom image handling
595 if [ '${openoltAdapterImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openolt-adapter' ]; then
596 IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< '${openoltAdapterImg.trim()}'
597 EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=\$openoltAdapterRepo,images.adapter_open_olt.tag=\$openoltAdapterTag "
598 fi
599
600 # OpenONU custom image handling
601 if [ '${openonuAdapterImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openonu-adapter' ]; then
602 IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< '${openonuAdapterImg.trim()}'
603 EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=\$openonuAdapterRepo,images.adapter_open_onu.tag=\$openonuAdapterTag "
604 fi
605
Andrea Campanella28763082020-11-18 10:55:31 +0100606 # OpenONU Go custom image handling
607 if [ '${openonuAdapterGoImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openonu-adapter-go' ]; then
608 IFS=: read -r openonuAdapterGoRepo openonuAdapterGoTag <<< '${openonuAdapterGoImg.trim()}'
Andrea Campanellaed026982020-11-20 10:06:42 +0100609 EXTRA_HELM_FLAGS+="--set images.adapter_open_onu_go.repository=\$openonuAdapterGoRepo,images.adapter_open_onu_go.tag=\$openonuAdapterGoTag "
Andrea Campanella28763082020-11-18 10:55:31 +0100610 fi
611
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800612 # ONOS custom image handling
613 if [ '${onosImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-onos' ]; then
614 IFS=: read -r onosRepo onosTag <<< '${onosImg.trim()}'
615 EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag "
616 fi
617
618 # set BBSim parameters
619 EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} '
620
621 # disable the securityContext, this is a development cluster
622 EXTRA_HELM_FLAGS+='--set securityContext.enabled=false '
623
624 # No persistent-volume-claims in Atomix
625 EXTRA_HELM_FLAGS+="--set atomix.persistence.enabled=false "
626
627 echo "Installing with the following extra arguments:"
628 echo $EXTRA_HELM_FLAGS
629
630 # if it's newer than voltha-2.4 set the correct BBSIM_CFG
631 if [ '${release.trim()}' != 'voltha-2.4' ]; then
632 export BBSIM_CFG="$WORKSPACE/kind-voltha/configs/bbsim-sadis-${workflow}.yaml"
633 fi
634
635 # Use custom built images
636
637 if [ '\$GERRIT_PROJECT' == 'voltha-go' ]; then
638 EXTRA_HELM_FLAGS+="--set images.rw_core.repository=${dockerRegistry}/voltha/voltha-rw-core,images.rw_core.tag=voltha-scale "
639 fi
640
641 if [ '\$GERRIT_PROJECT' == 'voltha-openolt-adapter' ]; then
642 EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=${dockerRegistry}/voltha/voltha-openolt-adapter,images.adapter_open_olt.tag=voltha-scale "
643 fi
644
645 if [ '\$GERRIT_PROJECT' == 'voltha-openonu-adapter' ]; then
646 EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=${dockerRegistry}/voltha/voltha-openonu-adapter,images.adapter_open_onu.tag=voltha-scale "
647 fi
648
Andrea Campanellaed026982020-11-20 10:06:42 +0100649 if [ '\$GERRIT_PROJECT' == 'voltha-openonu-adapter-go' ]; then
650 EXTRA_HELM_FLAGS+="--set images.adapter_open_onu_go.repository=${dockerRegistry}/voltha/voltha-openonu-adapter-go,images.adapter_open_onu_go.tag=voltha-scale "
651 fi
652
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800653 if [ '\$GERRIT_PROJECT' == 'ofagent-go' ]; then
654 EXTRA_HELM_FLAGS+="--set images.ofagent.repository=${dockerRegistry}/voltha/voltha-ofagent-go,images.ofagent.tag=voltha-scale "
655 fi
656
657 if [ '\$GERRIT_PROJECT' == 'voltha-onos' ]; then
658 EXTRA_HELM_FLAGS+="--set images.onos.repository=${dockerRegistry}/voltha/voltha-onos,images.onos.tag=voltha-scale "
659 fi
660
661 if [ '\$GERRIT_PROJECT' == 'bbsim' ]; then
662 EXTRA_HELM_FLAGS+="--set images.bbsim.repository=${dockerRegistry}/voltha/bbsim,images.bbsim.tag=voltha-scale "
663 fi
664
665 ./voltha up
666 """
667 }
668 }
669}
670
671def test_voltha_stacks(numberOfStacks) {
672 for (int i = 1; i <= numberOfStacks.toInteger(); i++) {
673 stage("Test VOLTHA stack " + i) {
674 timeout(time: 15, unit: 'MINUTES') {
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800675 sh """
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800676 export VOLTCONFIG="$HOME/.volt/config-voltha${i}"
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800677 ROBOT_PARAMS="-v stackId:${i} \
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800678 -v olt:${olts} \
679 -v pon:${pons} \
680 -v onu:${onus} \
681 -v workflow:${workflow} \
682 -v withEapol:${withEapol} \
683 -v withDhcp:${withDhcp} \
684 -v withIgmp:${withIgmp} \
685 --noncritical non-critical \
686 -e teardown "
687
688 if [ ${withEapol} = false ] ; then
689 ROBOT_PARAMS+="-e authentication "
690 fi
691
692 if [ ${withDhcp} = false ] ; then
693 ROBOT_PARAMS+="-e dhcp "
694 fi
695
696 if [ ${provisionSubscribers} = false ] ; then
697 # if we're not considering subscribers then we don't care about authentication and dhcp
698 ROBOT_PARAMS+="-e authentication -e provision -e flow-after -e dhcp "
699 fi
700
701 if [ ${withFlows} = false ] ; then
702 ROBOT_PARAMS+="-i setup -i activation "
703 fi
704
705 cd $WORKSPACE/voltha-system-tests
706 source ./vst_venv/bin/activate
Matteo Scandolo5f6c5492020-11-12 17:37:25 -0800707 robot -d $WORKSPACE/RobotLogs/voltha${i} \
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800708 \$ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
Matteo Scandolof7ca6312020-11-16 15:57:15 -0800709
710 # collect results
711 python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/voltha${i}/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time-voltha${i}.txt || true
712 cat $WORKSPACE/execution-time-voltha${i}.txt
Matteo Scandolodc4608c2020-11-12 16:48:16 -0800713 """
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800714 }
715 }
Matteo Scandolo4b006ae2020-11-09 16:14:40 -0800716 }
717}