Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 1 | #!/usr/bin/env groovy |
| 2 | // ----------------------------------------------------------------------- |
| 3 | // Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 16 | // ----------------------------------------------------------------------- |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 17 | |
Matteo Scandolo | 0d0f290 | 2021-07-15 16:16:33 -0700 | [diff] [blame] | 18 | library identifier: 'cord-jenkins-libraries@master', |
| 19 | retriever: modernSCM([ |
| 20 | $class: 'GitSCMSource', |
| 21 | remote: 'https://gerrit.opencord.org/ci-management.git' |
| 22 | ]) |
| 23 | |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 24 | node { |
| 25 | // Need this so that deployment_config has global scope when it's read later |
| 26 | deployment_config = null |
| 27 | } |
| 28 | |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 29 | def infraNamespace = "infra" |
| 30 | def volthaNamespace = "voltha" |
| 31 | |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 32 | pipeline { |
| 33 | /* no label, executor is determined by JJB */ |
| 34 | agent { |
| 35 | label "${params.buildNode}" |
| 36 | } |
| 37 | options { |
Hardik Windlass | d0f0166 | 2021-09-03 08:07:15 +0000 | [diff] [blame] | 38 | timeout(time: "${timeout}", unit: 'MINUTES') |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | environment { |
| 42 | KUBECONFIG="$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf" |
| 43 | VOLTCONFIG="$HOME/.volt/config-minimal" |
| 44 | PATH="$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 45 | } |
| 46 | |
| 47 | stages { |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 48 | stage('Clone voltha-system-tests') { |
| 49 | steps { |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 50 | step([$class: 'WsCleanup']) |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 51 | checkout([ |
| 52 | $class: 'GitSCM', |
| 53 | userRemoteConfigs: [[ |
| 54 | url: "https://gerrit.opencord.org/voltha-system-tests", |
Matteo Scandolo | a42c6f5 | 2020-09-19 01:35:12 +0000 | [diff] [blame] | 55 | refspec: "${volthaSystemTestsChange}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 56 | ]], |
Suchitra Vemuri | 1143ae3 | 2021-03-26 01:08:37 +0000 | [diff] [blame] | 57 | branches: [[ name: "${branch}", ]], |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 58 | extensions: [ |
| 59 | [$class: 'WipeWorkspace'], |
| 60 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 61 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 62 | ], |
| 63 | ]) |
Suchitra Vemuri | a38e541 | 2021-02-23 15:28:28 -0800 | [diff] [blame] | 64 | script { |
| 65 | sh(script:""" |
| 66 | if [ '${volthaSystemTestsChange}' != '' ] ; then |
| 67 | cd $WORKSPACE/voltha-system-tests; |
| 68 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 69 | fi |
| 70 | """) |
| 71 | } |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 72 | } |
| 73 | } |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 74 | stage ('Initialize') { |
| 75 | steps { |
Hardik Windlass | 6f854a1 | 2021-07-12 13:20:21 +0000 | [diff] [blame] | 76 | sh returnStdout: false, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 77 | script { |
| 78 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 79 | } |
Hardik Windlass | 9658cd2 | 2021-10-25 11:13:25 +0000 | [diff] [blame] | 80 | installVoltctl("${branch}") |
Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 81 | |
| 82 | sh(returnStdout: false, script: """ |
| 83 | mkdir -p "$WORKSPACE/bin" |
| 84 | |
| 85 | # install kail |
| 86 | make -C "$WORKSPACE/voltha-system-tests" KAIL_PATH="$WORKSPACE/bin" kail |
Matteo Scandolo | 3fbb065 | 2020-07-22 08:50:02 -0700 | [diff] [blame] | 87 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 88 | # Default kind-voltha config doesn't work on ONF demo pod for accessing kvstore. |
| 89 | # The issue is that the mgmt node is also one of the k8s nodes and so port forwarding doesn't work. |
| 90 | # We should change this. In the meantime here is a workaround. |
Suchitra Vemuri | 1342143 | 2020-06-05 17:34:33 -0700 | [diff] [blame] | 91 | if [ "${params.branch}" == "master" ]; then |
| 92 | set +e |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 93 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 94 | # Remove noise from voltha-core logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 95 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model |
| 96 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 97 | # Remove noise from openolt logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 98 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db |
| 99 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe |
| 100 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
Suchitra Vemuri | 1342143 | 2020-06-05 17:34:33 -0700 | [diff] [blame] | 101 | fi |
Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 102 | """) |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 103 | } |
| 104 | } |
| 105 | |
| 106 | stage('Functional Tests') { |
| 107 | environment { |
Suchitra Vemuri | e4a5bcc | 2020-03-16 12:43:03 -0700 | [diff] [blame] | 108 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 109 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 110 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FunctionalTests" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 111 | } |
| 112 | steps { |
| 113 | sh """ |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 114 | mkdir -p $ROBOT_LOGS_DIR |
Suchitra Vemuri | 627786a | 2020-06-18 16:52:05 -0700 | [diff] [blame] | 115 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 116 | export ROBOT_MISC_ARGS="--removekeywords wuks -i PowerSwitch -i sanityDt -i functionalDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Suchitra Vemuri | 627786a | 2020-06-18 16:52:05 -0700 | [diff] [blame] | 117 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 118 | export ROBOT_MISC_ARGS="--removekeywords wuks -e PowerSwitch -i sanityDt -i functionalDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Suchitra Vemuri | 627786a | 2020-06-18 16:52:05 -0700 | [diff] [blame] | 119 | fi |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 120 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 121 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 122 | """ |
| 123 | } |
| 124 | } |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 125 | |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 126 | stage('Failure/Recovery Tests') { |
| 127 | environment { |
| 128 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 129 | ROBOT_FILE="Voltha_DT_FailureScenarios.robot" |
| 130 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FailureScenarios" |
| 131 | } |
| 132 | steps { |
| 133 | sh """ |
| 134 | mkdir -p $ROBOT_LOGS_DIR |
| 135 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 136 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalDt -i PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 137 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 138 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalDt -e PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 139 | fi |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 140 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 141 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 142 | """ |
| 143 | } |
| 144 | } |
| 145 | |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 146 | stage('Dataplane Tests') { |
| 147 | environment { |
Andy Bavier | 1541da8 | 2020-05-15 09:41:38 -0700 | [diff] [blame] | 148 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 149 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
| 150 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/DataplaneTests" |
| 151 | } |
| 152 | steps { |
| 153 | sh """ |
| 154 | mkdir -p $ROBOT_LOGS_DIR |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 155 | export ROBOT_MISC_ARGS="--removekeywords wuks -i dataplaneDt -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 156 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 157 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 158 | """ |
| 159 | } |
| 160 | } |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 161 | stage('HA Tests') { |
| 162 | environment { |
| 163 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 164 | ROBOT_FILE="Voltha_ONOSHATests.robot" |
| 165 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ONOSHAScenarios" |
| 166 | } |
| 167 | steps { |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 168 | sh """ |
| 169 | mkdir -p $ROBOT_LOGS_DIR |
| 170 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v workflow:${params.workFlow} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 171 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 172 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
| 173 | """ |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 174 | } |
| 175 | } |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 176 | |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 177 | stage('Multiple OLT Tests') { |
| 178 | environment { |
| 179 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 180 | ROBOT_FILE="Voltha_DT_MultiOLT_Tests.robot" |
| 181 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/MultipleOLTScenarios" |
| 182 | } |
| 183 | steps { |
| 184 | sh """ |
| 185 | mkdir -p $ROBOT_LOGS_DIR |
| 186 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 187 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalDt -i PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 188 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 189 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalDt -e PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 190 | fi |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 191 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 192 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
| 193 | """ |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 198 | stage('Error Scenario Tests') { |
| 199 | environment { |
| 200 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 201 | ROBOT_FILE="Voltha_ErrorScenarios.robot" |
| 202 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/ErrorScenarios" |
| 203 | } |
| 204 | steps { |
| 205 | sh """ |
| 206 | mkdir -p $ROBOT_LOGS_DIR |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 207 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functional -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v workflow:${params.workFlow} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel}" |
Hardik Windlass | 806505d | 2021-10-27 08:15:48 +0000 | [diff] [blame] | 208 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 209 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 210 | """ |
| 211 | } |
Andrea Campanella | 7166637 | 2020-04-21 10:56:17 +0200 | [diff] [blame] | 212 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 213 | } |
| 214 | post { |
| 215 | always { |
| 216 | sh returnStdout: false, script: ''' |
| 217 | set +e |
Matteo Scandolo | 97b1257 | 2020-04-13 12:44:46 -0700 | [diff] [blame] | 218 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq |
| 219 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 220 | kubectl get nodes -o wide |
| 221 | kubectl get pods -n voltha -o wide |
Suchitra Vemuri | 179643b | 2020-11-02 10:06:20 -0800 | [diff] [blame] | 222 | kubectl get pods -o wide |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 223 | |
Andrea Campanella | a20a933 | 2021-03-09 09:18:42 +0100 | [diff] [blame] | 224 | # store information on running charts |
| 225 | helm ls > $WORKSPACE/helm-list.txt || true |
| 226 | |
| 227 | # store information on the running pods |
Andrea Campanella | e0c839f | 2021-03-16 17:53:40 +0100 | [diff] [blame] | 228 | kubectl get pods --all-namespaces -o wide > $WORKSPACE/pods.txt || true |
Andrea Campanella | a20a933 | 2021-03-09 09:18:42 +0100 | [diff] [blame] | 229 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $WORKSPACE/pod-images.txt || true |
| 230 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $WORKSPACE/pod-imagesId.txt || true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 231 | ''' |
| 232 | script { |
| 233 | deployment_config.olts.each { olt -> |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 234 | if (olt.type == null || olt.type == "" || olt.type == "openolt") { |
| 235 | sh returnStdout: false, script: """ |
| 236 | sshpass -p ${olt.pass} scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${olt.user}@${olt.sship}:/var/log/openolt.log $WORKSPACE/openolt-${olt.sship}.log || true |
| 237 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.sship}.log # Remove escape sequences |
| 238 | sshpass -p ${olt.pass} scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${olt.user}@${olt.sship}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log || true |
| 239 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log # Remove escape sequences |
| 240 | sshpass -p ${olt.pass} scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${olt.user}@${olt.sship}:/var/log/startup.log $WORKSPACE/startup-${olt.sship}.log || true |
| 241 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/startup-${olt.sship}.log || true # Remove escape sequences |
| 242 | sshpass -p ${olt.pass} scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${olt.user}@${olt.sship}:/var/log/openolt_process_watchdog.log $WORKSPACE/openolt_process_watchdog-${olt.sship}.log || true |
| 243 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt_process_watchdog-${olt.sship}.log || true # Remove escape sequences |
| 244 | """ |
| 245 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 246 | } |
| 247 | } |
| 248 | step([$class: 'RobotPublisher', |
| 249 | disableArchiveOutput: false, |
| 250 | logFileName: '**/log*.html', |
| 251 | otherFiles: '', |
| 252 | outputFileName: '**/output*.xml', |
| 253 | outputPath: 'RobotLogs', |
| 254 | passThreshold: 100, |
| 255 | reportFileName: '**/report*.html', |
Andrea Campanella | abc0977 | 2021-06-16 12:08:57 +0200 | [diff] [blame] | 256 | unstableThreshold: 0, |
| 257 | onlyCritical: true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 258 | ]); |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 259 | archiveArtifacts artifacts: '**/*.log,**/*.tgz,*.txt' |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 260 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 261 | } |
| 262 | } |