Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 1 | // -*- groovy -*- |
| 2 | // ----------------------------------------------------------------------- |
| 3 | // Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 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. |
| 16 | // ----------------------------------------------------------------------- |
| 17 | |
| 18 | library identifier: 'cord-jenkins-libraries@master', |
| 19 | retriever: modernSCM([ |
| 20 | $class: 'GitSCMSource', |
| 21 | remote: 'https://gerrit.opencord.org/ci-management.git' |
| 22 | ]) |
| 23 | |
| 24 | node { |
| 25 | // Need this so that deployment_config has global scope when it's read later |
| 26 | deployment_config = null |
| 27 | } |
| 28 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 29 | // ----------------------------------------------------------------------- |
| 30 | // ----------------------------------------------------------------------- |
| 31 | def getIam(String func) |
| 32 | { |
| 33 | // Cannot rely on a stack trace due to jenkins manipulation |
| 34 | String src = [ |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 35 | 'jjb', |
| 36 | 'pipeline', |
| 37 | 'voltha', |
| 38 | 'playground', |
| 39 | 'voltha-tt-physical-functional-tests.groovy' |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 40 | ].join('/') |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 41 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 42 | String iam = [src, func].join('::') |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 43 | iam += sprintf('[ver:1.0]') |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 44 | return iam |
| 45 | } |
| 46 | |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 47 | def infraNamespace = "infra" |
| 48 | def volthaNamespace = "voltha" |
| 49 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 50 | pipeline |
| 51 | { |
| 52 | /* no label, executor is determined by JJB */ |
| 53 | agent |
| 54 | { |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 55 | label "${params.buildNode}" |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 56 | } |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 57 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 58 | options |
| 59 | { |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 60 | timeout(time: "${timeout}", unit: 'MINUTES') |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 61 | } |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 62 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 63 | environment |
| 64 | { |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 65 | KUBECONFIG="$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf" |
| 66 | VOLTCONFIG="$HOME/.volt/config-minimal" |
| 67 | PATH="$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | stages { |
| 71 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 72 | // ----------------------------------------------------------------------- |
| 73 | // ----------------------------------------------------------------------- |
| 74 | stage('Clone voltha-system-tests') |
| 75 | { |
| 76 | steps |
| 77 | { |
Joey Armstrong | 9ed18e1 | 2023-03-07 10:40:14 -0500 | [diff] [blame] | 78 | iam |
Joey Armstrong | cd6aa77 | 2023-03-07 09:05:37 -0500 | [diff] [blame] | 79 | { |
| 80 | enter = true |
| 81 | label = getIam() |
| 82 | } |
| 83 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 84 | step([$class: 'WsCleanup']) |
| 85 | checkout([ |
| 86 | $class: 'GitSCM', |
| 87 | userRemoteConfigs: [[ |
| 88 | url: "https://gerrit.opencord.org/voltha-system-tests", |
| 89 | refspec: "${volthaSystemTestsChange}" |
| 90 | ]], |
| 91 | branches: [[ name: "${branch}" ]], |
| 92 | extensions: [ |
| 93 | [$class: 'WipeWorkspace'], |
| 94 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 95 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 96 | ], |
| 97 | ]) // checkout |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 98 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 99 | script |
| 100 | { |
| 101 | sh( |
| 102 | returnStatus: true, |
| 103 | // returnStdout: true, |
| 104 | script: """ |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 105 | if [ '${volthaSystemTestsChange}' != '' ] ; then |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 106 | cd "$WORKSPACE/voltha-system-tests" |
| 107 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} |
| 108 | git checkout FETCH_HEAD |
| 109 | exit 1 # verify fail |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 110 | fi |
| 111 | """) |
Joey Armstrong | 0c689df | 2023-03-03 16:03:50 -0500 | [diff] [blame] | 112 | } // step |
Joey Armstrong | db892b5 | 2023-03-03 10:44:06 -0500 | [diff] [blame] | 113 | |
Joey Armstrong | 9ed18e1 | 2023-03-07 10:40:14 -0500 | [diff] [blame] | 114 | iam |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 115 | { |
| 116 | leave = true |
| 117 | label = getIam() |
| 118 | } |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 119 | } // steps |
| 120 | } // stage |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 121 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 122 | // ----------------------------------------------------------------------- |
| 123 | // This checkout allows us to show changes in Jenkins |
| 124 | // we only do this on master as we don't branch all the repos for all the releases |
| 125 | // (we should compute the difference by tracking the container version, not the code) |
| 126 | // ----------------------------------------------------------------------- |
| 127 | stage('Download All the VOLTHA repos') |
| 128 | { |
| 129 | when { |
| 130 | expression { return "${branch}" == 'master'; } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 131 | } |
| 132 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 133 | steps { |
| 134 | checkout(changelog: true, |
| 135 | poll: false, |
| 136 | scm: [$class: 'RepoScm', |
| 137 | manifestRepositoryUrl: "${params.manifestUrl}", |
| 138 | manifestBranch: "${params.branch}", |
| 139 | currentBranch: true, |
| 140 | destinationDir: 'voltha', |
| 141 | forceSync: true, |
| 142 | resetFirst: true, |
| 143 | quiet: true, |
| 144 | jobs: 4, |
| 145 | showAllChanges: true] |
| 146 | ) |
| 147 | } |
| 148 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 149 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 150 | // ----------------------------------------------------------------------- |
| 151 | // ----------------------------------------------------------------------- |
| 152 | stage ('Initialize') |
| 153 | { |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 154 | steps |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 155 | { |
| 156 | sh( |
| 157 | returnStatus: true, |
| 158 | returnStdout: false, |
| 159 | script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| 160 | ) |
| 161 | script |
| 162 | { |
| 163 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml" |
| 164 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 165 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 166 | installVoltctl("${branch}") |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 167 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 168 | sh( |
| 169 | returnStatus: true, |
| 170 | returnStdout: false, |
| 171 | script: """ |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 172 | mkdir -p "$WORKSPACE/bin" |
| 173 | |
| 174 | # install kail |
| 175 | make -C "$WORKSPACE/voltha-system-tests" KAIL_PATH="$WORKSPACE/bin" kail |
| 176 | |
| 177 | # Default kind-voltha config doesn't work on ONF demo pod for accessing kvstore. |
| 178 | # The issue is that the mgmt node is also one of the k8s nodes and so port forwarding doesn't work. |
| 179 | # We should change this. In the meantime here is a workaround. |
| 180 | if [ "${params.branch}" == "master" ]; then |
| 181 | set +e |
| 182 | |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 183 | # Remove noise from voltha-core logs |
| 184 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model |
| 185 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
| 186 | # Remove noise from openolt logs |
| 187 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db |
| 188 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe |
| 189 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
| 190 | fi |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 191 | """) |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 192 | } // step |
| 193 | } // stage |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 194 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 195 | // ----------------------------------------------------------------------- |
| 196 | // ----------------------------------------------------------------------- |
| 197 | stage('Functional Tests') |
| 198 | { |
| 199 | environment |
| 200 | { |
| 201 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml" |
| 202 | ROBOT_FILE="Voltha_TT_PODTests.robot" |
| 203 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/tt-workflow/FunctionalTests" |
| 204 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 205 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 206 | steps { |
| 207 | sh(""" |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 208 | mkdir -p $ROBOT_LOGS_DIR |
| 209 | if ( ${powerSwitch} ); then |
| 210 | export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -i PowerSwitch -i sanityTT -i sanityTT-MCAST -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}" |
| 211 | if ( ${powerCycleOlt} ); then |
| 212 | ROBOT_MISC_ARGS+=" -v power_cycle_olt:True" |
| 213 | fi |
| 214 | else |
| 215 | export ROBOT_MISC_ARGS="--removekeywords wuks -i functionalTT -e PowerSwitch -i sanityTT -i sanityTT-MCAST -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}" |
| 216 | fi |
| 217 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 218 | make -C $WORKSPACE/voltha-system-tests voltha-tt-test |
| 219 | """) |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 220 | } |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 221 | } // stage |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 222 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 223 | // ----------------------------------------------------------------------- |
| 224 | // ----------------------------------------------------------------------- |
| 225 | stage('Failure/Recovery Tests') |
| 226 | { |
| 227 | environment |
| 228 | { |
| 229 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml" |
| 230 | ROBOT_FILE="Voltha_TT_FailureScenarios.robot" |
| 231 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/tt-workflow/FailureScenarios" |
| 232 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 233 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 234 | steps |
| 235 | { |
| 236 | sh(""" |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 237 | mkdir -p $ROBOT_LOGS_DIR |
| 238 | if [ ${params.enableMultiUni} = false ]; then |
| 239 | if ( ${powerSwitch} ); then |
| 240 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -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}" |
| 241 | else |
| 242 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -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}" |
| 243 | fi |
| 244 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 245 | make -C $WORKSPACE/voltha-system-tests voltha-tt-test || true |
| 246 | fi |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 247 | """) |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 248 | } |
| 249 | } // stage |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 250 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 251 | // ----------------------------------------------------------------------- |
| 252 | // ----------------------------------------------------------------------- |
| 253 | stage('Multi-Tcont Tests') |
| 254 | { |
| 255 | environment |
| 256 | { |
| 257 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml" |
| 258 | ROBOT_FILE="Voltha_TT_MultiTcontTests.robot" |
| 259 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/tt-workflow/MultiTcontScenarios" |
| 260 | ROBOT_TEST_INPUT_FILE="$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-TT-multi-tcont-tests-input.yaml" |
| 261 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 262 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 263 | steps |
| 264 | { |
| 265 | sh(""" |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 266 | mkdir -p $ROBOT_LOGS_DIR |
| 267 | if [ ${params.enableMultiUni} = false ]; then |
| 268 | if ( ${powerSwitch} ); then |
| 269 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -i PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v teardown_device:False -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE" |
| 270 | else |
| 271 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i functionalTT -e PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v teardown_device:False -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE" |
| 272 | fi |
| 273 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 274 | make -C $WORKSPACE/voltha-system-tests voltha-tt-test || true |
| 275 | fi |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 276 | """) |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 277 | } |
| 278 | } |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 279 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 280 | // ----------------------------------------------------------------------- |
| 281 | // ----------------------------------------------------------------------- |
| 282 | stage('Multicast Tests') |
| 283 | { |
| 284 | environment |
| 285 | { |
| 286 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml" |
| 287 | ROBOT_FILE="Voltha_TT_MulticastTests.robot" |
| 288 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/tt-workflow/MulticastTests" |
| 289 | ROBOT_TEST_INPUT_FILE="$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-TT-multicast-tests-input.yaml" |
| 290 | } |
| 291 | |
| 292 | steps |
| 293 | { |
| 294 | sh(""" |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 295 | mkdir -p $ROBOT_LOGS_DIR |
| 296 | if [ ${params.enableMultiUni} = true ]; then |
| 297 | if ( ${powerSwitch} ); then |
| 298 | export ROBOT_MISC_ARGS="--removekeywords wuks -i multicastTT -i PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v teardown_device:False -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE" |
| 299 | else |
| 300 | export ROBOT_MISC_ARGS="--removekeywords wuks -i multicastTT -e PowerSwitch -e bbsim -e notready -d $ROBOT_LOGS_DIR -v teardown_device:False -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE -v OLT_ADAPTER_APP_LABEL:${oltAdapterAppLabel} -V $ROBOT_TEST_INPUT_FILE" |
| 301 | fi |
| 302 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 303 | make -C $WORKSPACE/voltha-system-tests voltha-tt-test || true |
| 304 | fi |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 305 | """) |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 306 | } |
| 307 | } |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 308 | } |
| 309 | |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 310 | post |
| 311 | { |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 312 | always |
| 313 | { |
| 314 | getPodsInfo("$WORKSPACE/pods") |
| 315 | sh(returnStdout: false, script: ''' |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 316 | set +e |
| 317 | |
| 318 | # collect logs collected in the Robot Framework StartLogging keyword |
| 319 | cd $WORKSPACE |
| 320 | gzip *-combined.log || true |
| 321 | rm *-combined.log || true |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 322 | ''') |
| 323 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 324 | script { |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 325 | deployment_config.olts.each { olt -> |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 326 | if (olt.type == null || olt.type == "" || olt.type == "openolt") |
| 327 | { |
| 328 | sh(returnStdout: false, script: """ |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 329 | sshpass -p ${olt.pass} scp ${olt.user}@${olt.sship}:/var/log/openolt.log $WORKSPACE/openolt-${olt.sship}.log || true |
| 330 | sshpass -p ${olt.pass} scp ${olt.user}@${olt.sship}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log || true |
| 331 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.sship}.log # Remove escape sequences |
| 332 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log # Remove escape sequences |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 333 | """) |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 334 | } |
| 335 | } |
| 336 | } |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 337 | |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 338 | step([$class: 'RobotPublisher', |
| 339 | disableArchiveOutput: false, |
| 340 | logFileName: '**/log*.html', |
| 341 | otherFiles: '', |
| 342 | outputFileName: '**/output*.xml', |
| 343 | outputPath: 'RobotLogs', |
| 344 | passThreshold: 100, |
| 345 | reportFileName: '**/report*.html', |
| 346 | unstableThreshold: 0, |
| 347 | onlyCritical: true |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 348 | ]); |
Joey Armstrong | 1fa8cb8 | 2023-03-03 14:05:51 -0500 | [diff] [blame] | 349 | archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt' |
| 350 | } // always |
Joey Armstrong | df24f60 | 2023-03-02 18:18:21 -0500 | [diff] [blame] | 351 | } // post |
| 352 | } // pipeline |
| 353 | |
| 354 | // [EOF] |