blob: 3d91c7b9556aa63e4087269df74969aa96554bad [file] [log] [blame]
Kailashaad71012019-08-27 10:36:53 -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 {
Zack Williamsb3292082019-10-11 17:15:18 -070023 label "${params.buildNode}"
Kailashaad71012019-08-27 10:36:53 -070024 }
25 options {
Andy Bavier4af02722020-01-15 10:24:24 -070026 timeout(time: 90, unit: 'MINUTES')
27 }
28 environment {
Matteo Scandolo9aae4952020-09-14 13:05:53 -070029 PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Andy Bavier8b118b72020-04-28 12:59:30 -070030 VOLTHA_LOG_LEVEL="DEBUG"
Andy Bavier4af02722020-01-15 10:24:24 -070031 FANCY=0
32 WITH_SIM_ADAPTERS="n"
Matteo Scandolo39045a92020-07-29 08:58:29 -070033 NAME="test"
34 VOLTCONFIG="$HOME/.volt/config-$NAME"
35 KUBECONFIG="$HOME/.kube/kind-config-voltha-$NAME"
Kailashaad71012019-08-27 10:36:53 -070036 }
37
38 stages {
Matteo Scandolo9aae4952020-09-14 13:05:53 -070039 stage('Clone kind-voltha') {
Kailashaad71012019-08-27 10:36:53 -070040 steps {
Matteo Scandolo9aae4952020-09-14 13:05:53 -070041 checkout([
42 $class: 'GitSCM',
43 userRemoteConfigs: [[
44 url: "https://gerrit.opencord.org/kind-voltha",
45 refspec: "${kindVolthaChange}"
46 ]],
47 branches: [[ name: "master", ]],
48 extensions: [
49 [$class: 'WipeWorkspace'],
50 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
51 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
52 ],
53 ])
Kailashaad71012019-08-27 10:36:53 -070054 }
55 }
Matteo Scandolo9aae4952020-09-14 13:05:53 -070056 stage('Clone voltha-system-tests') {
Kailashaad71012019-08-27 10:36:53 -070057 steps {
Matteo Scandolo9aae4952020-09-14 13:05:53 -070058 checkout([
59 $class: 'GitSCM',
60 userRemoteConfigs: [[
61 url: "https://gerrit.opencord.org/voltha-system-tests",
62 refspec: "${volthaSystemTestsChange}"
63 ]],
64 branches: [[ name: "${branch}", ]],
65 extensions: [
66 [$class: 'WipeWorkspace'],
67 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
68 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
69 ],
70 ])
71 }
72 }
Matteo Scandolo8fc674c2020-09-14 18:05:37 -070073 // If the repo under test is not kind-voltha
74 // then download it and checkout the patch
Matteo Scandolo9aae4952020-09-14 13:05:53 -070075 stage('Download Patch') {
Matteo Scandolo8fc674c2020-09-14 18:05:37 -070076 when {
77 expression {
78 return "${gerritProject}" != 'kind-voltha';
79 }
80 }
Matteo Scandolo9aae4952020-09-14 13:05:53 -070081 steps {
82 checkout([
83 $class: 'GitSCM',
84 userRemoteConfigs: [[
85 url: "https://gerrit.opencord.org/${gerritProject}",
86 refspec: "${gerritRefspec}"
87 ]],
88 branches: [[ name: "${branch}", ]],
89 extensions: [
90 [$class: 'WipeWorkspace'],
91 [$class: 'RelativeTargetDirectory', relativeTargetDir: "${gerritProject}"],
92 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
93 ],
94 ])
Kailashaad71012019-08-27 10:36:53 -070095 sh """
Matteo Scandolo9aae4952020-09-14 13:05:53 -070096 pushd $WORKSPACE/${gerritProject}
97 echo "Currently on commit: \n"
98 git log -1 --oneline
99 popd
100 """
Kailashaad71012019-08-27 10:36:53 -0700101 }
102 }
Matteo Scandolo8fc674c2020-09-14 18:05:37 -0700103 // If the repo under test is kind-voltha we don't need to download it again,
104 // as we already have it, simply checkout the patch
105 stage('Checkout kind-voltha patch') {
106 when {
107 expression {
108 return "${gerritProject}" == 'kind-voltha';
109 }
110 }
111 steps {
112 sh """
113 cd $WORKSPACE/kind-voltha
114 git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
115 """
116 }
117 }
Kailashaad71012019-08-27 10:36:53 -0700118 stage('Create K8s Cluster') {
119 steps {
120 sh """
Zack Williams03ebb272020-03-27 09:42:33 -0700121 if [ "${branch}" != "master" ]; then
122 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700123 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700124 else
125 echo "on master, using default settings for kind-voltha"
126 fi
127
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700128 cd $WORKSPACE/kind-voltha/
Andy Bavier4af02722020-01-15 10:24:24 -0700129 JUST_K8S=y ./voltha up
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700130 bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
Kailashaad71012019-08-27 10:36:53 -0700131 """
132 }
133 }
134
135 stage('Build Images') {
136 steps {
137 sh """
Andy Bavierb99c3d32020-02-18 11:14:17 -0700138 make-local () {
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700139 make -C $WORKSPACE/\$1 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
Andy Bavierb99c3d32020-02-18 11:14:17 -0700140 }
Andy Bavier0ed77062020-02-18 10:09:19 -0700141 if [ "${gerritProject}" = "pyvoltha" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700142 make -C $WORKSPACE/pyvoltha/ dist
143 export LOCAL_PYVOLTHA=$WORKSPACE/pyvoltha/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700144 make-local voltha-openonu-adapter
145 elif [ "${gerritProject}" = "voltha-lib-go" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700146 make -C $WORKSPACE/voltha-lib-go/ build
147 export LOCAL_LIB_GO=$WORKSPACE/voltha-lib-go/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700148 make-local voltha-go
149 make-local voltha-openolt-adapter
150 elif [ "${gerritProject}" = "voltha-protos" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700151 make -C $WORKSPACE/voltha-protos/ build
152 export LOCAL_PROTOS=$WORKSPACE/voltha-protos/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700153 make-local voltha-go
154 make-local voltha-openolt-adapter
155 make-local voltha-openonu-adapter
156 make-local ofagent-py
Andy Bavier178c47b2020-04-01 13:05:43 -0700157 elif [ "${gerritProject}" = "voltctl" ]; then
Andy Bavierdecde3f2020-04-01 15:29:43 -0700158 # Set and handle GOPATH and PATH
159 export GOPATH=\${GOPATH:-$WORKSPACE/go}
160 export PATH=\$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:\$GOPATH/bin
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700161 make -C $WORKSPACE/voltctl/ build
Andy Bavier4318f8d2020-04-09 13:50:53 -0700162 elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|kind-voltha)\$ ]]; then
Andy Bavierb99c3d32020-02-18 11:14:17 -0700163 make-local ${gerritProject}
Andy Bavier07615f92019-10-03 12:31:18 -0700164 fi
Kailashaad71012019-08-27 10:36:53 -0700165 """
166 }
167 }
168
169 stage('Push Images') {
170 steps {
171 sh '''
Zack Williams03ebb272020-03-27 09:42:33 -0700172 if [ "${branch}" != "master" ]; then
173 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700174 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700175 else
176 echo "on master, using default settings for kind-voltha"
177 fi
178
Andy Bavierb5c8caf2020-04-06 14:12:07 -0700179 if ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|voltctl|kind-voltha)\$ ]]; then
Andy Bavier07615f92019-10-03 12:31:18 -0700180 export GOROOT=/usr/local/go
181 export GOPATH=\$(pwd)
Andy Bavier07615f92019-10-03 12:31:18 -0700182 docker images | grep citest
Matteo Scandolo2e64c102020-07-29 19:41:02 -0700183 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-worker,voltha-\$NAME-worker2; done
Andy Bavier07615f92019-10-03 12:31:18 -0700184 fi
Kailashaad71012019-08-27 10:36:53 -0700185 '''
186 }
187 }
Andy Bavier8b118b72020-04-28 12:59:30 -0700188
189 stage('ATT workflow') {
190 environment {
191 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ATTWorkflow"
192 }
Kailashaad71012019-08-27 10:36:53 -0700193 steps {
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700194 sh '''
Zack Williams03ebb272020-03-27 09:42:33 -0700195 if [ "${branch}" != "master" ]; then
196 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700197 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700198 else
199 echo "on master, using default settings for kind-voltha"
200 fi
201
Andy Bavier8b118b72020-04-28 12:59:30 -0700202 # Workflow-specific flags
203 export WITH_RADIUS=yes
204 export WITH_BBSIM=yes
205 export DEPLOY_K8S=yes
Matteo Scandolo3d6a21d2020-09-04 07:34:24 -0700206 export CONFIG_SADIS="external"
207 export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
Andy Bavier8b118b72020-04-28 12:59:30 -0700208
Zack Williams03ebb272020-03-27 09:42:33 -0700209 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
Kailashaad71012019-08-27 10:36:53 -0700210
Andy Bavier4af02722020-01-15 10:24:24 -0700211 IMAGES=""
Kailashaad71012019-08-27 10:36:53 -0700212 if [ "${gerritProject}" = "voltha-go" ]; then
Andy Bavier4af02722020-01-15 10:24:24 -0700213 IMAGES="rw_core ro_core "
214 elif [ "${gerritProject}" = "ofagent-py" ]; then
Andy Bavier8d816422020-03-23 15:34:26 -0700215 IMAGES="ofagent_py "
216 EXTRA_HELM_FLAGS+="--set use_ofagent_go=false "
Andy Bavier9c412a82020-03-23 12:00:28 -0700217 elif [ "${gerritProject}" = "ofagent-go" ]; then
Andy Bavier8d816422020-03-23 15:34:26 -0700218 IMAGES="ofagent_go "
Andy Bavier4af02722020-01-15 10:24:24 -0700219 elif [ "${gerritProject}" = "voltha-onos" ]; then
220 IMAGES="onos "
221 elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then
222 IMAGES="adapter_open_olt "
223 elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then
224 IMAGES="adapter_open_onu "
225 elif [ "${gerritProject}" = "voltha-api-server" ]; then
226 IMAGES="afrouter afrouterd "
227 elif [ "${gerritProject}" = "bbsim" ]; then
228 IMAGES="bbsim "
Andy Bavierec0c10d2020-02-14 13:06:27 -0700229 elif [ "${gerritProject}" = "pyvoltha" ]; then
230 IMAGES="adapter_open_onu "
Andy Bavierb99c3d32020-02-18 11:14:17 -0700231 elif [ "${gerritProject}" = "voltha-lib-go" ]; then
232 IMAGES="rw_core ro_core adapter_open_olt "
233 elif [ "${gerritProject}" = "voltha-protos" ]; then
234 IMAGES="rw_core ro_core adapter_open_olt adapter_open_onu ofagent "
Zack Williams04997502019-10-04 14:32:20 -0700235 else
Andy Bavier4af02722020-01-15 10:24:24 -0700236 echo "No images to push"
Scott Baker9ac23712019-10-02 09:26:50 -0700237 fi
238
Andy Bavier4af02722020-01-15 10:24:24 -0700239 for I in \$IMAGES
240 do
241 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
242 done
243
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700244 if [ "${gerritProject}" = "voltha-helm-charts" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700245 export CHART_PATH=$WORKSPACE/voltha-helm-charts
Andy Bavier45406342019-10-02 16:45:40 -0700246 export VOLTHA_CHART=\$CHART_PATH/voltha
247 export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
248 export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700249 helm dep update \$VOLTHA_CHART
250 helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
251 helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
252 fi
253
Andy Bavier178c47b2020-04-01 13:05:43 -0700254 if [ "${gerritProject}" = "voltctl" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700255 export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
256 cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
257 md5sum $WORKSPACE/kind-voltha/bin/voltctl
Andy Bavier178c47b2020-04-01 13:05:43 -0700258 fi
259
Andy Bavier8b118b72020-04-28 12:59:30 -0700260 printenv
Andy Bavier4af02722020-01-15 10:24:24 -0700261 kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
Kailashaad71012019-08-27 10:36:53 -0700262
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700263 cd $WORKSPACE/kind-voltha/
Andy Bavier8b118b72020-04-28 12:59:30 -0700264 ./voltha up
265
Matteo Scandolo39045a92020-07-29 08:58:29 -0700266 # $NAME-env.sh contains the environment we used
Andy Bavier8b118b72020-04-28 12:59:30 -0700267 # Save value of EXTRA_HELM_FLAGS there to use in subsequent stages
Matteo Scandolo39045a92020-07-29 08:58:29 -0700268 echo export EXTRA_HELM_FLAGS=\\"\$EXTRA_HELM_FLAGS\\" >> $NAME-env.sh
Andy Bavier8b118b72020-04-28 12:59:30 -0700269
270 mkdir -p $ROBOT_LOGS_DIR
Andy Bavierd9870042020-06-23 13:16:47 -0700271 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
Andy Bavierdb003082020-02-04 11:57:36 -0700272
273 # By default, all tests tagged 'sanity' are run. This covers basic functionality
274 # like running through the ATT workflow for a single subscriber.
Andy Bavier8b118b72020-04-28 12:59:30 -0700275 export TARGET=sanity-single-kind
Andy Bavierdb003082020-02-04 11:57:36 -0700276
277 # If the Gerrit comment contains a line with "functional tests" then run the full
278 # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
279 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
280 REGEX="functional tests"
281 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
Andy Bavier8b118b72020-04-28 12:59:30 -0700282 TARGET=functional-single-kind
Andy Bavierdb003082020-02-04 11:57:36 -0700283 fi
284
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700285 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Andy Bavier8b118b72020-04-28 12:59:30 -0700286 '''
287 }
288 }
289
290 stage('DT workflow') {
291 environment {
292 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DTWorkflow"
293 }
294 steps {
295 sh '''
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700296 cd $WORKSPACE/kind-voltha/
Matteo Scandolo39045a92020-07-29 08:58:29 -0700297 source $NAME-env.sh
Andy Bavier8b118b72020-04-28 12:59:30 -0700298 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
299
300 # Workflow-specific flags
301 export WITH_RADIUS=no
302 export WITH_EAPOL=no
303 export WITH_DHCP=no
304 export WITH_IGMP=no
Matteo Scandolo3d6a21d2020-09-04 07:34:24 -0700305 export CONFIG_SADIS="external"
306 export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
Andy Bavier8b118b72020-04-28 12:59:30 -0700307
308 DEPLOY_K8S=n ./voltha up
309
310 mkdir -p $ROBOT_LOGS_DIR
Andy Bavierd9870042020-06-23 13:16:47 -0700311 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
Andy Bavier8b118b72020-04-28 12:59:30 -0700312
313 # By default, all tests tagged 'sanityDt' are run. This covers basic functionality
314 # like running through the DT workflow for a single subscriber.
315 export TARGET=sanity-kind-dt
316
317 # If the Gerrit comment contains a line with "functional tests" then run the full
318 # functional test suite. This covers tests tagged either 'sanityDt' or 'functionalDt'.
319 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
320 REGEX="functional tests"
321 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
322 TARGET=functional-single-kind-dt
323 fi
324
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700325 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Kailashaad71012019-08-27 10:36:53 -0700326 '''
327 }
328 }
Matteo Scandolo294133a2020-09-04 11:19:43 -0700329
330 stage('TT workflow') {
331 environment {
332 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/TTWorkflow"
333 }
334 steps {
335 sh '''
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700336 cd $WORKSPACE/kind-voltha/
Matteo Scandolo294133a2020-09-04 11:19:43 -0700337 source $NAME-env.sh
338 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
339
340 # Workflow-specific flags
341 export WITH_RADIUS=no
342 export WITH_EAPOL=no
343 export WITH_DHCP=yes
344 export WITH_IGMP=yes
345 export CONFIG_SADIS="external"
346 export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
347
348 DEPLOY_K8S=n ./voltha up
349
350 mkdir -p $ROBOT_LOGS_DIR
351 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
352
353 # By default, all tests tagged 'sanityTt' are run. This covers basic functionality
354 # like running through the TT workflow for a single subscriber.
355 export TARGET=sanity-kind-tt
356
357 # If the Gerrit comment contains a line with "functional tests" then run the full
358 # functional test suite. This covers tests tagged either 'sanityTt' or 'functionalTt'.
359 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
360 REGEX="functional tests"
361 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
362 TARGET=functional-single-kind-tt
363 fi
364
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700365 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Matteo Scandolo294133a2020-09-04 11:19:43 -0700366 '''
367 }
368 }
Kailashaad71012019-08-27 10:36:53 -0700369 }
370
371 post {
372 always {
373 sh '''
Andy Bavier07615f92019-10-03 12:31:18 -0700374 set +e
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700375 cp $WORKSPACE/kind-voltha/install-$NAME.log $WORKSPACE/
Matteo Scandolo97b12572020-04-13 12:44:46 -0700376 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
377 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
Kailashaad71012019-08-27 10:36:53 -0700378 kubectl get nodes -o wide
379 kubectl get pods -o wide
380 kubectl get pods -n voltha -o wide
Andy Bavier4af02722020-01-15 10:24:24 -0700381
382 sync
383 pkill kail || true
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700384 md5sum $WORKSPACE/kind-voltha/bin/voltctl
Andy Bavier4af02722020-01-15 10:24:24 -0700385
386 ## Pull out errors from log files
387 extract_errors_go() {
388 echo
389 echo "Error summary for $1:"
390 grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
391 echo
392 }
393
394 extract_errors_python() {
395 echo
396 echo "Error summary for $1:"
397 grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
398 echo
399 }
400
401 extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
402 extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
403 extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
404 extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
405
Andy Bavier2178d102020-02-06 16:22:11 -0700406 gzip $WORKSPACE/onos-voltha-combined.log
Kailashaad71012019-08-27 10:36:53 -0700407 '''
408 step([$class: 'RobotPublisher',
409 disableArchiveOutput: false,
Andy Bavier8b118b72020-04-28 12:59:30 -0700410 logFileName: 'RobotLogs/*/log*.html',
Kailashaad71012019-08-27 10:36:53 -0700411 otherFiles: '',
Andy Bavier8b118b72020-04-28 12:59:30 -0700412 outputFileName: 'RobotLogs/*/output*.xml',
Kailashaad71012019-08-27 10:36:53 -0700413 outputPath: '.',
Andy Bavier8b118b72020-04-28 12:59:30 -0700414 passThreshold: 100,
415 reportFileName: 'RobotLogs/*/report*.html',
Kailashaad71012019-08-27 10:36:53 -0700416 unstableThreshold: 0]);
Andy Bavier2178d102020-02-06 16:22:11 -0700417 archiveArtifacts artifacts: '*.log,*.gz'
Kailashaad71012019-08-27 10:36:53 -0700418 }
419 }
420}