blob: 9fb741ac6f19f7e7de0fd0135284587da17da774 [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",
Matteo Scandolo9aae4952020-09-14 13:05:53 -070045 ]],
46 branches: [[ name: "master", ]],
47 extensions: [
48 [$class: 'WipeWorkspace'],
49 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
50 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
51 ],
52 ])
Matteo Scandolo01d596c2020-09-18 16:37:55 -070053 sh """
54 cd $WORKSPACE/kind-voltha
55 git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
56 """
Kailashaad71012019-08-27 10:36:53 -070057 }
58 }
Matteo Scandolo9aae4952020-09-14 13:05:53 -070059 stage('Clone voltha-system-tests') {
Kailashaad71012019-08-27 10:36:53 -070060 steps {
Matteo Scandolo9aae4952020-09-14 13:05:53 -070061 checkout([
62 $class: 'GitSCM',
63 userRemoteConfigs: [[
64 url: "https://gerrit.opencord.org/voltha-system-tests",
Matteo Scandolo9aae4952020-09-14 13:05:53 -070065 ]],
66 branches: [[ name: "${branch}", ]],
67 extensions: [
68 [$class: 'WipeWorkspace'],
69 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
70 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
71 ],
72 ])
Matteo Scandolo01d596c2020-09-18 16:37:55 -070073 sh """
74 cd $WORKSPACE/voltha-system-tests
75 git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
76 """
Matteo Scandolo9aae4952020-09-14 13:05:53 -070077 }
78 }
Matteo Scandolo8fc674c2020-09-14 18:05:37 -070079 // If the repo under test is not kind-voltha
80 // then download it and checkout the patch
Matteo Scandolo9aae4952020-09-14 13:05:53 -070081 stage('Download Patch') {
Matteo Scandolo8fc674c2020-09-14 18:05:37 -070082 when {
83 expression {
84 return "${gerritProject}" != 'kind-voltha';
85 }
86 }
Matteo Scandolo9aae4952020-09-14 13:05:53 -070087 steps {
88 checkout([
89 $class: 'GitSCM',
90 userRemoteConfigs: [[
91 url: "https://gerrit.opencord.org/${gerritProject}",
Matteo Scandolo9aae4952020-09-14 13:05:53 -070092 ]],
93 branches: [[ name: "${branch}", ]],
94 extensions: [
95 [$class: 'WipeWorkspace'],
96 [$class: 'RelativeTargetDirectory', relativeTargetDir: "${gerritProject}"],
97 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
98 ],
99 ])
Kailashaad71012019-08-27 10:36:53 -0700100 sh """
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700101 pushd $WORKSPACE/${gerritProject}
Matteo Scandolo01d596c2020-09-18 16:37:55 -0700102 git fetch https://gerrit.opencord.org/${gerritProject} ${gerritRefspec} && git checkout FETCH_HEAD
103
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700104 echo "Currently on commit: \n"
105 git log -1 --oneline
106 popd
107 """
Kailashaad71012019-08-27 10:36:53 -0700108 }
109 }
Matteo Scandolo8fc674c2020-09-14 18:05:37 -0700110 // If the repo under test is kind-voltha we don't need to download it again,
111 // as we already have it, simply checkout the patch
112 stage('Checkout kind-voltha patch') {
113 when {
114 expression {
115 return "${gerritProject}" == 'kind-voltha';
116 }
117 }
118 steps {
119 sh """
120 cd $WORKSPACE/kind-voltha
121 git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
122 """
123 }
124 }
Kailashaad71012019-08-27 10:36:53 -0700125 stage('Create K8s Cluster') {
126 steps {
127 sh """
Zack Williams03ebb272020-03-27 09:42:33 -0700128 if [ "${branch}" != "master" ]; then
129 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700130 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700131 else
132 echo "on master, using default settings for kind-voltha"
133 fi
134
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700135 cd $WORKSPACE/kind-voltha/
Andy Bavier4af02722020-01-15 10:24:24 -0700136 JUST_K8S=y ./voltha up
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700137 bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
Kailashaad71012019-08-27 10:36:53 -0700138 """
139 }
140 }
141
142 stage('Build Images') {
143 steps {
144 sh """
Andy Bavierb99c3d32020-02-18 11:14:17 -0700145 make-local () {
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700146 make -C $WORKSPACE/\$1 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
Andy Bavierb99c3d32020-02-18 11:14:17 -0700147 }
Andy Bavier0ed77062020-02-18 10:09:19 -0700148 if [ "${gerritProject}" = "pyvoltha" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700149 make -C $WORKSPACE/pyvoltha/ dist
150 export LOCAL_PYVOLTHA=$WORKSPACE/pyvoltha/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700151 make-local voltha-openonu-adapter
152 elif [ "${gerritProject}" = "voltha-lib-go" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700153 make -C $WORKSPACE/voltha-lib-go/ build
154 export LOCAL_LIB_GO=$WORKSPACE/voltha-lib-go/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700155 make-local voltha-go
156 make-local voltha-openolt-adapter
157 elif [ "${gerritProject}" = "voltha-protos" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700158 make -C $WORKSPACE/voltha-protos/ build
159 export LOCAL_PROTOS=$WORKSPACE/voltha-protos/
Andy Bavierb99c3d32020-02-18 11:14:17 -0700160 make-local voltha-go
161 make-local voltha-openolt-adapter
162 make-local voltha-openonu-adapter
163 make-local ofagent-py
Andy Bavier178c47b2020-04-01 13:05:43 -0700164 elif [ "${gerritProject}" = "voltctl" ]; then
Andy Bavierdecde3f2020-04-01 15:29:43 -0700165 # Set and handle GOPATH and PATH
166 export GOPATH=\${GOPATH:-$WORKSPACE/go}
167 export PATH=\$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:\$GOPATH/bin
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700168 make -C $WORKSPACE/voltctl/ build
Andy Bavier4318f8d2020-04-09 13:50:53 -0700169 elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|kind-voltha)\$ ]]; then
Andy Bavierb99c3d32020-02-18 11:14:17 -0700170 make-local ${gerritProject}
Andy Bavier07615f92019-10-03 12:31:18 -0700171 fi
Kailashaad71012019-08-27 10:36:53 -0700172 """
173 }
174 }
175
176 stage('Push Images') {
177 steps {
178 sh '''
Zack Williams03ebb272020-03-27 09:42:33 -0700179 if [ "${branch}" != "master" ]; then
180 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700181 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700182 else
183 echo "on master, using default settings for kind-voltha"
184 fi
185
Andy Bavierb5c8caf2020-04-06 14:12:07 -0700186 if ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|voltctl|kind-voltha)\$ ]]; then
Andy Bavier07615f92019-10-03 12:31:18 -0700187 export GOROOT=/usr/local/go
188 export GOPATH=\$(pwd)
Andy Bavier07615f92019-10-03 12:31:18 -0700189 docker images | grep citest
Matteo Scandolo2e64c102020-07-29 19:41:02 -0700190 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 -0700191 fi
Kailashaad71012019-08-27 10:36:53 -0700192 '''
193 }
194 }
Andy Bavier8b118b72020-04-28 12:59:30 -0700195
196 stage('ATT workflow') {
197 environment {
198 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ATTWorkflow"
199 }
Kailashaad71012019-08-27 10:36:53 -0700200 steps {
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700201 sh '''
Zack Williams03ebb272020-03-27 09:42:33 -0700202 if [ "${branch}" != "master" ]; then
203 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700204 source "$WORKSPACE/kind-voltha/releases/${branch}"
Zack Williams03ebb272020-03-27 09:42:33 -0700205 else
206 echo "on master, using default settings for kind-voltha"
207 fi
208
Andy Bavier8b118b72020-04-28 12:59:30 -0700209 # Workflow-specific flags
210 export WITH_RADIUS=yes
211 export WITH_BBSIM=yes
212 export DEPLOY_K8S=yes
Matteo Scandolo3d6a21d2020-09-04 07:34:24 -0700213 export CONFIG_SADIS="external"
214 export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
Andy Bavier8b118b72020-04-28 12:59:30 -0700215
Zack Williams03ebb272020-03-27 09:42:33 -0700216 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
Kailashaad71012019-08-27 10:36:53 -0700217
Andy Bavier4af02722020-01-15 10:24:24 -0700218 IMAGES=""
Kailashaad71012019-08-27 10:36:53 -0700219 if [ "${gerritProject}" = "voltha-go" ]; then
Andy Bavier4af02722020-01-15 10:24:24 -0700220 IMAGES="rw_core ro_core "
221 elif [ "${gerritProject}" = "ofagent-py" ]; then
Andy Bavier8d816422020-03-23 15:34:26 -0700222 IMAGES="ofagent_py "
223 EXTRA_HELM_FLAGS+="--set use_ofagent_go=false "
Andy Bavier9c412a82020-03-23 12:00:28 -0700224 elif [ "${gerritProject}" = "ofagent-go" ]; then
Andy Bavier8d816422020-03-23 15:34:26 -0700225 IMAGES="ofagent_go "
Andy Bavier4af02722020-01-15 10:24:24 -0700226 elif [ "${gerritProject}" = "voltha-onos" ]; then
227 IMAGES="onos "
228 elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then
229 IMAGES="adapter_open_olt "
230 elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then
231 IMAGES="adapter_open_onu "
232 elif [ "${gerritProject}" = "voltha-api-server" ]; then
233 IMAGES="afrouter afrouterd "
234 elif [ "${gerritProject}" = "bbsim" ]; then
235 IMAGES="bbsim "
Andy Bavierec0c10d2020-02-14 13:06:27 -0700236 elif [ "${gerritProject}" = "pyvoltha" ]; then
237 IMAGES="adapter_open_onu "
Andy Bavierb99c3d32020-02-18 11:14:17 -0700238 elif [ "${gerritProject}" = "voltha-lib-go" ]; then
239 IMAGES="rw_core ro_core adapter_open_olt "
240 elif [ "${gerritProject}" = "voltha-protos" ]; then
241 IMAGES="rw_core ro_core adapter_open_olt adapter_open_onu ofagent "
Zack Williams04997502019-10-04 14:32:20 -0700242 else
Andy Bavier4af02722020-01-15 10:24:24 -0700243 echo "No images to push"
Scott Baker9ac23712019-10-02 09:26:50 -0700244 fi
245
Andy Bavier4af02722020-01-15 10:24:24 -0700246 for I in \$IMAGES
247 do
248 EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
249 done
250
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700251 if [ "${gerritProject}" = "voltha-helm-charts" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700252 export CHART_PATH=$WORKSPACE/voltha-helm-charts
Andy Bavier45406342019-10-02 16:45:40 -0700253 export VOLTHA_CHART=\$CHART_PATH/voltha
254 export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
255 export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
Kailash Khalasiaf3a2a62019-10-02 09:44:08 -0700256 helm dep update \$VOLTHA_CHART
257 helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
258 helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
259 fi
260
Andy Bavier178c47b2020-04-01 13:05:43 -0700261 if [ "${gerritProject}" = "voltctl" ]; then
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700262 export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
263 cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
264 md5sum $WORKSPACE/kind-voltha/bin/voltctl
Andy Bavier178c47b2020-04-01 13:05:43 -0700265 fi
266
Andy Bavier8b118b72020-04-28 12:59:30 -0700267 printenv
Andy Bavier4af02722020-01-15 10:24:24 -0700268 kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
Kailashaad71012019-08-27 10:36:53 -0700269
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700270 cd $WORKSPACE/kind-voltha/
Andy Bavier8b118b72020-04-28 12:59:30 -0700271 ./voltha up
272
Matteo Scandolo39045a92020-07-29 08:58:29 -0700273 # $NAME-env.sh contains the environment we used
Andy Bavier8b118b72020-04-28 12:59:30 -0700274 # Save value of EXTRA_HELM_FLAGS there to use in subsequent stages
Matteo Scandolo39045a92020-07-29 08:58:29 -0700275 echo export EXTRA_HELM_FLAGS=\\"\$EXTRA_HELM_FLAGS\\" >> $NAME-env.sh
Andy Bavier8b118b72020-04-28 12:59:30 -0700276
277 mkdir -p $ROBOT_LOGS_DIR
Andy Bavierd9870042020-06-23 13:16:47 -0700278 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
Andy Bavierdb003082020-02-04 11:57:36 -0700279
280 # By default, all tests tagged 'sanity' are run. This covers basic functionality
281 # like running through the ATT workflow for a single subscriber.
Andy Bavier8b118b72020-04-28 12:59:30 -0700282 export TARGET=sanity-single-kind
Andy Bavierdb003082020-02-04 11:57:36 -0700283
284 # If the Gerrit comment contains a line with "functional tests" then run the full
285 # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
286 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
287 REGEX="functional tests"
288 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
Andy Bavier8b118b72020-04-28 12:59:30 -0700289 TARGET=functional-single-kind
Andy Bavierdb003082020-02-04 11:57:36 -0700290 fi
291
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700292 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Andy Bavier8b118b72020-04-28 12:59:30 -0700293 '''
294 }
295 }
296
297 stage('DT workflow') {
298 environment {
299 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DTWorkflow"
300 }
301 steps {
302 sh '''
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700303 cd $WORKSPACE/kind-voltha/
Matteo Scandolo39045a92020-07-29 08:58:29 -0700304 source $NAME-env.sh
Andy Bavier8b118b72020-04-28 12:59:30 -0700305 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
306
307 # Workflow-specific flags
308 export WITH_RADIUS=no
309 export WITH_EAPOL=no
310 export WITH_DHCP=no
311 export WITH_IGMP=no
Matteo Scandolo3d6a21d2020-09-04 07:34:24 -0700312 export CONFIG_SADIS="external"
313 export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
Andy Bavier8b118b72020-04-28 12:59:30 -0700314
315 DEPLOY_K8S=n ./voltha up
316
317 mkdir -p $ROBOT_LOGS_DIR
Andy Bavierd9870042020-06-23 13:16:47 -0700318 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
Andy Bavier8b118b72020-04-28 12:59:30 -0700319
320 # By default, all tests tagged 'sanityDt' are run. This covers basic functionality
321 # like running through the DT workflow for a single subscriber.
322 export TARGET=sanity-kind-dt
323
324 # If the Gerrit comment contains a line with "functional tests" then run the full
325 # functional test suite. This covers tests tagged either 'sanityDt' or 'functionalDt'.
326 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
327 REGEX="functional tests"
328 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
329 TARGET=functional-single-kind-dt
330 fi
331
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700332 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Kailashaad71012019-08-27 10:36:53 -0700333 '''
334 }
335 }
Matteo Scandolo294133a2020-09-04 11:19:43 -0700336
337 stage('TT workflow') {
338 environment {
339 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/TTWorkflow"
340 }
341 steps {
342 sh '''
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700343 cd $WORKSPACE/kind-voltha/
Matteo Scandolo294133a2020-09-04 11:19:43 -0700344 source $NAME-env.sh
345 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
346
347 # Workflow-specific flags
348 export WITH_RADIUS=no
349 export WITH_EAPOL=no
350 export WITH_DHCP=yes
351 export WITH_IGMP=yes
352 export CONFIG_SADIS="external"
353 export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
354
355 DEPLOY_K8S=n ./voltha up
356
357 mkdir -p $ROBOT_LOGS_DIR
358 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
359
360 # By default, all tests tagged 'sanityTt' are run. This covers basic functionality
361 # like running through the TT workflow for a single subscriber.
362 export TARGET=sanity-kind-tt
363
364 # If the Gerrit comment contains a line with "functional tests" then run the full
365 # functional test suite. This covers tests tagged either 'sanityTt' or 'functionalTt'.
366 # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
367 REGEX="functional tests"
368 if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
369 TARGET=functional-single-kind-tt
370 fi
371
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700372 make -C $WORKSPACE/voltha-system-tests \$TARGET || true
Matteo Scandolo294133a2020-09-04 11:19:43 -0700373 '''
374 }
375 }
Kailashaad71012019-08-27 10:36:53 -0700376 }
377
378 post {
379 always {
380 sh '''
Andy Bavier07615f92019-10-03 12:31:18 -0700381 set +e
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700382 cp $WORKSPACE/kind-voltha/install-$NAME.log $WORKSPACE/
Matteo Scandolo97b12572020-04-13 12:44:46 -0700383 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
384 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
Kailashaad71012019-08-27 10:36:53 -0700385 kubectl get nodes -o wide
386 kubectl get pods -o wide
387 kubectl get pods -n voltha -o wide
Andy Bavier4af02722020-01-15 10:24:24 -0700388
389 sync
390 pkill kail || true
Matteo Scandolo9aae4952020-09-14 13:05:53 -0700391 md5sum $WORKSPACE/kind-voltha/bin/voltctl
Andy Bavier4af02722020-01-15 10:24:24 -0700392
393 ## Pull out errors from log files
394 extract_errors_go() {
395 echo
396 echo "Error summary for $1:"
397 grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
398 echo
399 }
400
401 extract_errors_python() {
402 echo
403 echo "Error summary for $1:"
404 grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
405 echo
406 }
407
408 extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
409 extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
410 extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
411 extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
412
Andy Bavier2178d102020-02-06 16:22:11 -0700413 gzip $WORKSPACE/onos-voltha-combined.log
Kailashaad71012019-08-27 10:36:53 -0700414 '''
415 step([$class: 'RobotPublisher',
416 disableArchiveOutput: false,
Andy Bavier8b118b72020-04-28 12:59:30 -0700417 logFileName: 'RobotLogs/*/log*.html',
Kailashaad71012019-08-27 10:36:53 -0700418 otherFiles: '',
Andy Bavier8b118b72020-04-28 12:59:30 -0700419 outputFileName: 'RobotLogs/*/output*.xml',
Kailashaad71012019-08-27 10:36:53 -0700420 outputPath: '.',
Andy Bavier8b118b72020-04-28 12:59:30 -0700421 passThreshold: 100,
422 reportFileName: 'RobotLogs/*/report*.html',
Kailashaad71012019-08-27 10:36:53 -0700423 unstableThreshold: 0]);
Andy Bavier2178d102020-02-06 16:22:11 -0700424 archiveArtifacts artifacts: '*.log,*.gz'
Kailashaad71012019-08-27 10:36:53 -0700425 }
426 }
427}