blob: aed5edc01fe7457a1f902ed5ca1acaf86d1aa3f8 [file] [log] [blame]
Matteo Scandolofbcbdb82020-05-06 15:41:32 -07001// 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 {
24 timeout(time: 30, unit: 'MINUTES')
25 }
26 environment {
27 KUBECONFIG="$HOME/.kube/config"
28 VOLTCONFIG="$HOME/.volt/config"
Matteo Scandolob70b3e02020-05-07 11:50:26 -070029 SSHPASS="karaf"
Matteo Scandoloa731f8f2020-05-11 10:27:26 -070030 PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070031 TYPE="minimal"
32 FANCY=0
33 WITH_SIM_ADAPTERS="no"
34 WITH_RADIUS="yes"
35 WITH_BBSIM="yes"
36 LEGACY_BBSIM_INDEX="no"
37 DEPLOY_K8S="no"
38 CONFIG_SADIS="external"
Matteo Scandolo0430f672020-05-07 11:50:26 -070039 WITH_KAFKA="kafka.default.svc.cluster.local"
Matteo Scandoloa8afe122020-05-11 10:45:56 -070040 WITH_ETCD="etcd-cluster-client.default.svc.cluster.local"
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070041
42 // install everything in the default namespace
43 VOLTHA_NS="default"
44 ADAPTER_NS="default"
45 INFRA_NS="default"
46 BBSIM_NS="default"
47
Matteo Scandolo0430f672020-05-07 11:50:26 -070048 // configurable options
49 WITH_EAPOL="${withEapol}"
50 WITH_DHCP="${withDhcp}"
51 WITH_IGMP="${withIgmp}"
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070052 VOLTHA_LOG_LEVEL="${logLevel}"
53 NUM_OF_BBSIM="${olts}"
Matteo Scandolo0430f672020-05-07 11:50:26 -070054 NUM_OF_OPENONU="${openonuAdapterReplicas}"
55 NUM_OF_ONOS="${onosReplicas}"
56 NUM_OF_ATOMIX="${atomixReplicas}"
Matteo Scandoloa731f8f2020-05-11 10:27:26 -070057 WITH_PPROF="${withProfiling}"
58 EXTRA_HELM_FLAGS="${extraHelmFlags}"
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070059
Matteo Scandolo0430f672020-05-07 11:50:26 -070060 VOLTHA_CHART="${volthaChart}"
61 VOLTHA_BBSIM_CHART="${bbsimChart}"
62 VOLTHA_ADAPTER_OPEN_OLT_CHART="${openoltAdapterChart}"
63 VOLTHA_ADAPTER_OPEN_ONU_CHART="${openonuAdapterChart}"
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070064 }
65
66 stages {
67 stage ('Cleanup') {
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070068 steps {
Matteo Scandoloa731f8f2020-05-11 10:27:26 -070069 timeout(time: 11, unit: 'MINUTES') {
70 sh returnStdout: false, script: """
71 test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down
Matteo Scandolob70b3e02020-05-07 11:50:26 -070072
Matteo Scandoloa731f8f2020-05-11 10:27:26 -070073 for hchart in \$(helm list -q | grep -E -v 'docker-registry|kafkacat|etcd-operator');
74 do
75 echo "Purging chart: \${hchart}"
76 helm delete --purge "\${hchart}"
77 done
78 bash /home/cord/voltha-scale/wait_for_pods.sh
Matteo Scandolob70b3e02020-05-07 11:50:26 -070079
Matteo Scandoloa731f8f2020-05-11 10:27:26 -070080 cd $WORKSPACE
81 rm -rf $WORKSPACE/*
82 """
83 }
Matteo Scandolofbcbdb82020-05-06 15:41:32 -070084 }
85 }
86 stage('Clone kind-voltha') {
87 steps {
88 checkout([
89 $class: 'GitSCM',
90 userRemoteConfigs: [[ url: "https://gerrit.opencord.org/kind-voltha", ]],
91 branches: [[ name: "master", ]],
92 extensions: [
93 [$class: 'WipeWorkspace'],
94 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
95 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
96 ],
97 ])
98 }
99 }
100 stage('Clone voltha-system-tests') {
101 steps {
102 checkout([
103 $class: 'GitSCM',
104 userRemoteConfigs: [[ url: "https://gerrit.opencord.org/voltha-system-tests", ]],
105 branches: [[ name: "master", ]],
106 extensions: [
107 [$class: 'WipeWorkspace'],
108 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
109 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
110 ],
111 ])
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700112 script {
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700113 sh(script:"""
114 if [ ${volthaSystemTestsChange} != '' ] ; then
115 cd voltha-system-tests;
116 git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
117 fi
118 """)
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700119 }
120 }
121 }
Matteo Scandolo0430f672020-05-07 11:50:26 -0700122 stage('Deploy common infrastructure') {
Matteo Scandoloa8afe122020-05-11 10:45:56 -0700123 // includes monitoring, kafka, etcd
Matteo Scandolo0430f672020-05-07 11:50:26 -0700124 steps {
125 sh '''
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700126 helm install -n kafka incubator/kafka --version 0.13.3 --set replicas=3 --set persistence.enabled=false --set zookeeper.replicaCount=3 --set zookeeper.persistence.enabled=false --version=0.15.3
Matteo Scandolo0430f672020-05-07 11:50:26 -0700127
Matteo Scandoloa8afe122020-05-11 10:45:56 -0700128 helm install --set clusterName=etcd-cluster --set autoCompactionRetention=1 --set clusterSize=3 --set defaults.log_level=WARN --namespace default -n etcd-cluster onf/voltha-etcd-cluster
129
Matteo Scandolo0430f672020-05-07 11:50:26 -0700130 if [ ${withMonitoring} = true ] ; then
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700131 helm install -n nem-monitoring cord/nem-monitoring \
132 --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \
133 --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
Matteo Scandolo0430f672020-05-07 11:50:26 -0700134 fi
135
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700136 # TODO download this file from https://github.com/opencord/helm-charts/blob/master/scripts/wait_for_pods.sh
Matteo Scandolo0430f672020-05-07 11:50:26 -0700137 bash /home/cord/voltha-scale/wait_for_pods.sh
138 '''
139 }
140 }
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700141 stage('Deploy Voltha') {
142 steps {
143 script {
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700144 // TODO install etcd outside kind-voltha (no need to redeploy the operator everytime)
145 sh returnStdout: false, script: """
Matteo Scandolo0430f672020-05-07 11:50:26 -0700146 export EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} '
147
148 # BBSim custom image handling
149 IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700150 EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag "
Matteo Scandolo0430f672020-05-07 11:50:26 -0700151
152 # VOLTHA and ofAgent custom image handling
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700153 IFS=: read -r rwCoreRepo rwCoreTag <<< ${rwCoreImg}
Matteo Scandolo0430f672020-05-07 11:50:26 -0700154 IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700155 EXTRA_HELM_FLAGS+="--set images.rw_core.repository=\$rwCoreRepo,images.rw_core.tag=\$rwCoreTag,images.ofagent_go.repository=\$ofAgentRepo,images.ofagent_go.tag=\$ofAgentTag "
Matteo Scandolo0430f672020-05-07 11:50:26 -0700156
157 # OpenOLT custom image handling
158 IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700159 EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=\$openoltAdapterRepo,images.adapter_open_olt.tag=\$openoltAdapterTag "
Matteo Scandolo0430f672020-05-07 11:50:26 -0700160
161 # OpenONU custom image handling
162 IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700163 EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=\$openonuAdapterRepo,images.adapter_open_onu.tag=\$openonuAdapterTag "
Matteo Scandolo0430f672020-05-07 11:50:26 -0700164
165 # ONOS custom image handling
166 IFS=: read -r onosRepo onosTag <<< ${onosImg}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700167 EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag "
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700168
169
170 cd $WORKSPACE/kind-voltha/
171
172 ./voltha up
173 """
174 }
175 }
176 }
Matteo Scandolo0430f672020-05-07 11:50:26 -0700177 stage('Configuration') {
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700178 steps {
179 sh '''
Matteo Scandolo0430f672020-05-07 11:50:26 -0700180 # Always deactivate org.opencord.kafka
181 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.kafka
182
183 #Setting link discovery
184 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}
185
186 #Setting LOG level to ${logLevel}
187 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set ${logLevel}
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700188 kubectl exec $(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print $1}') -- bbsimctl log ${logLevel} false
Matteo Scandolo0430f672020-05-07 11:50:26 -0700189
190 if [ ${withEapol} = false ] || [ ${withFlows} = false ]; then
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700191 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.aaa
Matteo Scandolo0430f672020-05-07 11:50:26 -0700192 fi
193
194 if [ ${withDhcp} = false ] || [ ${withFlows} = false ]; then
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700195 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.dhcpl2relay
Matteo Scandolo0430f672020-05-07 11:50:26 -0700196 fi
197
198 if [ ${withIgmp} = false ] || [ ${withFlows} = false ]; then
199 # FIXME will actually affected the tests only after VOL-3054 is addressed
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700200 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.igmpproxy
201 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.mcast
Matteo Scandolo0430f672020-05-07 11:50:26 -0700202 fi
203
204 if [ ${withFlows} = false ]; then
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700205 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt
Matteo Scandolo0430f672020-05-07 11:50:26 -0700206 fi
207
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700208 if [ ${withMibTemplate} = true ] ; then
209 rm -f BBSM-12345123451234512345-00000000000001-v1.json
210 wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json
211 cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it $(kubectl get pods | grep etcd-cluster | awk 'NR==1{print $1}') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
212 fi
213 '''
214 }
215 }
216 stage('Run Test') {
217 steps {
Matteo Scandoloa731f8f2020-05-11 10:27:26 -0700218 sh '''
219 mkdir -p $WORKSPACE/RobotLogs
220 cd $WORKSPACE/voltha-system-tests
221 make vst_venv
222 '''
223 sh '''
224 if [ ${withProfiling} = true ] ; then
225 mkdir -p $WORKSPACE/logs/pprof
226 echo $PATH
227 #Creating Python script for ONU Detection
228 cat << EOF > $WORKSPACE/pprof.sh
229i=0
230while [[ true ]]; do
231 ((i++))
232 go tool pprof -png http://127.0.0.1:6060/debug/pprof/heap > $WORKSPACE/logs/pprof/rw-core-heap-\\$i.png
233 go tool pprof -png http://127.0.0.1:6060/debug/pprof/goroutine > $WORKSPACE/logs/pprof/rw-core-goroutine-\\$i.png
234 go tool pprof -png http://127.0.0.1:6060/debug/pprof/block > $WORKSPACE/logs/pprof/rw-core-block-\\$i.png
235 go tool pprof -png http://127.0.0.1:6060/debug/pprof/mutex > $WORKSPACE/logs/pprof/rw-core-mutex-\\$i.png
236
237 go tool pprof -png http://127.0.0.1:6061/debug/pprof/heap > $WORKSPACE/logs/pprof/openolt-heap-\\$i.png
238 go tool pprof -png http://127.0.0.1:6061/debug/pprof/goroutine > $WORKSPACE/logs/pprof/openolt-goroutine-\\$i.png
239 go tool pprof -png http://127.0.0.1:6061/debug/pprof/block > $WORKSPACE/logs/pprof/openolt-block-\\$i.png
240 go tool pprof -png http://127.0.0.1:6061/debug/pprof/mutex > $WORKSPACE/logs/pprof/openolt-mutex-\\$i.png
241
242 sleep 10
243done
244EOF
245
246 _TAG="pprof"
247 _TAG=$_TAG bash $WORKSPACE/pprof.sh &
248 fi
249 '''
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700250 timeout(time: 11, unit: 'MINUTES') {
251 sh '''
252 ROBOT_PARAMS="-v olt:${olts} \
253 -v pon:${pons} \
254 -v onu:${onus} \
255 -v workflow:${workflow} \
256 -v withEapol:${withEapol} \
257 -v withDhcp:${withDhcp} \
258 -v withIgmp:${withIgmp} \
259 --noncritical non-critical \
260 -e teardown "
Matteo Scandolo0430f672020-05-07 11:50:26 -0700261
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700262 if [ ${withEapol} = false ] ; then
263 ROBOT_PARAMS+="-e authentication "
264 fi
Matteo Scandolo0430f672020-05-07 11:50:26 -0700265
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700266 if [ ${withDhcp} = false ] ; then
267 ROBOT_PARAMS+="-e dhcp "
268 fi
Matteo Scandolo0430f672020-05-07 11:50:26 -0700269
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700270 if [ ${provisionSubscribers} = false ] ; then
271 ROBOT_PARAMS+="-e provision -e flow-after "
272 fi
Matteo Scandolo0430f672020-05-07 11:50:26 -0700273
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700274 if [ ${withFlows} = false ] ; then
275 ROBOT_PARAMS+="-i setup -i activation "
276 fi
Matteo Scandolo0430f672020-05-07 11:50:26 -0700277
Matteo Scandoloa731f8f2020-05-11 10:27:26 -0700278 cd $WORKSPACE/voltha-system-tests
Matteo Scandolo9b0728b2020-05-11 08:25:57 -0700279 source ./vst_venv/bin/activate
280 robot -d $WORKSPACE/RobotLogs \
281 $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
282 '''
283 }
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700284 }
285 }
286 stage('Collect results') {
287 steps {
288 sh '''
289 cd voltha-system-tests
290 source ./vst_venv/bin/activate
Matteo Scandolo0430f672020-05-07 11:50:26 -0700291 python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time.txt
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700292 cat $WORKSPACE/execution-time.txt
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700293 '''
294 }
295 }
296 }
297 post {
298 always {
Matteo Scandoloa731f8f2020-05-11 10:27:26 -0700299 sh '''
300 if [ ${withProfiling} = true ] ; then
301 _TAG="pprof"
302 P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')"
303 if [ -n "$P_IDS" ]; then
304 echo $P_IDS
305 for P_ID in $P_IDS; do
306 kill -9 $P_ID
307 done
308 fi
309 fi
310 '''
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700311 plot([
312 csvFileName: 'scale-test.csv',
313 csvSeries: [
Matteo Scandolo272aed42020-05-08 15:05:57 -0700314 [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
315 [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
316 [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
317 [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
318 [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
319 [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
320 [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
321 [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700322 ],
323 group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true
324 ])
325 step([$class: 'RobotPublisher',
326 disableArchiveOutput: false,
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700327 logFileName: 'RobotLogs/log.html',
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700328 otherFiles: '',
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700329 outputFileName: 'RobotLogs/output.xml',
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700330 outputPath: '.',
331 passThreshold: 100,
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700332 reportFileName: 'RobotLogs/report.html',
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700333 unstableThreshold: 0]);
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700334 // count how many ONUs have been activated
Matteo Scandolo0430f672020-05-07 11:50:26 -0700335 sh '''
Matteo Scandolob70b3e02020-05-07 11:50:26 -0700336 mkdir -p $WORKSPACE/logs
337 echo "#-of-ONUs" > $WORKSPACE/logs/voltha-devices-count.txt
338 echo $(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) >> $WORKSPACE/logs/voltha-devices-count.txt
339 '''
340 // count how many ports have been discovered
341 sh '''
342 echo "#-of-ports" > $WORKSPACE/logs/onos-ports-count.txt
343 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports -e | grep BBSM | wc -l) >> $WORKSPACE/logs/onos-ports-count.txt
344 '''
345 // count how many flows have been provisioned
346 sh '''
347 echo "#-of-flows" > $WORKSPACE/logs/onos-flows-count.txt
348 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s | grep ADDED | wc -l) >> $WORKSPACE/logs/onos-flows-count.txt
349 '''
350 // dump and count the authenticated users
351 sh '''
352 if [ ${withOnosApps} = true ] && [ ${bbsimAuth} ] ; then
353 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users) >> $WORKSPACE/logs/onos-aaa-users.txt
354
355 echo "#-of-authenticated-users" > $WORKSPACE/logs/onos-aaa-count.txt
356 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l) >> $WORKSPACE/logs/onos-aaa-count.txt
357 fi
358 '''
359 // dump and count the dhcp users
360 sh '''
361 if [ ${withOnosApps} = true ] && [ ${bbsimDhcp} ] ; then
362 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations) >> $WORKSPACE/logs/onos-dhcp-allocations.txt
363
364 echo "#-of-dhcp-allocations" > $WORKSPACE/logs/onos-dhcp-count.txt
365 echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l) >> $WORKSPACE/logs/onos-dhcp-count.txt
366 fi
367 '''
368 // check which containers were used in this build
369 sh '''
370 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
371 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
372 '''
373 // dump all the VOLTHA devices informations
374 sh '''
375 voltctl device list -o json > $WORKSPACE/logs/device-list.json
376 python -m json.tool $WORKSPACE/logs/device-list.json > $WORKSPACE/logs/voltha-devices-list.json
377 '''
378 // dump all the BBSim(s) ONU informations
379 sh '''
380 BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}')
381 IDS=($BBSIM_IDS)
382
383 for bbsim in "${IDS[@]}"
384 do
385 kubectl exec -t $bbsim bbsimctl onu list > $WORKSPACE/logs/$bbsim-device-list.txt
386 done
387 '''
388 // get ports and flows from ONOS
389 sh '''
390 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports > $WORKSPACE/logs/onos-ports-list.txt
391 sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s > $WORKSPACE/logs/onos-flows-list.txt
392 '''
393 // get all the logs from kubernetes PODs
394 sh '''
Matteo Scandolo0430f672020-05-07 11:50:26 -0700395 kubectl get pods -o wide > $WORKSPACE/logs/pods.txt
396 kubectl logs -l app=adapter-open-olt > $WORKSPACE/logs/open-olt-logs.logs
397 kubectl logs -l app=adapter-open-onu > $WORKSPACE/logs/open-onu-logs.logs
398 kubectl logs -l app=rw-core > $WORKSPACE/logs/voltha-rw-core-logs.logs
399 kubectl logs -l app=ofagent > $WORKSPACE/logs/voltha-ofagent-logs.logs
400 kubectl logs -l app=bbsim > $WORKSPACE/logs/bbsim-logs.logs
401 kubectl logs -l app=onos > $WORKSPACE/logs/onos-logs.logs
402 '''
Matteo Scandoloa731f8f2020-05-11 10:27:26 -0700403 archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,execution-time.txt,logs/*,logs/pprof/*.png'
Matteo Scandolofbcbdb82020-05-06 15:41:32 -0700404 }
405 }
406}