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 | 7e4e315 | 2021-09-29 06:42:05 +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 | 92a5cb6 | 2020-09-15 16:02:08 -0700 | [diff] [blame] | 74 | // This checkout allows us to show changes in Jenkins |
| 75 | // we only do this on master as we don't branch all the repos for all the releases |
| 76 | // (we should compute the difference by tracking the container version, not the code) |
| 77 | stage('Download All the VOLTHA repos') { |
| 78 | when { |
| 79 | expression { |
| 80 | return "${branch}" == 'master'; |
| 81 | } |
| 82 | } |
| 83 | steps { |
| 84 | checkout(changelog: true, |
| 85 | poll: false, |
| 86 | scm: [$class: 'RepoScm', |
| 87 | manifestRepositoryUrl: "${params.manifestUrl}", |
| 88 | manifestBranch: "${params.branch}", |
| 89 | currentBranch: true, |
| 90 | destinationDir: 'voltha', |
| 91 | forceSync: true, |
| 92 | resetFirst: true, |
| 93 | quiet: true, |
| 94 | jobs: 4, |
| 95 | showAllChanges: true] |
| 96 | ) |
| 97 | } |
| 98 | } |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 99 | stage ('Initialize') { |
| 100 | steps { |
Hardik Windlass | 6f854a1 | 2021-07-12 13:20:21 +0000 | [diff] [blame] | 101 | sh returnStdout: false, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 102 | script { |
| 103 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 104 | } |
Hardik Windlass | 9658cd2 | 2021-10-25 11:13:25 +0000 | [diff] [blame] | 105 | installVoltctl("${branch}") |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 106 | sh """ |
| 107 | ps -ef | grep port-forward |
| 108 | """ |
| 109 | |
| 110 | sh returnStdout: false, script: ''' |
| 111 | # remove orphaned port-forward from different namespaces |
| 112 | ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true |
| 113 | ''' |
| 114 | sh """ |
| 115 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-api" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"& |
| 116 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="etcd" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd ${params.VolthaEtcdPort}:2379; done"& |
| 117 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="kafka" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"& |
| 118 | ps aux | grep port-forward |
| 119 | """ |
Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 120 | |
| 121 | sh("""ps -ef | grep port-forward""") |
| 122 | |
| 123 | sh(returnStdout: false, script: """ |
| 124 | mkdir -p "$WORKSPACE/bin" |
| 125 | |
| 126 | # install kail |
| 127 | make -C "$WORKSPACE/voltha-system-tests" KAIL_PATH="$WORKSPACE/bin" kail |
Matteo Scandolo | 3fbb065 | 2020-07-22 08:50:02 -0700 | [diff] [blame] | 128 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 129 | # Default kind-voltha config doesn't work on ONF demo pod for accessing kvstore. |
| 130 | # The issue is that the mgmt node is also one of the k8s nodes and so port forwarding doesn't work. |
| 131 | # We should change this. In the meantime here is a workaround. |
Suchitra Vemuri | 1342143 | 2020-06-05 17:34:33 -0700 | [diff] [blame] | 132 | set +e |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 133 | |
Roger Luethi | 3dd65a7 | 2023-09-20 13:10:29 +0200 | [diff] [blame] | 134 | # Have voltctl exit with error status 1 and warning if etcd is unavailable. |
| 135 | voltctl log level list |
| 136 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 137 | # Remove noise from voltha-core logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 138 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model |
| 139 | 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] | 140 | # Remove noise from openolt logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 141 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db |
| 142 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe |
| 143 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
Joey Armstrong | 16bd8e8 | 2023-01-12 15:20:06 -0500 | [diff] [blame] | 144 | """) |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | |
| 148 | stage('Functional Tests') { |
| 149 | environment { |
Suchitra Vemuri | e4a5bcc | 2020-03-16 12:43:03 -0700 | [diff] [blame] | 150 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 151 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 152 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FunctionalTests" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 153 | } |
| 154 | steps { |
| 155 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 156 | ps -ef | grep port-forward |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 157 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 158 | if [ ${params.withFttb} = false ]; then |
| 159 | if ( ${powerSwitch} ); then |
| 160 | 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}" |
| 161 | if ( ${powerCycleOlt} ); then |
| 162 | ROBOT_MISC_ARGS+=" -v power_cycle_olt:True" |
| 163 | fi |
| 164 | else |
| 165 | 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}" |
| 166 | fi |
| 167 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 168 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Suchitra Vemuri | 627786a | 2020-06-18 16:52:05 -0700 | [diff] [blame] | 169 | fi |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 170 | """ |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | stage('FTTB Functional Tests') { |
| 175 | environment { |
| 176 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 177 | ROBOT_FILE="Voltha_DT_FTTB_Tests.robot" |
| 178 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FunctionalTests" |
| 179 | } |
| 180 | steps { |
| 181 | sh """ |
| 182 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | 6f7e30b | 2022-05-16 17:13:41 +0530 | [diff] [blame] | 183 | if [ ${params.withFttb} = true ]; then |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 184 | export ROBOT_MISC_ARGS="--removekeywords wuks -L TRACE -i sanityDtFttb -e bbsim -e notready -d $ROBOT_LOGS_DIR -v POD_NAME:${configFileName} -v KUBERNETES_CONFIGS_DIR:$WORKSPACE/${configBaseDir}/${configKubernetesDir} -v container_log_dir:$WORKSPACE" |
| 185 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace} -v has_dataplane:False" |
| 186 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
| 187 | fi |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 188 | """ |
| 189 | } |
| 190 | } |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 191 | |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 192 | stage('Failure/Recovery Tests') { |
| 193 | environment { |
| 194 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 195 | ROBOT_FILE="Voltha_DT_FailureScenarios.robot" |
| 196 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FailureScenarios" |
| 197 | } |
| 198 | steps { |
| 199 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 200 | ps -ef | grep port-forward |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 201 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 202 | if [ ${params.withFttb} = false ]; then |
| 203 | if ( ${powerSwitch} ); then |
| 204 | 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}" |
| 205 | else |
| 206 | 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}" |
| 207 | fi |
| 208 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 209 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 210 | fi |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 211 | """ |
| 212 | } |
| 213 | } |
| 214 | |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 215 | stage('Dataplane Tests') { |
| 216 | environment { |
Andy Bavier | 1541da8 | 2020-05-15 09:41:38 -0700 | [diff] [blame] | 217 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 218 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
| 219 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/DataplaneTests" |
| 220 | } |
| 221 | steps { |
| 222 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 223 | ps -ef | grep port-forward |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 224 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 225 | if [ ${params.withFttb} = false ]; then |
| 226 | 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}" |
| 227 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 228 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
| 229 | fi |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 230 | """ |
| 231 | } |
| 232 | } |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 233 | stage('HA Tests') { |
| 234 | environment { |
| 235 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 236 | ROBOT_FILE="Voltha_ONOSHATests.robot" |
| 237 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ONOSHAScenarios" |
| 238 | } |
| 239 | steps { |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 240 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 241 | ps -ef | grep port-forward |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 242 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 243 | if [ ${params.withFttb} = false ]; then |
| 244 | 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}" |
| 245 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 246 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
| 247 | fi |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 248 | """ |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 249 | } |
| 250 | } |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 251 | |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 252 | stage('Multiple OLT Tests') { |
| 253 | environment { |
| 254 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 255 | ROBOT_FILE="Voltha_DT_MultiOLT_Tests.robot" |
| 256 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/MultipleOLTScenarios" |
| 257 | } |
| 258 | steps { |
| 259 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 260 | ps -ef | grep port-forward |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 261 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 262 | if [ ${params.withFttb} = false ]; then |
| 263 | if ( ${powerSwitch} ); then |
| 264 | 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}" |
| 265 | else |
| 266 | 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}" |
| 267 | fi |
| 268 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 269 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 270 | fi |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 271 | """ |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 276 | stage('Error Scenario Tests') { |
| 277 | environment { |
| 278 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 279 | ROBOT_FILE="Voltha_ErrorScenarios.robot" |
| 280 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/ErrorScenarios" |
| 281 | } |
| 282 | steps { |
| 283 | sh """ |
| 284 | mkdir -p $ROBOT_LOGS_DIR |
Hardik Windlass | c97ceae | 2022-05-13 10:12:55 +0530 | [diff] [blame] | 285 | if [ ${params.withFttb} = false ]; then |
| 286 | 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}" |
| 287 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
| 288 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
| 289 | fi |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 290 | """ |
| 291 | } |
Andrea Campanella | 7166637 | 2020-04-21 10:56:17 +0200 | [diff] [blame] | 292 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 293 | } |
| 294 | post { |
| 295 | always { |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 296 | getPodsInfo("$WORKSPACE/pods") |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 297 | sh returnStdout: false, script: ''' |
| 298 | set +e |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 299 | |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 300 | # collect logs collected in the Robot Framework StartLogging keyword |
| 301 | cd $WORKSPACE |
| 302 | gzip *-combined.log || true |
| 303 | rm *-combined.log || true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 304 | ''' |
| 305 | script { |
| 306 | deployment_config.olts.each { olt -> |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 307 | if (olt.type == null || olt.type == "" || olt.type == "openolt") { |
| 308 | sh returnStdout: false, script: """ |
| 309 | 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 |
| 310 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.sship}.log # Remove escape sequences |
| 311 | 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 |
| 312 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log # Remove escape sequences |
| 313 | 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 |
| 314 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/startup-${olt.sship}.log || true # Remove escape sequences |
| 315 | 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 |
| 316 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt_process_watchdog-${olt.sship}.log || true # Remove escape sequences |
| 317 | """ |
| 318 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 319 | } |
| 320 | } |
| 321 | step([$class: 'RobotPublisher', |
| 322 | disableArchiveOutput: false, |
| 323 | logFileName: '**/log*.html', |
| 324 | otherFiles: '', |
| 325 | outputFileName: '**/output*.xml', |
| 326 | outputPath: 'RobotLogs', |
| 327 | passThreshold: 100, |
| 328 | reportFileName: '**/report*.html', |
Andrea Campanella | abc0977 | 2021-06-16 12:08:57 +0200 | [diff] [blame] | 329 | unstableThreshold: 0, |
| 330 | onlyCritical: true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 331 | ]); |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 332 | archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt' |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 333 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 334 | } |
| 335 | } |