Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 1 | // 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 built from patchset on a physical pod and run e2e test |
| 16 | // uses kind-voltha to deploy voltha-2.X |
| 17 | |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 18 | // Need this so that deployment_config has global scope when it's read later |
| 19 | deployment_config = null |
| 20 | localDeploymentConfigFile = null |
| 21 | localKindVolthaValuesFile = null |
| 22 | localSadisConfigFile = null |
| 23 | |
| 24 | // The pipeline assumes these variables are always defined |
| 25 | if ( ! params.withPatchset ) { |
| 26 | GERRIT_EVENT_COMMENT_TEXT = "" |
| 27 | GERRIT_PROJECT = "" |
| 28 | GERRIT_CHANGE_NUMBER = "" |
| 29 | GERRIT_PATCHSET_NUMBER = "" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | pipeline { |
| 33 | |
| 34 | /* no label, executor is determined by JJB */ |
| 35 | agent { |
| 36 | label "${params.buildNode}" |
| 37 | } |
| 38 | options { |
Andy Bavier | b217c2d | 2020-02-21 14:25:50 -0700 | [diff] [blame] | 39 | timeout(time: 90, unit: 'MINUTES') |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | environment { |
| 43 | KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal" |
| 44 | VOLTCONFIG="$HOME/.volt/config-minimal" |
Andy Bavier | 6ba9f9c | 2019-12-12 17:54:53 -0700 | [diff] [blame] | 45 | PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 46 | TYPE="minimal" |
| 47 | FANCY=0 |
| 48 | //VOL-2194 ONOS SSH and REST ports hardcoded to 30115/30120 in tests |
| 49 | ONOS_SSH_PORT=30115 |
| 50 | ONOS_API_PORT=30120 |
| 51 | } |
| 52 | |
| 53 | stages { |
| 54 | stage ('Initialize') { |
| 55 | steps { |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 56 | sh returnStdout: false, script: """ |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 57 | test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down |
| 58 | cd $WORKSPACE |
| 59 | rm -rf $WORKSPACE/* |
| 60 | """ |
| 61 | script { |
| 62 | if (env.configRepo && ! env.localConfigDir) { |
| 63 | env.localConfigDir = "$WORKSPACE" |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 64 | sh returnStdout: false, script: "git clone -b master ${cordRepoUrl}/${configRepo}" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 65 | } |
| 66 | localDeploymentConfigFile = "${env.localConfigDir}/${params.deploymentConfigFile}" |
| 67 | localKindVolthaValuesFile = "${env.localConfigDir}/${params.kindVolthaValuesFile}" |
| 68 | localSadisConfigFile = "${env.localConfigDir}/${params.sadisConfigFile}" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
Andy Bavier | 06d816c | 2019-11-19 11:40:48 -0700 | [diff] [blame] | 73 | stage('Repo') { |
| 74 | steps { |
| 75 | checkout(changelog: true, |
| 76 | poll: false, |
| 77 | scm: [$class: 'RepoScm', |
| 78 | manifestRepositoryUrl: "${params.manifestUrl}", |
| 79 | manifestBranch: "${params.manifestBranch}", |
| 80 | currentBranch: true, |
| 81 | destinationDir: 'voltha', |
| 82 | forceSync: true, |
| 83 | resetFirst: true, |
| 84 | quiet: true, |
| 85 | jobs: 4, |
| 86 | showAllChanges: true] |
| 87 | ) |
| 88 | } |
| 89 | } |
| 90 | |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 91 | stage('Get Patch') { |
| 92 | when { |
| 93 | expression { params.withPatchset } |
| 94 | } |
| 95 | steps { |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 96 | sh returnStdout: false, script: """ |
| 97 | cd voltha |
Andy Bavier | 5b52353 | 2020-02-24 15:31:25 -0700 | [diff] [blame] | 98 | repo download "${gerritProject}" "${gerritChangeNumber}/${gerritPatchsetNumber}" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 99 | """ |
| 100 | } |
| 101 | } |
| 102 | |
Andy Bavier | 9a37660 | 2019-11-13 11:53:37 -0700 | [diff] [blame] | 103 | stage('Check config files') { |
| 104 | steps { |
Andy Bavier | 85ab094 | 2019-11-13 14:43:25 -0700 | [diff] [blame] | 105 | script { |
| 106 | try { |
| 107 | deployment_config = readYaml file: "${localDeploymentConfigFile}" |
| 108 | } catch (err) { |
| 109 | echo "Error reading ${localDeploymentConfigFile}" |
| 110 | throw err |
| 111 | } |
| 112 | sh returnStdout: false, script: """ |
| 113 | if [ ! -e ${localKindVolthaValuesFile} ]; then echo "${localKindVolthaValuesFile} not found"; exit 1; fi |
| 114 | if [ ! -e ${localSadisConfigFile} ]; then echo "${localSadisConfigFile} not found"; exit 1; fi |
| 115 | """ |
Andy Bavier | 9a37660 | 2019-11-13 11:53:37 -0700 | [diff] [blame] | 116 | } |
Andy Bavier | 9a37660 | 2019-11-13 11:53:37 -0700 | [diff] [blame] | 117 | } |
| 118 | } |
| 119 | |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 120 | stage('Create KinD Cluster') { |
| 121 | steps { |
| 122 | sh returnStdout: false, script: """ |
| 123 | git clone https://github.com/ciena/kind-voltha.git |
| 124 | cd kind-voltha/ |
| 125 | JUST_K8S=y ./voltha up |
| 126 | """ |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | stage('Build and Push Images') { |
| 131 | when { |
| 132 | expression { params.withPatchset } |
| 133 | } |
| 134 | steps { |
| 135 | sh returnStdout: false, script: """ |
| 136 | if ! [[ "${gerritProject}" =~ ^(voltha-system-tests)\$ ]]; then |
| 137 | make -C $WORKSPACE/voltha/${gerritProject} DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build |
| 138 | docker images | grep citest |
| 139 | for image in \$(docker images -f "reference=*/*citest" --format "{{.Repository}}") |
| 140 | do |
| 141 | echo "Pushing \$image to nodes" |
| 142 | kind load docker-image \$image:citest --name voltha-\$TYPE --nodes voltha-\$TYPE-worker,voltha-\$TYPE-worker2 |
| 143 | docker rmi \$image:citest \$image:latest || true |
| 144 | done |
| 145 | fi |
| 146 | """ |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | stage('Deploy Voltha') { |
| 151 | environment { |
| 152 | WITH_SIM_ADAPTERS="n" |
| 153 | WITH_RADIUS="y" |
| 154 | DEPLOY_K8S="n" |
| 155 | VOLTHA_LOG_LEVEL="debug" |
| 156 | } |
| 157 | steps { |
| 158 | script { |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 159 | sh returnStdout: false, script: """ |
| 160 | export EXTRA_HELM_FLAGS='--set log_agent.enabled=False -f ${localKindVolthaValuesFile} ' |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 161 | |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 162 | IMAGES="" |
| 163 | if [ "${gerritProject}" = "voltha-go" ]; then |
| 164 | IMAGES="rw_core ro_core " |
| 165 | elif [ "${gerritProject}" = "ofagent-py" ]; then |
| 166 | IMAGES="ofagent " |
| 167 | elif [ "${gerritProject}" = "voltha-onos" ]; then |
| 168 | IMAGES="onos " |
| 169 | elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then |
| 170 | IMAGES="adapter_open_olt " |
| 171 | elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then |
| 172 | IMAGES="adapter_open_onu " |
| 173 | elif [ "${gerritProject}" = "voltha-api-server" ]; then |
| 174 | IMAGES="afrouter afrouterd " |
| 175 | else |
| 176 | echo "No images to push" |
| 177 | fi |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 178 | |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 179 | for I in \$IMAGES |
| 180 | do |
| 181 | EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never " |
| 182 | done |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 183 | |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 184 | cd $WORKSPACE/kind-voltha/ |
| 185 | echo \$EXTRA_HELM_FLAGS |
| 186 | kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log & |
| 187 | ./voltha up |
| 188 | """ |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 189 | } |
| 190 | } |
| 191 | } |
| 192 | |
Scott Baker | fb0284c | 2019-12-12 17:22:38 -0800 | [diff] [blame] | 193 | stage('Deploy Kafka Dump Chart') { |
| 194 | steps { |
| 195 | script { |
| 196 | sh returnStdout: false, script: """ |
| 197 | helm repo add cord https://charts.opencord.org |
| 198 | helm repo update |
| 199 | helm install -n voltha-kafka-dump cord/voltha-kafka-dump |
| 200 | """ |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 205 | stage('Push Tech-Profile') { |
| 206 | when { |
| 207 | expression { params.profile != "Default" } |
| 208 | } |
| 209 | steps { |
| 210 | sh returnStdout: false, script: """ |
| 211 | etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}') |
| 212 | kubectl cp $WORKSPACE/voltha/voltha-system-tests/tests/data/TechProfile-${profile}.json voltha/\$etcd_container:/tmp/flexpod.json |
Andy Bavier | 6ebf318 | 2019-11-21 13:47:21 -0700 | [diff] [blame] | 213 | kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/XGS-PON/64' |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 214 | """ |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | stage('Push Sadis-config') { |
| 219 | steps { |
| 220 | sh returnStdout: false, script: """ |
| 221 | curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:$ONOS_API_PORT/onos/v1/network/configuration --data @${localSadisConfigFile} |
| 222 | """ |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | stage('Reinstall OLT software') { |
| 227 | when { |
| 228 | expression { params.reinstallOlt } |
| 229 | } |
| 230 | steps { |
| 231 | script { |
| 232 | deployment_config.olts.each { olt -> |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 233 | sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'service openolt stop' || true" |
| 234 | sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'killall dev_mgmt_daemon' || true" |
| 235 | sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16'" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 236 | waitUntil { |
| 237 | olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'" |
| 238 | return olt_sw_present.toInteger() == 0 |
| 239 | } |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 240 | sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --install ${oltDebVersion}'" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 241 | waitUntil { |
| 242 | olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'" |
| 243 | return olt_sw_present.toInteger() == 1 |
| 244 | } |
| 245 | if ( olt.fortygig ) { |
| 246 | // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 247 | sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'echo port ce128 sp=40000 >> /broadcom/qax.soc ; /opt/bcm68620/svk_init.sh'" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 248 | } |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | stage('Restart OLT processes') { |
| 255 | steps { |
| 256 | script { |
| 257 | deployment_config.olts.each { olt -> |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 258 | sh returnStdout: false, script: """ |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 259 | ssh-keyscan -H ${olt.ip} >> ~/.ssh/known_hosts |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 260 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'service openolt stop' || true |
Andy Bavier | b502a37 | 2019-11-22 01:05:04 +0000 | [diff] [blame] | 261 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'killall dev_mgmt_daemon' || true |
Andy Bavier | fc4dcc4 | 2019-11-18 15:33:52 -0700 | [diff] [blame] | 262 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'rm -f /var/log/openolt.log' |
Andy Bavier | becaa8e | 2020-01-08 11:49:57 -0700 | [diff] [blame] | 263 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'rm -f /var/log/dev_mgmt_daemon.log' |
Andy Bavier | b502a37 | 2019-11-22 01:05:04 +0000 | [diff] [blame] | 264 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'service dev_mgmt_daemon start &' |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 265 | sleep 5 |
| 266 | sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'service openolt start &' |
| 267 | """ |
| 268 | waitUntil { |
| 269 | onu_discovered = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'grep \"onu discover indication\" /var/log/openolt.log | wc -l'" |
| 270 | return onu_discovered.toInteger() > 0 |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | stage('Run E2E Tests') { |
| 278 | environment { |
Andy Bavier | bda4c6b | 2019-11-12 17:06:22 -0700 | [diff] [blame] | 279 | ROBOT_CONFIG_FILE="${localDeploymentConfigFile}" |
Andy Bavier | d3be2bf | 2020-02-07 17:02:21 -0700 | [diff] [blame] | 280 | ROBOT_MISC_ARGS="${params.extraRobotArgs} --removekeywords wuks -d $WORKSPACE/RobotLogs -v container_log_dir:$WORKSPACE " |
Andy Bavier | bda4c6b | 2019-11-12 17:06:22 -0700 | [diff] [blame] | 281 | ROBOT_FILE="Voltha_PODTests.robot" |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 282 | } |
| 283 | steps { |
| 284 | sh returnStdout: false, script: """ |
| 285 | cd voltha |
| 286 | git clone -b ${branch} ${cordRepoUrl}/cord-tester |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 287 | mkdir -p $WORKSPACE/RobotLogs |
Andy Bavier | e06dcff | 2020-02-06 11:36:40 -0700 | [diff] [blame] | 288 | |
| 289 | # If the Gerrit comment contains a line with "functional tests" then run the full |
| 290 | # functional test suite. This covers tests tagged either 'sanity' or 'functional'. |
| 291 | # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line |
| 292 | REGEX="functional tests" |
| 293 | if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then |
| 294 | ROBOT_MISC_ARGS+="-i functional" |
| 295 | fi |
| 296 | |
Andy Bavier | bda4c6b | 2019-11-12 17:06:22 -0700 | [diff] [blame] | 297 | make -C $WORKSPACE/voltha/voltha-system-tests voltha-test || true |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 298 | """ |
| 299 | } |
| 300 | } |
Scott Baker | da31d7b | 2020-01-08 16:35:52 -0800 | [diff] [blame] | 301 | |
| 302 | stage('After-Test Delay') { |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 303 | when { |
| 304 | expression { params.withPatchset } |
| 305 | } |
Scott Baker | da31d7b | 2020-01-08 16:35:52 -0800 | [diff] [blame] | 306 | steps { |
| 307 | sh returnStdout: false, script: """ |
| 308 | # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line |
| 309 | REGEX="hardware test with delay\$" |
| 310 | [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]] && sleep 10m || true |
| 311 | """ |
| 312 | } |
| 313 | } |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | post { |
| 317 | always { |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 318 | sh returnStdout: false, script: ''' |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 319 | set +e |
| 320 | cp kind-voltha/install-minimal.log $WORKSPACE/ |
| 321 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq -c |
| 322 | kubectl get nodes -o wide |
| 323 | kubectl get pods -o wide |
| 324 | kubectl get pods -n voltha -o wide |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 325 | |
| 326 | sync |
| 327 | pkill kail || true |
| 328 | |
| 329 | ## Pull out errors from log files |
| 330 | extract_errors_go() { |
| 331 | echo |
| 332 | echo "Error summary for $1:" |
| 333 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg' |
| 334 | echo |
| 335 | } |
| 336 | |
| 337 | extract_errors_python() { |
| 338 | echo |
| 339 | echo "Error summary for $1:" |
| 340 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2- |
| 341 | echo |
| 342 | } |
| 343 | |
| 344 | extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log |
| 345 | extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log |
| 346 | extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log |
| 347 | extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log |
| 348 | |
Andy Bavier | 2178d10 | 2020-02-06 16:22:11 -0700 | [diff] [blame] | 349 | gzip $WORKSPACE/onos-voltha-combined.log |
| 350 | |
Scott Baker | fb0284c | 2019-12-12 17:22:38 -0800 | [diff] [blame] | 351 | ## collect events, the chart should be running by now |
| 352 | kubectl get pods | grep -i voltha-kafka-dump | grep -i running |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 353 | if [[ $? == 0 ]]; then |
Scott Baker | fb0284c | 2019-12-12 17:22:38 -0800 | [diff] [blame] | 354 | kubectl exec -it `kubectl get pods | grep -i voltha-kafka-dump | grep -i running | cut -f1 -d " "` ./voltha-dump-events.sh > $WORKSPACE/voltha-events.log |
| 355 | fi |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 356 | ''' |
Andy Bavier | 6ebf318 | 2019-11-21 13:47:21 -0700 | [diff] [blame] | 357 | script { |
| 358 | deployment_config.olts.each { olt -> |
hwchiu | 1f0b0fe | 2019-12-06 11:45:23 -0800 | [diff] [blame] | 359 | sh returnStdout: false, script: """ |
Andy Bavier | 6ebf318 | 2019-11-21 13:47:21 -0700 | [diff] [blame] | 360 | sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/openolt.log $WORKSPACE/openolt-${olt.ip}.log || true |
| 361 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.ip}.log # Remove escape sequences |
Andy Bavier | becaa8e | 2020-01-08 11:49:57 -0700 | [diff] [blame] | 362 | sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log || true |
| 363 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log # Remove escape sequences |
Andy Bavier | 6ebf318 | 2019-11-21 13:47:21 -0700 | [diff] [blame] | 364 | """ |
| 365 | } |
| 366 | } |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 367 | step([$class: 'RobotPublisher', |
| 368 | disableArchiveOutput: false, |
| 369 | logFileName: 'RobotLogs/log*.html', |
| 370 | otherFiles: '', |
| 371 | outputFileName: 'RobotLogs/output*.xml', |
| 372 | outputPath: '.', |
Andy Bavier | e19b67b | 2020-02-14 11:29:50 -0700 | [diff] [blame] | 373 | passThreshold: 100, |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 374 | reportFileName: 'RobotLogs/report*.html', |
| 375 | unstableThreshold: 0]); |
Andy Bavier | 2178d10 | 2020-02-06 16:22:11 -0700 | [diff] [blame] | 376 | archiveArtifacts artifacts: '*.log,*.gz' |
Andy Bavier | 61c5b2a | 2019-11-12 12:08:19 -0700 | [diff] [blame] | 377 | } |
| 378 | } |
| 379 | } |