Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 1 | // 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 | |
| 19 | pipeline { |
| 20 | |
| 21 | /* no label, executor is determined by JJB */ |
| 22 | agent { |
Zack Williams | b329208 | 2019-10-11 17:15:18 -0700 | [diff] [blame] | 23 | label "${params.buildNode}" |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 24 | } |
| 25 | options { |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 26 | timeout(time: 90, unit: 'MINUTES') |
| 27 | } |
| 28 | environment { |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 29 | PATH="$WORKSPACE/voltha/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 30 | VOLTHA_LOG_LEVEL="DEBUG" |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 31 | FANCY=0 |
| 32 | WITH_SIM_ADAPTERS="n" |
Matteo Scandolo | 39045a9 | 2020-07-29 08:58:29 -0700 | [diff] [blame] | 33 | NAME="test" |
| 34 | VOLTCONFIG="$HOME/.volt/config-$NAME" |
| 35 | KUBECONFIG="$HOME/.kube/kind-config-voltha-$NAME" |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | stages { |
| 39 | |
| 40 | stage('Repo') { |
| 41 | steps { |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 42 | step([$class: 'WsCleanup']) |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 43 | checkout(changelog: false, \ |
| 44 | poll: false, |
| 45 | scm: [$class: 'RepoScm', \ |
| 46 | manifestRepositoryUrl: "${params.manifestUrl}", \ |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 47 | manifestBranch: "${params.branch}", \ |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 48 | currentBranch: true, \ |
| 49 | destinationDir: 'voltha', \ |
| 50 | forceSync: true, |
| 51 | resetFirst: true, \ |
| 52 | quiet: true, \ |
| 53 | jobs: 4, \ |
| 54 | showAllChanges: true] \ |
| 55 | ) |
| 56 | } |
| 57 | } |
| 58 | stage('Patch') { |
| 59 | steps { |
| 60 | sh """ |
| 61 | pushd voltha |
Andy Bavier | b35171c | 2020-03-06 15:47:29 -0700 | [diff] [blame] | 62 | if [ "${gerritProject}" != "" -a "${gerritChangeNumber}" != "" -a "${gerritPatchsetNumber}" != "" ] |
| 63 | then |
| 64 | repo download "${gerritProject}" "${gerritChangeNumber}/${gerritPatchsetNumber}" |
| 65 | else |
| 66 | echo "No patchset to download!" |
| 67 | fi |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 68 | popd |
| 69 | """ |
| 70 | } |
| 71 | } |
| 72 | stage('Create K8s Cluster') { |
| 73 | steps { |
| 74 | sh """ |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 75 | if [ "${branch}" != "master" ]; then |
| 76 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 77 | source "$WORKSPACE/voltha/kind-voltha/releases/${branch}" |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 78 | else |
| 79 | echo "on master, using default settings for kind-voltha" |
| 80 | fi |
| 81 | |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 82 | cd $WORKSPACE/voltha/kind-voltha/ |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 83 | JUST_K8S=y ./voltha up |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 84 | bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/voltha/kind-voltha/bin" |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 85 | """ |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | stage('Build Images') { |
| 90 | steps { |
| 91 | sh """ |
Andy Bavier | b99c3d3 | 2020-02-18 11:14:17 -0700 | [diff] [blame] | 92 | make-local () { |
| 93 | make -C $WORKSPACE/voltha/\$1 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build |
| 94 | } |
Andy Bavier | 0ed7706 | 2020-02-18 10:09:19 -0700 | [diff] [blame] | 95 | if [ "${gerritProject}" = "pyvoltha" ]; then |
Andy Bavier | b99c3d3 | 2020-02-18 11:14:17 -0700 | [diff] [blame] | 96 | make -C $WORKSPACE/voltha/pyvoltha/ dist |
Andy Bavier | 0ed7706 | 2020-02-18 10:09:19 -0700 | [diff] [blame] | 97 | export LOCAL_PYVOLTHA=$WORKSPACE/voltha/pyvoltha/ |
Andy Bavier | b99c3d3 | 2020-02-18 11:14:17 -0700 | [diff] [blame] | 98 | make-local voltha-openonu-adapter |
| 99 | elif [ "${gerritProject}" = "voltha-lib-go" ]; then |
| 100 | make -C $WORKSPACE/voltha/voltha-lib-go/ build |
| 101 | export LOCAL_LIB_GO=$WORKSPACE/voltha/voltha-lib-go/ |
| 102 | make-local voltha-go |
| 103 | make-local voltha-openolt-adapter |
| 104 | elif [ "${gerritProject}" = "voltha-protos" ]; then |
| 105 | make -C $WORKSPACE/voltha/voltha-protos/ build |
| 106 | export LOCAL_PROTOS=$WORKSPACE/voltha/voltha-protos/ |
| 107 | make-local voltha-go |
| 108 | make-local voltha-openolt-adapter |
| 109 | make-local voltha-openonu-adapter |
| 110 | make-local ofagent-py |
Andy Bavier | 178c47b | 2020-04-01 13:05:43 -0700 | [diff] [blame] | 111 | elif [ "${gerritProject}" = "voltctl" ]; then |
Andy Bavier | decde3f | 2020-04-01 15:29:43 -0700 | [diff] [blame] | 112 | # Set and handle GOPATH and PATH |
| 113 | export GOPATH=\${GOPATH:-$WORKSPACE/go} |
| 114 | export PATH=\$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:\$GOPATH/bin |
Andy Bavier | 178c47b | 2020-04-01 13:05:43 -0700 | [diff] [blame] | 115 | make -C $WORKSPACE/voltha/voltctl/ build |
Andy Bavier | 4318f8d | 2020-04-09 13:50:53 -0700 | [diff] [blame] | 116 | elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|kind-voltha)\$ ]]; then |
Andy Bavier | b99c3d3 | 2020-02-18 11:14:17 -0700 | [diff] [blame] | 117 | make-local ${gerritProject} |
Andy Bavier | 07615f9 | 2019-10-03 12:31:18 -0700 | [diff] [blame] | 118 | fi |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 119 | """ |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | stage('Push Images') { |
| 124 | steps { |
| 125 | sh ''' |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 126 | if [ "${branch}" != "master" ]; then |
| 127 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 128 | source "$WORKSPACE/voltha/kind-voltha/releases/${branch}" |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 129 | else |
| 130 | echo "on master, using default settings for kind-voltha" |
| 131 | fi |
| 132 | |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 133 | if ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|voltctl|kind-voltha)\$ ]]; then |
Andy Bavier | 07615f9 | 2019-10-03 12:31:18 -0700 | [diff] [blame] | 134 | export GOROOT=/usr/local/go |
| 135 | export GOPATH=\$(pwd) |
Andy Bavier | 07615f9 | 2019-10-03 12:31:18 -0700 | [diff] [blame] | 136 | docker images | grep citest |
Matteo Scandolo | 2e64c10 | 2020-07-29 19:41:02 -0700 | [diff] [blame] | 137 | 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 Bavier | 07615f9 | 2019-10-03 12:31:18 -0700 | [diff] [blame] | 138 | fi |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 139 | ''' |
| 140 | } |
| 141 | } |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 142 | |
| 143 | stage('ATT workflow') { |
| 144 | environment { |
| 145 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ATTWorkflow" |
| 146 | } |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 147 | steps { |
Kailash Khalasi | af3a2a6 | 2019-10-02 09:44:08 -0700 | [diff] [blame] | 148 | sh ''' |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 149 | if [ "${branch}" != "master" ]; then |
| 150 | echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}" |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 151 | source "$WORKSPACE/voltha/kind-voltha/releases/${branch}" |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 152 | else |
| 153 | echo "on master, using default settings for kind-voltha" |
| 154 | fi |
| 155 | |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 156 | # Workflow-specific flags |
| 157 | export WITH_RADIUS=yes |
| 158 | export WITH_BBSIM=yes |
| 159 | export DEPLOY_K8S=yes |
| 160 | export CONFIG_SADIS=no |
| 161 | |
Zack Williams | 03ebb27 | 2020-03-27 09:42:33 -0700 | [diff] [blame] | 162 | export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} " |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 163 | |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 164 | IMAGES="" |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 165 | if [ "${gerritProject}" = "voltha-go" ]; then |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 166 | IMAGES="rw_core ro_core " |
| 167 | elif [ "${gerritProject}" = "ofagent-py" ]; then |
Andy Bavier | 8d81642 | 2020-03-23 15:34:26 -0700 | [diff] [blame] | 168 | IMAGES="ofagent_py " |
| 169 | EXTRA_HELM_FLAGS+="--set use_ofagent_go=false " |
Andy Bavier | 9c412a8 | 2020-03-23 12:00:28 -0700 | [diff] [blame] | 170 | elif [ "${gerritProject}" = "ofagent-go" ]; then |
Andy Bavier | 8d81642 | 2020-03-23 15:34:26 -0700 | [diff] [blame] | 171 | IMAGES="ofagent_go " |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 172 | elif [ "${gerritProject}" = "voltha-onos" ]; then |
| 173 | IMAGES="onos " |
| 174 | elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then |
| 175 | IMAGES="adapter_open_olt " |
| 176 | elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then |
| 177 | IMAGES="adapter_open_onu " |
| 178 | elif [ "${gerritProject}" = "voltha-api-server" ]; then |
| 179 | IMAGES="afrouter afrouterd " |
| 180 | elif [ "${gerritProject}" = "bbsim" ]; then |
| 181 | IMAGES="bbsim " |
Andy Bavier | ec0c10d | 2020-02-14 13:06:27 -0700 | [diff] [blame] | 182 | elif [ "${gerritProject}" = "pyvoltha" ]; then |
| 183 | IMAGES="adapter_open_onu " |
Andy Bavier | b99c3d3 | 2020-02-18 11:14:17 -0700 | [diff] [blame] | 184 | elif [ "${gerritProject}" = "voltha-lib-go" ]; then |
| 185 | IMAGES="rw_core ro_core adapter_open_olt " |
| 186 | elif [ "${gerritProject}" = "voltha-protos" ]; then |
| 187 | IMAGES="rw_core ro_core adapter_open_olt adapter_open_onu ofagent " |
Zack Williams | 0499750 | 2019-10-04 14:32:20 -0700 | [diff] [blame] | 188 | else |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 189 | echo "No images to push" |
Scott Baker | 9ac2371 | 2019-10-02 09:26:50 -0700 | [diff] [blame] | 190 | fi |
| 191 | |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 192 | for I in \$IMAGES |
| 193 | do |
| 194 | EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never " |
| 195 | done |
| 196 | |
Kailash Khalasi | af3a2a6 | 2019-10-02 09:44:08 -0700 | [diff] [blame] | 197 | if [ "${gerritProject}" = "voltha-helm-charts" ]; then |
Andy Bavier | 4540634 | 2019-10-02 16:45:40 -0700 | [diff] [blame] | 198 | export CHART_PATH=$WORKSPACE/voltha/voltha-helm-charts |
| 199 | export VOLTHA_CHART=\$CHART_PATH/voltha |
| 200 | export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt |
| 201 | export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu |
Kailash Khalasi | af3a2a6 | 2019-10-02 09:44:08 -0700 | [diff] [blame] | 202 | helm dep update \$VOLTHA_CHART |
| 203 | helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART |
| 204 | helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART |
| 205 | fi |
| 206 | |
Andy Bavier | 178c47b | 2020-04-01 13:05:43 -0700 | [diff] [blame] | 207 | if [ "${gerritProject}" = "voltctl" ]; then |
| 208 | export VOLTCTL_VERSION=$(cat $WORKSPACE/voltha/voltctl/VERSION) |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 209 | cp $WORKSPACE/voltha/voltctl/voltctl $WORKSPACE/voltha/kind-voltha/bin/voltctl |
| 210 | md5sum $WORKSPACE/voltha/kind-voltha/bin/voltctl |
Andy Bavier | 178c47b | 2020-04-01 13:05:43 -0700 | [diff] [blame] | 211 | fi |
| 212 | |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 213 | printenv |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 214 | kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log & |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 215 | |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 216 | cd $WORKSPACE/voltha/kind-voltha/ |
| 217 | ./voltha up |
| 218 | |
Matteo Scandolo | 39045a9 | 2020-07-29 08:58:29 -0700 | [diff] [blame] | 219 | # $NAME-env.sh contains the environment we used |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 220 | # Save value of EXTRA_HELM_FLAGS there to use in subsequent stages |
Matteo Scandolo | 39045a9 | 2020-07-29 08:58:29 -0700 | [diff] [blame] | 221 | echo export EXTRA_HELM_FLAGS=\\"\$EXTRA_HELM_FLAGS\\" >> $NAME-env.sh |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 222 | |
| 223 | mkdir -p $ROBOT_LOGS_DIR |
Andy Bavier | d987004 | 2020-06-23 13:16:47 -0700 | [diff] [blame] | 224 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
Andy Bavier | db00308 | 2020-02-04 11:57:36 -0700 | [diff] [blame] | 225 | |
| 226 | # By default, all tests tagged 'sanity' are run. This covers basic functionality |
| 227 | # like running through the ATT workflow for a single subscriber. |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 228 | export TARGET=sanity-single-kind |
Andy Bavier | db00308 | 2020-02-04 11:57:36 -0700 | [diff] [blame] | 229 | |
| 230 | # If the Gerrit comment contains a line with "functional tests" then run the full |
| 231 | # functional test suite. This covers tests tagged either 'sanity' or 'functional'. |
| 232 | # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line |
| 233 | REGEX="functional tests" |
| 234 | if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 235 | TARGET=functional-single-kind |
Andy Bavier | db00308 | 2020-02-04 11:57:36 -0700 | [diff] [blame] | 236 | fi |
| 237 | |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 238 | make -C $WORKSPACE/voltha/voltha-system-tests \$TARGET || true |
| 239 | ''' |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | stage('DT workflow') { |
| 244 | environment { |
| 245 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DTWorkflow" |
| 246 | } |
| 247 | steps { |
| 248 | sh ''' |
| 249 | cd $WORKSPACE/voltha/kind-voltha/ |
Matteo Scandolo | 39045a9 | 2020-07-29 08:58:29 -0700 | [diff] [blame] | 250 | source $NAME-env.sh |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 251 | WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down |
| 252 | |
| 253 | # Workflow-specific flags |
| 254 | export WITH_RADIUS=no |
| 255 | export WITH_EAPOL=no |
| 256 | export WITH_DHCP=no |
| 257 | export WITH_IGMP=no |
| 258 | export CONFIG_SADIS=no |
| 259 | |
| 260 | DEPLOY_K8S=n ./voltha up |
| 261 | |
| 262 | mkdir -p $ROBOT_LOGS_DIR |
Andy Bavier | d987004 | 2020-06-23 13:16:47 -0700 | [diff] [blame] | 263 | export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch" |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 264 | |
| 265 | # By default, all tests tagged 'sanityDt' are run. This covers basic functionality |
| 266 | # like running through the DT workflow for a single subscriber. |
| 267 | export TARGET=sanity-kind-dt |
| 268 | |
| 269 | # If the Gerrit comment contains a line with "functional tests" then run the full |
| 270 | # functional test suite. This covers tests tagged either 'sanityDt' or 'functionalDt'. |
| 271 | # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line |
| 272 | REGEX="functional tests" |
| 273 | if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then |
| 274 | TARGET=functional-single-kind-dt |
| 275 | fi |
| 276 | |
| 277 | make -C $WORKSPACE/voltha/voltha-system-tests \$TARGET || true |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 278 | ''' |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | post { |
| 284 | always { |
| 285 | sh ''' |
Andy Bavier | 07615f9 | 2019-10-03 12:31:18 -0700 | [diff] [blame] | 286 | set +e |
Matteo Scandolo | 39045a9 | 2020-07-29 08:58:29 -0700 | [diff] [blame] | 287 | cp $WORKSPACE/voltha/kind-voltha/install-$NAME.log $WORKSPACE/ |
Matteo Scandolo | 97b1257 | 2020-04-13 12:44:46 -0700 | [diff] [blame] | 288 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq |
| 289 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 290 | kubectl get nodes -o wide |
| 291 | kubectl get pods -o wide |
| 292 | kubectl get pods -n voltha -o wide |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 293 | |
| 294 | sync |
| 295 | pkill kail || true |
Andy Bavier | b5c8caf | 2020-04-06 14:12:07 -0700 | [diff] [blame] | 296 | md5sum $WORKSPACE/voltha/kind-voltha/bin/voltctl |
Andy Bavier | 4af0272 | 2020-01-15 10:24:24 -0700 | [diff] [blame] | 297 | |
| 298 | ## Pull out errors from log files |
| 299 | extract_errors_go() { |
| 300 | echo |
| 301 | echo "Error summary for $1:" |
| 302 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg' |
| 303 | echo |
| 304 | } |
| 305 | |
| 306 | extract_errors_python() { |
| 307 | echo |
| 308 | echo "Error summary for $1:" |
| 309 | grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2- |
| 310 | echo |
| 311 | } |
| 312 | |
| 313 | extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log |
| 314 | extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log |
| 315 | extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log |
| 316 | extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log |
| 317 | |
Andy Bavier | 2178d10 | 2020-02-06 16:22:11 -0700 | [diff] [blame] | 318 | gzip $WORKSPACE/onos-voltha-combined.log |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 319 | ''' |
| 320 | step([$class: 'RobotPublisher', |
| 321 | disableArchiveOutput: false, |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 322 | logFileName: 'RobotLogs/*/log*.html', |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 323 | otherFiles: '', |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 324 | outputFileName: 'RobotLogs/*/output*.xml', |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 325 | outputPath: '.', |
Andy Bavier | 8b118b7 | 2020-04-28 12:59:30 -0700 | [diff] [blame] | 326 | passThreshold: 100, |
| 327 | reportFileName: 'RobotLogs/*/report*.html', |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 328 | unstableThreshold: 0]); |
Andy Bavier | 2178d10 | 2020-02-06 16:22:11 -0700 | [diff] [blame] | 329 | archiveArtifacts artifacts: '*.log,*.gz' |
Kailash | aad7101 | 2019-08-27 10:36:53 -0700 | [diff] [blame] | 330 | } |
| 331 | } |
| 332 | } |