blob: 27daa516c38ccff1aa7faad9b7796ac42933afda [file] [log] [blame]
Matteo Scandolofff6e062020-04-29 13:36:33 -07001// 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
19pipeline {
20
21 /* no label, executor is determined by JJB */
22 agent {
23 label "${params.buildNode}"
24 }
25 options {
26 timeout(time: 90, unit: 'MINUTES')
27 }
28 environment {
29 KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
30 VOLTCONFIG="$HOME/.volt/config-minimal"
Andrea Campanella919361e2020-09-21 14:27:19 +020031 PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Matteo Scandolo4d1a12f2020-12-07 16:17:12 -080032 NAME="minimal"
Matteo Scandolofff6e062020-04-29 13:36:33 -070033 FANCY=0
34 WITH_SIM_ADAPTERS="n"
35 WITH_RADIUS="y"
36 WITH_BBSIM="y"
37 DEPLOY_K8S="y"
38 VOLTHA_LOG_LEVEL="DEBUG"
Andrea Campanellaa0cd5be2020-09-07 15:47:18 +020039 CONFIG_SADIS="external"
40 BBSIM_CFG="configs/bbsim-sadis-att.yaml"
Matteo Scandolofff6e062020-04-29 13:36:33 -070041 ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs"
Matteo Scandolo697b8b82021-01-27 13:07:59 -080042 EXTRA_HELM_FLAGS=" --set global.image_registry=mirror.registry.opennetworking.org/ --set defaults.image_registry=mirror.registry.opennetworking.org/ "
Matteo Scandolofff6e062020-04-29 13:36:33 -070043 }
Matteo Scandolofff6e062020-04-29 13:36:33 -070044 stages {
Andrea Campanella919361e2020-09-21 14:27:19 +020045 stage('Clone kind-voltha') {
Matteo Scandolofff6e062020-04-29 13:36:33 -070046 steps {
Andrea Campanella919361e2020-09-21 14:27:19 +020047 checkout([
48 $class: 'GitSCM',
49 userRemoteConfigs: [[
50 url: "https://gerrit.opencord.org/kind-voltha",
51 refspec: "${kindVolthaChange}"
52 ]],
53 branches: [[ name: "master", ]],
54 extensions: [
55 [$class: 'WipeWorkspace'],
56 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
57 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
58 ],
59 ])
60 sh """
61 if [ '${kindVolthaChange}' != '' ] ; then
62 cd $WORKSPACE/kind-voltha
63 git fetch https://gerrit.opencord.org/kind-voltha ${kindVolthaChange} && git checkout FETCH_HEAD
64 fi
65 """
Matteo Scandolofff6e062020-04-29 13:36:33 -070066 }
67 }
Andrea Campanella919361e2020-09-21 14:27:19 +020068 stage('Clone voltha-system-tests') {
69 steps {
70 checkout([
71 $class: 'GitSCM',
72 userRemoteConfigs: [[
73 url: "https://gerrit.opencord.org/voltha-system-tests",
74 refspec: "${volthaSystemTestsChange}"
75 ]],
76 branches: [[ name: "${branch}", ]],
77 extensions: [
78 [$class: 'WipeWorkspace'],
79 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
80 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
81 ],
82 ])
83 sh """
84 if [ '${volthaSystemTestsChange}' != '' ] ; then
85 cd $WORKSPACE/voltha-system-tests
86 git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
87 fi
88 """
89 }
90 }
91 // If the repo under test is not kind-voltha
92 // then download it and checkout the patch
93 stage('Download Patch') {
94 when {
95 expression {
96 return "${gerritProject}" != 'kind-voltha';
97 }
98 }
99 steps {
100 checkout([
101 $class: 'GitSCM',
102 userRemoteConfigs: [[
103 url: "https://gerrit.opencord.org/${gerritProject}",
104 refspec: "${gerritRefspec}"
105 ]],
106 branches: [[ name: "${branch}", ]],
107 extensions: [
108 [$class: 'WipeWorkspace'],
109 [$class: 'RelativeTargetDirectory', relativeTargetDir: "${gerritProject}"],
110 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
111 ],
112 ])
113 sh """
114 pushd $WORKSPACE/${gerritProject}
115 git fetch https://gerrit.opencord.org/${gerritProject} ${gerritRefspec} && git checkout FETCH_HEAD
116 echo "Currently on commit: \n"
117 git log -1 --oneline
118 popd
119 """
120 }
121 }
122 // If the repo under test is kind-voltha we don't need to download it again,
123 // as we already have it, simply checkout the patch
124 stage('Checkout kind-voltha patch') {
125 when {
126 expression {
127 return "${gerritProject}" == 'kind-voltha';
128 }
129 }
Matteo Scandolofff6e062020-04-29 13:36:33 -0700130 steps {
131 sh """
Andrea Campanella919361e2020-09-21 14:27:19 +0200132 cd $WORKSPACE/kind-voltha
133 git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
134 """
Matteo Scandolofff6e062020-04-29 13:36:33 -0700135 }
136 }
137 stage('Create K8s Cluster') {
138 steps {
139 sh """
Andrea Campanella919361e2020-09-21 14:27:19 +0200140 cd $WORKSPACE/kind-voltha/
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800141
142 if [ "${branch}" != "master" ]; then
143 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
144 source "$WORKSPACE/kind-voltha/releases/${branch}"
145 else
146 echo "on master, using default settings for kind-voltha"
147 fi
148
Matteo Scandolofff6e062020-04-29 13:36:33 -0700149 JUST_K8S=y ./voltha up
Andrea Campanella919361e2020-09-21 14:27:19 +0200150 bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
Matteo Scandolofff6e062020-04-29 13:36:33 -0700151 """
152 }
153 }
154
155 stage('Build Images') {
156 steps {
157 sh """
Matteo Scandolo4adf1192020-12-15 09:44:14 -1000158 make -C $WORKSPACE/voltha-openonu-adapter-go DOCKER_REGISTRY=mirror.registry.opennetworking.org/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
Matteo Scandolofff6e062020-04-29 13:36:33 -0700159 """
160 }
161 }
162
163 stage('Push Images') {
164 steps {
165 sh '''
166 docker images | grep citest
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800167 for image in \$(docker images -f "reference=*/*/*citest" --format "{{.Repository}}"); do echo "Pushing \$image to nodes"; kind load docker-image \$image:citest --name voltha-\$NAME --nodes voltha-\$NAME-control-plane,voltha-\$NAME-worker,voltha-\$NAME-worker2; done
Matteo Scandolofff6e062020-04-29 13:36:33 -0700168 '''
169 }
170 }
171 stage('Deploy Voltha') {
172 steps {
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800173 sh """
TorstenThieme326e7972021-01-19 14:27:59 +0000174 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
Matteo Scandolofff6e062020-04-29 13:36:33 -0700175
176 IMAGES="adapter_open_onu_go"
177
178 for I in \$IMAGES
179 do
180 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
181 done
182
Andrea Campanella919361e2020-09-21 14:27:19 +0200183 cd $WORKSPACE/kind-voltha/
Matteo Scandolofff6e062020-04-29 13:36:33 -0700184 echo \$EXTRA_HELM_FLAGS
Matteo Scandoloaca27622020-12-11 09:04:07 -0800185
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800186 if [ "${branch}" != "master" ]; then
187 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
188 source "$WORKSPACE/kind-voltha/releases/${branch}"
189 else
190 echo "on master, using default settings for kind-voltha"
191 fi
192
Matteo Scandolofff6e062020-04-29 13:36:33 -0700193 ./voltha up
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800194 """
Matteo Scandolofff6e062020-04-29 13:36:33 -0700195 }
196 }
197
Andrea Campanellaa2f32c32020-12-17 18:30:47 +0100198 stage('Run E2E Tests 1t8gem') {
199 environment {
200 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem"
201 }
202 steps {
203 sh '''
204 cd $WORKSPACE/kind-voltha/
205 #source $NAME-env.sh
206 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
207
TorstenThieme326e7972021-01-19 14:27:59 +0000208 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
Andrea Campanellaa2f32c32020-12-17 18:30:47 +0100209
210 IMAGES="adapter_open_onu_go"
211
212 for I in \$IMAGES
213 do
214 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
215 done
216 #1t8gem
217 mkdir -p $WORKSPACE/1t8gem
Matteo Scandolof566cc42020-12-11 14:05:29 -0800218 _TAG=kail-1t8gem kail -n voltha -n default > $WORKSPACE/1t8gem/onos-voltha-combined.log &
219
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800220 if [ "${branch}" != "master" ]; then
221 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
222 source "$WORKSPACE/kind-voltha/releases/${branch}"
223 else
224 echo "on master, using default settings for kind-voltha"
225 fi
226
Andrea Campanellaa2f32c32020-12-17 18:30:47 +0100227 DEPLOY_K8S=n ./voltha up
228
Matteo Scandolof566cc42020-12-11 14:05:29 -0800229 mkdir -p $ROBOT_LOGS_DIR/1t8gem
Andrea Campanellaa2f32c32020-12-17 18:30:47 +0100230 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
Matteo Scandolof566cc42020-12-11 14:05:29 -0800231 export TARGET_1T8GEM=1t8gem-openonu-go-adapter-test
Matteo Scandoloaf7ef5f2021-01-22 16:09:03 -0800232 export NAME=voltha_voltha
Matteo Scandolof566cc42020-12-11 14:05:29 -0800233
234 make -C $WORKSPACE/voltha-system-tests \$TARGET_1T8GEM || true
235
236 # stop logging
237 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t8gem" | grep -v grep | awk '{print $1}')"
238 if [ -n "$P_IDS" ]; then
239 echo $P_IDS
240 for P_ID in $P_IDS; do
241 kill -9 $P_ID
242 done
243 fi
244
245 # get pods information
246 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true
Matteo Scandolofff6e062020-04-29 13:36:33 -0700247 '''
248 }
249 }
Andrea Campanella40ff56f2020-05-11 15:22:29 +0200250
TorstenThieme987a7302020-09-23 08:54:58 +0000251 stage('DT workflow') {
252 environment {
253 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DTWorkflow"
254 }
255 steps {
256 sh '''
257 cd $WORKSPACE/kind-voltha/
258 #source $NAME-env.sh
259 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
260
TorstenThieme326e7972021-01-19 14:27:59 +0000261 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme987a7302020-09-23 08:54:58 +0000262
263 IMAGES="adapter_open_onu_go"
264
265 for I in \$IMAGES
266 do
267 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
268 done
269
270 # Workflow-specific flags
271 export WITH_RADIUS=no
272 export WITH_EAPOL=no
273 export WITH_DHCP=no
274 export WITH_IGMP=no
275 export CONFIG_SADIS="external"
276 export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
277
Matteo Scandoloaca27622020-12-11 09:04:07 -0800278 # start logging
279 mkdir -p $WORKSPACE/dt
280 _TAG=kail-dt kail -n voltha -n default > $WORKSPACE/dt/onos-voltha-combined.log &
281
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800282 if [ "${branch}" != "master" ]; then
283 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
284 source "$WORKSPACE/kind-voltha/releases/${branch}"
285 else
286 echo "on master, using default settings for kind-voltha"
287 fi
288
TorstenThieme987a7302020-09-23 08:54:58 +0000289 DEPLOY_K8S=n ./voltha up
290
291 mkdir -p $ROBOT_LOGS_DIR
292 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
293
294 # By default, all tests tagged 'sanityDt' are run. This covers basic functionality
295 # like running through the DT workflow for a single subscriber.
296 export TARGET=sanity-kind-dt
297
298 # If the Gerrit comment contains a line with "functional tests" then run the full
299 # functional test suite. This covers tests tagged either 'sanityDt' or 'functionalDt'.
300 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
301 REGEX="functional tests"
302 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
303 TARGET=functional-single-kind-dt
304 fi
305
306 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Matteo Scandoloaca27622020-12-11 09:04:07 -0800307
308 # stop logging
309 P_IDS="$(ps e -ww -A | grep "_TAG=kail-dt" | grep -v grep | awk '{print $1}')"
310 if [ -n "$P_IDS" ]; then
311 echo $P_IDS
312 for P_ID in $P_IDS; do
313 kill -9 $P_ID
314 done
315 fi
316
317 # get pods information
Matteo Scandolof566cc42020-12-11 14:05:29 -0800318 kubectl get pods -o wide --all-namespaces > $WORKSPACE/dt/pods.txt || true
TorstenThieme987a7302020-09-23 08:54:58 +0000319 '''
320 }
321 }
322
TorstenThieme30b7a322020-09-28 11:13:18 +0000323 stage('ATT workflow') {
324 environment {
325 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ATTWorkflow"
326 }
327 steps {
328 sh '''
329 cd $WORKSPACE/kind-voltha/
330 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
Matteo Scandolofff6e062020-04-29 13:36:33 -0700331
TorstenThieme326e7972021-01-19 14:27:59 +0000332 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme30b7a322020-09-28 11:13:18 +0000333
334 IMAGES="adapter_open_onu_go"
335
336 for I in \$IMAGES
337 do
338 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
339 done
340
341 # Workflow-specific flags
342 export WITH_RADIUS=yes
343 export WITH_EAPOL=yes
344 export WITH_BBSIM=yes
345 export DEPLOY_K8S=yes
346 export CONFIG_SADIS="external"
347 export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
348
349 if [ "${gerritProject}" = "voltctl" ]; then
350 export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
351 cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
352 md5sum $WORKSPACE/kind-voltha/bin/voltctl
353 fi
354
Matteo Scandoloaca27622020-12-11 09:04:07 -0800355 # start logging
356 mkdir -p $WORKSPACE/att
357 _TAG=kail-att kail -n voltha -n default > $WORKSPACE/att/onos-voltha-combined.log &
358
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800359 if [ "${branch}" != "master" ]; then
360 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
361 source "$WORKSPACE/kind-voltha/releases/${branch}"
362 else
363 echo "on master, using default settings for kind-voltha"
364 fi
365
TorstenThieme30b7a322020-09-28 11:13:18 +0000366 DEPLOY_K8S=n ./voltha up
367
368 mkdir -p $ROBOT_LOGS_DIR
369 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
370
371 # By default, all tests tagged 'sanity' are run. This covers basic functionality
372 # like running through the ATT workflow for a single subscriber.
373 export TARGET=sanity-single-kind
374
375 # If the Gerrit comment contains a line with "functional tests" then run the full
376 # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
377 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
378 REGEX="functional tests"
379 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
380 TARGET=functional-single-kind
381 fi
382
383 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Matteo Scandoloaca27622020-12-11 09:04:07 -0800384
385 # stop logging
386 P_IDS="$(ps e -ww -A | grep "_TAG=kail-att" | grep -v grep | awk '{print $1}')"
387 if [ -n "$P_IDS" ]; then
388 echo $P_IDS
389 for P_ID in $P_IDS; do
390 kill -9 $P_ID
391 done
392 fi
393
394 # get pods information
Matteo Scandolof566cc42020-12-11 14:05:29 -0800395 kubectl get pods -o wide --all-namespaces > $WORKSPACE/att/pods.txt || true
TorstenThieme30b7a322020-09-28 11:13:18 +0000396 '''
397 }
398 }
Andrea Campanella50e3a0b2020-10-01 06:28:08 +0000399
400 stage('TT workflow') {
401 environment {
402 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/TTWorkflow"
403 }
404 steps {
405 sh '''
406 cd $WORKSPACE/kind-voltha/
407 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
408
TorstenThieme326e7972021-01-19 14:27:59 +0000409 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
Andrea Campanella50e3a0b2020-10-01 06:28:08 +0000410
411 IMAGES="adapter_open_onu_go"
412
413 for I in \$IMAGES
414 do
415 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
416 done
417
418 # Workflow-specific flags
419 export WITH_RADIUS=no
420 export WITH_EAPOL=no
421 export WITH_DHCP=yes
422 export WITH_IGMP=yes
423 export CONFIG_SADIS="external"
424 export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
425
Matteo Scandoloaca27622020-12-11 09:04:07 -0800426 # start logging
427 mkdir -p $WORKSPACE/tt
428 _TAG=kail-tt kail -n voltha -n default > $WORKSPACE/tt/onos-voltha-combined.log &
429
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800430 if [ "${branch}" != "master" ]; then
431 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
432 source "$WORKSPACE/kind-voltha/releases/${branch}"
433 else
434 echo "on master, using default settings for kind-voltha"
435 fi
436
Andrea Campanella50e3a0b2020-10-01 06:28:08 +0000437 DEPLOY_K8S=n ./voltha up
438
439 mkdir -p $ROBOT_LOGS_DIR
440 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
441
442 # By default, all tests tagged 'sanityTt' are run. This covers basic functionality
443 # like running through the TT workflow for a single subscriber.
444 export TARGET=sanity-kind-tt
445
446 # If the Gerrit comment contains a line with "functional tests" then run the full
447 # functional test suite. This covers tests tagged either 'sanityTt' or 'functionalTt'.
448 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
449 REGEX="functional tests"
450 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
451 TARGET=functional-single-kind-tt
452 fi
453
454 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Matteo Scandoloaca27622020-12-11 09:04:07 -0800455
456 # stop logging
457 P_IDS="$(ps e -ww -A | grep "_TAG=kail-tt" | grep -v grep | awk '{print $1}')"
458 if [ -n "$P_IDS" ]; then
459 echo $P_IDS
460 for P_ID in $P_IDS; do
461 kill -9 $P_ID
462 done
463 fi
464
465 # get pods information
Matteo Scandolof566cc42020-12-11 14:05:29 -0800466 kubectl get pods -o wide --all-namespaces > $WORKSPACE/tt/pods.txt || true
Andrea Campanella50e3a0b2020-10-01 06:28:08 +0000467 '''
468 }
469 }
TorstenThieme30b7a322020-09-28 11:13:18 +0000470 }
Matteo Scandolofff6e062020-04-29 13:36:33 -0700471 post {
472 always {
473 sh '''
474 set +e
Matteo Scandolo7eba41c2020-12-15 08:59:36 -1000475 # get pods information
Matteo Scandolo697b8b82021-01-27 13:07:59 -0800476 kubectl get pods -o wide --all-namespaces
Matteo Scandolo7eba41c2020-12-15 08:59:36 -1000477 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}"
478 helm ls
Matteo Scandolofff6e062020-04-29 13:36:33 -0700479
480 sync
481 pkill kail || true
Andrea Campanella919361e2020-09-21 14:27:19 +0200482 md5sum $WORKSPACE/kind-voltha/bin/voltctl
Matteo Scandolofff6e062020-04-29 13:36:33 -0700483
484 ## Pull out errors from log files
485 extract_errors_go() {
486 echo
487 echo "Error summary for $1:"
488 grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
489 echo
490 }
491
492 extract_errors_python() {
493 echo
494 echo "Error summary for $1:"
495 grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
496 echo
497 }
498
Matteo Scandolo7eba41c2020-12-15 08:59:36 -1000499 extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log || true
500 extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log || true
501 extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log || true
502 extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log || true
Matteo Scandolofff6e062020-04-29 13:36:33 -0700503
Matteo Scandolo7eba41c2020-12-15 08:59:36 -1000504 gzip $WORKSPACE/onos-voltha-combined.log || true
Matteo Scandolofff6e062020-04-29 13:36:33 -0700505 '''
Andrea Campanella40ff56f2020-05-11 15:22:29 +0200506 step([$class: 'RobotPublisher',
507 disableArchiveOutput: false,
508 logFileName: 'RobotLogs/*/log*.html',
509 otherFiles: '',
510 outputFileName: 'RobotLogs/*/output*.xml',
511 outputPath: '.',
512 passThreshold: 100,
513 reportFileName: 'RobotLogs/*/report*.html',
514 unstableThreshold: 0]);
Matteo Scandoloaca27622020-12-11 09:04:07 -0800515 archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt'
Matteo Scandolofff6e062020-04-29 13:36:33 -0700516 }
517 }
518}