blob: 7462c8590e12549cfbb6d969f6011dac141f411b [file] [log] [blame]
TorstenThieme326e7972021-01-19 14:27:59 +00001// 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 {
TorstenThieme685b89b2021-01-28 12:59:23 +000026 timeout(time: 130, unit: 'MINUTES')
TorstenThieme326e7972021-01-19 14:27:59 +000027 }
28 environment {
29 KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
30 VOLTCONFIG="$HOME/.volt/config-minimal"
31 PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
32 NAME="minimal"
33 FANCY=0
34 WITH_SIM_ADAPTERS="no"
35 WITH_RADIUS="yes"
36 WITH_BBSIM="yes"
37 DEPLOY_K8S="yes"
38 VOLTHA_LOG_LEVEL="DEBUG"
39 CONFIG_SADIS="external"
40 BBSIM_CFG="configs/bbsim-sadis-att.yaml"
41 ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
42 KARAF_HOME="${params.karafHome}"
43 DIAGS_PROFILE="VOLTHA_PROFILE"
44 NUM_OF_BBSIM="${olts}"
45 }
46 stages {
47 stage('Clone kind-voltha') {
48 steps {
49 checkout([
50 $class: 'GitSCM',
51 userRemoteConfigs: [[
52 url: "https://gerrit.opencord.org/kind-voltha",
53 // refspec: "${kindVolthaChange}"
54 ]],
55 branches: [[ name: "master", ]],
56 extensions: [
57 [$class: 'WipeWorkspace'],
58 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
59 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
60 ],
61 ])
62 }
63 }
64 stage('Cleanup') {
65 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -070066 timeout(time: 10, unit: 'MINUTES') {
67 sh """
68 if [ "${branch}" != "master" ]; then
69 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
70 source "$WORKSPACE/kind-voltha/releases/${branch}"
71 else
72 echo "on master, using default settings for kind-voltha"
73 fi
74 cd $WORKSPACE/kind-voltha/
75 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
76 """
77 }
TorstenThieme326e7972021-01-19 14:27:59 +000078 }
79 }
80 stage('Clone voltha-system-tests') {
81 steps {
82 checkout([
83 $class: 'GitSCM',
84 userRemoteConfigs: [[
85 url: "https://gerrit.opencord.org/voltha-system-tests",
86 // refspec: "${volthaSystemTestsChange}"
87 ]],
88 branches: [[ name: "${branch}", ]],
89 extensions: [
90 [$class: 'WipeWorkspace'],
91 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
92 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
93 ],
94 ])
95 }
96 }
97
98 stage('Deploy Voltha') {
99 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700100 timeout(time: 10, unit: 'MINUTES') {
101 sh """
102 export EXTRA_HELM_FLAGS=""
103 if [ "${branch}" != "master" ]; then
104 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
105 source "$WORKSPACE/kind-voltha/releases/${branch}"
106 else
107 echo "on master, using default settings for kind-voltha"
108 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000109
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700110 EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} --set defaults.image_registry=mirror.registry.opennetworking.org/ "
TorstenThieme326e7972021-01-19 14:27:59 +0000111
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700112 cd $WORKSPACE/kind-voltha/
113 ./voltha up
114 bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
115 """
116 }
TorstenThieme326e7972021-01-19 14:27:59 +0000117 }
118 }
119
120 stage('Run E2E Tests 1t1gem') {
121 environment {
122 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t1gem"
123 }
124 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700125 timeout(time: 10, unit: 'MINUTES') {
126 sh '''
127 # start logging
128 mkdir -p $WORKSPACE/1t1gem
129 _TAG=kail-1t1gem kail -n voltha -n default > $WORKSPACE/1t1gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000130
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700131 mkdir -p $ROBOT_LOGS_DIR/1t1gem
132 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
133 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000134
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700135 make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000136
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700137 # stop logging
138 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t1gem" | grep -v grep | awk '{print $1}')"
139 if [ -n "$P_IDS" ]; then
140 echo $P_IDS
141 for P_ID in $P_IDS; do
142 kill -9 $P_ID
143 done
144 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000145
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700146 # get pods information
147 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true
148 '''
149 }
TorstenThieme326e7972021-01-19 14:27:59 +0000150 }
151 }
152
153 stage('Run E2E Tests 1t4gem') {
154 environment {
155 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t4gem"
156 }
157 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700158 timeout(time: 10, unit: 'MINUTES') {
159 sh '''
160 if [ "${branch}" != "master" ]; then
161 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
162 source "$WORKSPACE/kind-voltha/releases/${branch}"
163 else
164 echo "on master, using default settings for kind-voltha"
165 fi
166 cd $WORKSPACE/kind-voltha/
167 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme582d0342021-01-25 14:16:55 +0000168
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700169 export EXTRA_HELM_FLAGS=""
170 if [ "${branch}" != "master" ]; then
171 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
172 source "$WORKSPACE/kind-voltha/releases/${branch}"
173 else
174 echo "on master, using default settings for kind-voltha"
175 fi
176 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme582d0342021-01-25 14:16:55 +0000177
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700178 # start logging
179 mkdir -p $WORKSPACE/1t4gem
180 _TAG=kail-1t4gem kail -n voltha -n default > $WORKSPACE/1t4gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000181
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700182 DEPLOY_K8S=n ./voltha up
TorstenThieme582d0342021-01-25 14:16:55 +0000183
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700184 mkdir -p $ROBOT_LOGS_DIR/1t4gem
185 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
186 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000187
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700188 make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000189
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700190 # stop logging
191 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t4gem" | grep -v grep | awk '{print $1}')"
192 if [ -n "$P_IDS" ]; then
193 echo $P_IDS
194 for P_ID in $P_IDS; do
195 kill -9 $P_ID
196 done
197 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000198
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700199 # get pods information
200 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true
201 '''
202 }
TorstenThieme326e7972021-01-19 14:27:59 +0000203 }
204 }
205
206 stage('Run E2E Tests 1t8gem') {
207 environment {
208 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem"
209 }
210 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700211 timeout(time: 10, unit: 'MINUTES') {
212 sh '''
213 if [ "${branch}" != "master" ]; then
214 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
215 source "$WORKSPACE/kind-voltha/releases/${branch}"
216 else
217 echo "on master, using default settings for kind-voltha"
218 fi
219 cd $WORKSPACE/kind-voltha/
220 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme582d0342021-01-25 14:16:55 +0000221
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700222 export EXTRA_HELM_FLAGS=""
223 if [ "${branch}" != "master" ]; then
224 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
225 source "$WORKSPACE/kind-voltha/releases/${branch}"
226 else
227 echo "on master, using default settings for kind-voltha"
228 fi
229 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme582d0342021-01-25 14:16:55 +0000230
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700231 # start logging
232 mkdir -p $WORKSPACE/1t8gem
233 _TAG=kail-1t8gem kail -n voltha -n default > $WORKSPACE/1t8gem/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000234
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700235 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000236
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700237 mkdir -p $ROBOT_LOGS_DIR/1t8gem
238 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
239 export KVSTOREPREFIX=voltha_voltha
TorstenThieme326e7972021-01-19 14:27:59 +0000240
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700241 make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000242
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700243 # stop logging
244 P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t8gem" | grep -v grep | awk '{print $1}')"
245 if [ -n "$P_IDS" ]; then
246 echo $P_IDS
247 for P_ID in $P_IDS; do
248 kill -9 $P_ID
249 done
250 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000251
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700252 # get pods information
253 kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true
254 '''
255 }
TorstenThieme326e7972021-01-19 14:27:59 +0000256 }
257 }
258
259 stage('Run MIB Upload Tests') {
TorstenThieme669258d2021-01-29 09:03:10 +0000260 when { beforeAgent true; expression { return "${olts}" == "1" } }
TorstenThieme326e7972021-01-19 14:27:59 +0000261 environment {
262 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/openonu-go-MIB"
263 }
264 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700265 timeout(time: 10, unit: 'MINUTES') {
266 sh '''
267 if [ "${branch}" != "master" ]; then
268 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
269 source "$WORKSPACE/kind-voltha/releases/${branch}"
270 else
271 echo "on master, using default settings for kind-voltha"
272 fi
273 cd $WORKSPACE/kind-voltha/
274 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000275
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700276 export EXTRA_HELM_FLAGS=""
277 if [ "${branch}" != "master" ]; then
278 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
279 source "$WORKSPACE/kind-voltha/releases/${branch}"
280 else
281 echo "on master, using default settings for kind-voltha"
282 fi
283 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
284 export EXTRA_HELM_FLAGS+="--set pon=2,onu=2,controlledActivation=only-onu "
TorstenThieme326e7972021-01-19 14:27:59 +0000285
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700286 # start logging
287 mkdir -p $WORKSPACE/mib
288 _TAG=kail-mib kail -n voltha -n default > $WORKSPACE/mib/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000289
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700290 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000291
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700292 mkdir -p $ROBOT_LOGS_DIR
293 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
294 export TARGET_DEFAULT=mib-upload-templating-openonu-go-adapter-test
TorstenThieme326e7972021-01-19 14:27:59 +0000295
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700296 make -C $WORKSPACE/voltha-system-tests \$TARGET_DEFAULT || true
TorstenThieme326e7972021-01-19 14:27:59 +0000297
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700298 # stop logging
299 P_IDS="$(ps e -ww -A | grep "_TAG=kail-mib" | grep -v grep | awk '{print $1}')"
300 if [ -n "$P_IDS" ]; then
301 echo $P_IDS
302 for P_ID in $P_IDS; do
303 kill -9 $P_ID
304 done
305 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000306
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700307 # get pods information
308 kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true
309 '''
310 }
TorstenThieme326e7972021-01-19 14:27:59 +0000311 }
312 }
313
314 stage('Reconcile DT workflow') {
315 environment {
316 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileDT"
317 }
318 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700319 timeout(time: 20, unit: 'MINUTES') {
320 sh '''
321 if [ "${branch}" != "master" ]; then
322 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
323 source "$WORKSPACE/kind-voltha/releases/${branch}"
324 else
325 echo "on master, using default settings for kind-voltha"
326 fi
327 cd $WORKSPACE/kind-voltha/
328 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000329
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700330 export EXTRA_HELM_FLAGS=""
331 if [ "${branch}" != "master" ]; then
332 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
333 source "$WORKSPACE/kind-voltha/releases/${branch}"
334 else
335 echo "on master, using default settings for kind-voltha"
336 fi
337 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000338
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700339 # Workflow-specific flags
340 export WITH_RADIUS=no
341 export WITH_EAPOL=no
342 export WITH_DHCP=no
343 export WITH_IGMP=no
344 export CONFIG_SADIS="external"
345 export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000346
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700347 # start logging
348 mkdir -p $WORKSPACE/reconciledt
349 _TAG=kail-reconcile-dt kail -n voltha -n default > $WORKSPACE/reconciledt/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000350
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700351 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000352
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700353 mkdir -p $ROBOT_LOGS_DIR
354 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000355
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700356 make -C $WORKSPACE/voltha-system-tests ${makeReconcileDtTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000357
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700358 # stop logging
359 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-dt" | 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
TorstenThieme326e7972021-01-19 14:27:59 +0000366
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700367 # get pods information
368 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true
369 '''
370 }
TorstenThieme326e7972021-01-19 14:27:59 +0000371 }
372 }
373
374 stage('Reconcile ATT workflow') {
375 environment {
376 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileATT"
377 }
378 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700379 timeout(time: 20, unit: 'MINUTES') {
380 sh '''
381 if [ "${branch}" != "master" ]; then
382 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
383 source "$WORKSPACE/kind-voltha/releases/${branch}"
384 else
385 echo "on master, using default settings for kind-voltha"
386 fi
387 cd $WORKSPACE/kind-voltha/
388 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000389
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700390 export EXTRA_HELM_FLAGS=""
391 if [ "${branch}" != "master" ]; then
392 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
393 source "$WORKSPACE/kind-voltha/releases/${branch}"
394 else
395 echo "on master, using default settings for kind-voltha"
396 fi
397 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000398
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700399 # Workflow-specific flags
400 export WITH_RADIUS=yes
401 export WITH_EAPOL=yes
402 export WITH_BBSIM=yes
403 export DEPLOY_K8S=yes
404 export CONFIG_SADIS="external"
405 export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000406
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700407 if [ "${gerritProject}" = "voltctl" ]; then
408 export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
409 cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
410 md5sum $WORKSPACE/kind-voltha/bin/voltctl
411 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000412
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700413 # start logging
414 mkdir -p $WORKSPACE/reconcileatt
415 _TAG=kail-reconcile-att kail -n voltha -n default > $WORKSPACE/reconcileatt/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000416
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700417 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000418
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700419 mkdir -p $ROBOT_LOGS_DIR
420 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000421
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700422 make -C $WORKSPACE/voltha-system-tests ${makeReconcileTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000423
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700424 # stop logging
425 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-att" | grep -v grep | awk '{print $1}')"
426 if [ -n "$P_IDS" ]; then
427 echo $P_IDS
428 for P_ID in $P_IDS; do
429 kill -9 $P_ID
430 done
431 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000432
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700433 # get pods information
434 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true
435 '''
436 }
TorstenThieme326e7972021-01-19 14:27:59 +0000437 }
438 }
439
440 stage('Reconcile TT workflow') {
441 environment {
442 ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileTT"
443 }
444 steps {
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700445 timeout(time: 20, unit: 'MINUTES') {
446 sh '''
447 if [ "${branch}" != "master" ]; then
448 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
449 source "$WORKSPACE/kind-voltha/releases/${branch}"
450 else
451 echo "on master, using default settings for kind-voltha"
452 fi
453 cd $WORKSPACE/kind-voltha/
454 WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
TorstenThieme326e7972021-01-19 14:27:59 +0000455
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700456 export EXTRA_HELM_FLAGS=""
457 if [ "${branch}" != "master" ]; then
458 echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
459 source "$WORKSPACE/kind-voltha/releases/${branch}"
460 else
461 echo "on master, using default settings for kind-voltha"
462 fi
463 export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
TorstenThieme326e7972021-01-19 14:27:59 +0000464
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700465 # Workflow-specific flags
466 export WITH_RADIUS=no
467 export WITH_EAPOL=no
468 export WITH_DHCP=yes
469 export WITH_IGMP=yes
470 export CONFIG_SADIS="external"
471 export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
TorstenThieme326e7972021-01-19 14:27:59 +0000472
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700473 # start logging
474 mkdir -p $WORKSPACE/reconcilett
475 _TAG=kail-reconcile-tt kail -n voltha -n default > $WORKSPACE/reconcilett/onos-voltha-combined.log &
TorstenThieme326e7972021-01-19 14:27:59 +0000476
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700477 DEPLOY_K8S=n ./voltha up
TorstenThieme326e7972021-01-19 14:27:59 +0000478
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700479 mkdir -p $ROBOT_LOGS_DIR
480 export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
TorstenThieme326e7972021-01-19 14:27:59 +0000481
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700482 make -C $WORKSPACE/voltha-system-tests ${makeReconcileTtTestTarget} || true
TorstenThieme326e7972021-01-19 14:27:59 +0000483
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700484 # stop logging
485 P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-tt" | grep -v grep | awk '{print $1}')"
486 if [ -n "$P_IDS" ]; then
487 echo $P_IDS
488 for P_ID in $P_IDS; do
489 kill -9 $P_ID
490 done
491 fi
TorstenThieme326e7972021-01-19 14:27:59 +0000492
Matteo Scandoloe4abf852021-05-18 09:12:11 -0700493 # get pods information
494 kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true
495 '''
496 }
TorstenThieme326e7972021-01-19 14:27:59 +0000497 }
498 }
499 }
500 post {
501 always {
502 sh '''
TorstenThieme326e7972021-01-19 14:27:59 +0000503 # get pods information
504 kubectl get pods -o wide
505 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}"
506 helm ls
507
508 sync
509 pkill kail || true
510 md5sum $WORKSPACE/kind-voltha/bin/voltctl
511
512 ## Pull out errors from log files
513 extract_errors_go() {
514 echo
515 echo "Error summary for $1:"
516 grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
517 echo
518 }
519
520 extract_errors_python() {
521 echo
522 echo "Error summary for $1:"
523 grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
524 echo
525 }
526
527 extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log || true
528 extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log || true
529 extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log || true
530 extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log || true
531
532 gzip $WORKSPACE/onos-voltha-combined.log || true
533 '''
534 step([$class: 'RobotPublisher',
535 disableArchiveOutput: false,
536 logFileName: 'RobotLogs/*/log*.html',
537 otherFiles: '',
538 outputFileName: 'RobotLogs/*/output*.xml',
539 outputPath: '.',
540 passThreshold: 100,
541 reportFileName: 'RobotLogs/*/report*.html',
542 unstableThreshold: 0]);
543 archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt'
544 }
545 }
546}