Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -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 | |
Matteo Scandolo | 0d0f290 | 2021-07-15 16:16:33 -0700 | [diff] [blame] | 15 | library identifier: 'cord-jenkins-libraries@master', |
| 16 | retriever: modernSCM([ |
| 17 | $class: 'GitSCMSource', |
| 18 | remote: 'https://gerrit.opencord.org/ci-management.git' |
| 19 | ]) |
| 20 | |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 21 | node { |
| 22 | // Need this so that deployment_config has global scope when it's read later |
| 23 | deployment_config = null |
| 24 | } |
| 25 | |
Hardik Windlass | 7e4e315 | 2021-09-29 06:42:05 +0000 | [diff] [blame] | 26 | def infraNamespace = "infra" |
| 27 | def volthaNamespace = "voltha" |
| 28 | |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 29 | pipeline { |
| 30 | /* no label, executor is determined by JJB */ |
| 31 | agent { |
| 32 | label "${params.buildNode}" |
| 33 | } |
| 34 | options { |
Hardik Windlass | d0f0166 | 2021-09-03 08:07:15 +0000 | [diff] [blame] | 35 | timeout(time: "${timeout}", unit: 'MINUTES') |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | environment { |
| 39 | KUBECONFIG="$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf" |
| 40 | VOLTCONFIG="$HOME/.volt/config-minimal" |
| 41 | PATH="$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 42 | } |
| 43 | |
| 44 | stages { |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 45 | stage('Clone voltha-system-tests') { |
| 46 | steps { |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 47 | step([$class: 'WsCleanup']) |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 48 | checkout([ |
| 49 | $class: 'GitSCM', |
| 50 | userRemoteConfigs: [[ |
| 51 | url: "https://gerrit.opencord.org/voltha-system-tests", |
Matteo Scandolo | a42c6f5 | 2020-09-19 01:35:12 +0000 | [diff] [blame] | 52 | refspec: "${volthaSystemTestsChange}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 53 | ]], |
Suchitra Vemuri | 1143ae3 | 2021-03-26 01:08:37 +0000 | [diff] [blame] | 54 | branches: [[ name: "${branch}", ]], |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 55 | extensions: [ |
| 56 | [$class: 'WipeWorkspace'], |
| 57 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 58 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 59 | ], |
| 60 | ]) |
Suchitra Vemuri | a38e541 | 2021-02-23 15:28:28 -0800 | [diff] [blame] | 61 | script { |
| 62 | sh(script:""" |
| 63 | if [ '${volthaSystemTestsChange}' != '' ] ; then |
| 64 | cd $WORKSPACE/voltha-system-tests; |
| 65 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 66 | fi |
| 67 | """) |
| 68 | } |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 69 | } |
| 70 | } |
Matteo Scandolo | 92a5cb6 | 2020-09-15 16:02:08 -0700 | [diff] [blame] | 71 | // This checkout allows us to show changes in Jenkins |
| 72 | // we only do this on master as we don't branch all the repos for all the releases |
| 73 | // (we should compute the difference by tracking the container version, not the code) |
| 74 | stage('Download All the VOLTHA repos') { |
| 75 | when { |
| 76 | expression { |
| 77 | return "${branch}" == 'master'; |
| 78 | } |
| 79 | } |
| 80 | steps { |
| 81 | checkout(changelog: true, |
| 82 | poll: false, |
| 83 | scm: [$class: 'RepoScm', |
| 84 | manifestRepositoryUrl: "${params.manifestUrl}", |
| 85 | manifestBranch: "${params.branch}", |
| 86 | currentBranch: true, |
| 87 | destinationDir: 'voltha', |
| 88 | forceSync: true, |
| 89 | resetFirst: true, |
| 90 | quiet: true, |
| 91 | jobs: 4, |
| 92 | showAllChanges: true] |
| 93 | ) |
| 94 | } |
| 95 | } |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 96 | stage ('Initialize') { |
| 97 | steps { |
Hardik Windlass | 6f854a1 | 2021-07-12 13:20:21 +0000 | [diff] [blame] | 98 | sh returnStdout: false, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 99 | script { |
| 100 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 101 | } |
Hardik Windlass | 9658cd2 | 2021-10-25 11:13:25 +0000 | [diff] [blame] | 102 | installVoltctl("${branch}") |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 103 | sh """ |
| 104 | ps -ef | grep port-forward |
| 105 | """ |
| 106 | |
| 107 | sh returnStdout: false, script: ''' |
| 108 | # remove orphaned port-forward from different namespaces |
| 109 | ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true |
| 110 | ''' |
| 111 | sh """ |
| 112 | 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"& |
| 113 | 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"& |
| 114 | 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"& |
| 115 | ps aux | grep port-forward |
| 116 | """ |
| 117 | sh """ |
| 118 | ps -ef | grep port-forward |
| 119 | """ |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 120 | sh returnStdout: false, script: """ |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 121 | mkdir -p $WORKSPACE/bin |
Hardik Windlass | 9658cd2 | 2021-10-25 11:13:25 +0000 | [diff] [blame] | 122 | # download kail |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 123 | bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/bin" |
Matteo Scandolo | 3fbb065 | 2020-07-22 08:50:02 -0700 | [diff] [blame] | 124 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 125 | # Default kind-voltha config doesn't work on ONF demo pod for accessing kvstore. |
| 126 | # The issue is that the mgmt node is also one of the k8s nodes and so port forwarding doesn't work. |
| 127 | # We should change this. In the meantime here is a workaround. |
Suchitra Vemuri | 1342143 | 2020-06-05 17:34:33 -0700 | [diff] [blame] | 128 | set +e |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 129 | |
Andrea Campanella | 9b23433 | 2020-04-24 12:22:18 +0200 | [diff] [blame] | 130 | |
| 131 | # Remove noise from voltha-core logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 132 | voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model |
| 133 | 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] | 134 | # Remove noise from openolt logs |
Suchitra Vemuri | a2a7f2c | 2020-06-08 14:05:06 -0700 | [diff] [blame] | 135 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db |
| 136 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe |
| 137 | voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 138 | """ |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | stage('Functional Tests') { |
| 143 | environment { |
Suchitra Vemuri | e4a5bcc | 2020-03-16 12:43:03 -0700 | [diff] [blame] | 144 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 145 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 146 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FunctionalTests" |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 147 | } |
| 148 | steps { |
| 149 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 150 | ps -ef | grep port-forward |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 151 | mkdir -p $ROBOT_LOGS_DIR |
Suchitra Vemuri | 627786a | 2020-06-18 16:52:05 -0700 | [diff] [blame] | 152 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 153 | 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] | 154 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 155 | 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] | 156 | fi |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 157 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 158 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 159 | """ |
| 160 | } |
| 161 | } |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 162 | |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 163 | stage('Failure/Recovery Tests') { |
| 164 | environment { |
| 165 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 166 | ROBOT_FILE="Voltha_DT_FailureScenarios.robot" |
| 167 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/FailureScenarios" |
| 168 | } |
| 169 | steps { |
| 170 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 171 | ps -ef | grep port-forward |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 172 | mkdir -p $ROBOT_LOGS_DIR |
| 173 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 174 | 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] | 175 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 176 | 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] | 177 | fi |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 178 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 179 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Andrea Campanella | f47a198 | 2020-04-21 11:53:31 +0200 | [diff] [blame] | 180 | """ |
| 181 | } |
| 182 | } |
| 183 | |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 184 | stage('Dataplane Tests') { |
| 185 | environment { |
Andy Bavier | 1541da8 | 2020-05-15 09:41:38 -0700 | [diff] [blame] | 186 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 187 | ROBOT_FILE="Voltha_DT_PODTests.robot" |
| 188 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/DataplaneTests" |
| 189 | } |
| 190 | steps { |
| 191 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 192 | ps -ef | grep port-forward |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 193 | mkdir -p $ROBOT_LOGS_DIR |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 194 | 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}" |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 195 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 196 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 197 | """ |
| 198 | } |
| 199 | } |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 200 | stage('HA Tests') { |
| 201 | environment { |
| 202 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 203 | ROBOT_FILE="Voltha_ONOSHATests.robot" |
| 204 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ONOSHAScenarios" |
| 205 | } |
| 206 | steps { |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 207 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 208 | ps -ef | grep port-forward |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 209 | mkdir -p $ROBOT_LOGS_DIR |
| 210 | 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}" |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 211 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 6784281 | 2021-07-13 16:52:13 -0700 | [diff] [blame] | 212 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
| 213 | """ |
Suchitra Vemuri | 5e8e789 | 2020-09-14 16:04:12 -0700 | [diff] [blame] | 214 | } |
| 215 | } |
Andy Bavier | 5ad87c9 | 2020-05-11 16:31:35 -0700 | [diff] [blame] | 216 | |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 217 | stage('Multiple OLT Tests') { |
| 218 | environment { |
| 219 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 220 | ROBOT_FILE="Voltha_DT_MultiOLT_Tests.robot" |
| 221 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/MultipleOLTScenarios" |
| 222 | } |
| 223 | steps { |
| 224 | sh """ |
Andrea Campanella | 9274f7d | 2021-11-18 15:42:06 -0800 | [diff] [blame] | 225 | ps -ef | grep port-forward |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 226 | mkdir -p $ROBOT_LOGS_DIR |
| 227 | if ( ${powerSwitch} ); then |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 228 | 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] | 229 | else |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 230 | 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] | 231 | fi |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 232 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Suchitra Vemuri | 0a9c8c6 | 2020-12-07 18:24:31 -0800 | [diff] [blame] | 233 | make -C $WORKSPACE/voltha-system-tests voltha-dt-test || true |
| 234 | """ |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 239 | stage('Error Scenario Tests') { |
| 240 | environment { |
| 241 | ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml" |
| 242 | ROBOT_FILE="Voltha_ErrorScenarios.robot" |
| 243 | ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/dt-workflow/ErrorScenarios" |
| 244 | } |
| 245 | steps { |
| 246 | sh """ |
| 247 | mkdir -p $ROBOT_LOGS_DIR |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 248 | 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}" |
Andrea Campanella | 79ced32 | 2021-11-03 17:24:26 +0000 | [diff] [blame] | 249 | ROBOT_MISC_ARGS+=" -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace}" |
Matteo Scandolo | 3dce2a1 | 2020-09-15 14:21:14 -0700 | [diff] [blame] | 250 | make -C $WORKSPACE/voltha-system-tests voltha-test || true |
Andrea Campanella | d924ce2 | 2020-04-20 16:40:41 +0200 | [diff] [blame] | 251 | """ |
| 252 | } |
Andrea Campanella | 7166637 | 2020-04-21 10:56:17 +0200 | [diff] [blame] | 253 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 254 | } |
| 255 | post { |
| 256 | always { |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 257 | getPodsInfo("$WORKSPACE/pods") |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 258 | sh returnStdout: false, script: ''' |
| 259 | set +e |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 260 | |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 261 | # collect logs collected in the Robot Framework StartLogging keyword |
| 262 | cd $WORKSPACE |
| 263 | gzip *-combined.log || true |
| 264 | rm *-combined.log || true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 265 | ''' |
| 266 | script { |
| 267 | deployment_config.olts.each { olt -> |
Andrea Campanella | 0d3110c | 2021-01-20 12:25:45 +0100 | [diff] [blame] | 268 | if (olt.type == null || olt.type == "" || olt.type == "openolt") { |
| 269 | sh returnStdout: false, script: """ |
| 270 | 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 |
| 271 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.sship}.log # Remove escape sequences |
| 272 | 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 |
| 273 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.sship}.log # Remove escape sequences |
| 274 | 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 |
| 275 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/startup-${olt.sship}.log || true # Remove escape sequences |
| 276 | 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 |
| 277 | sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt_process_watchdog-${olt.sship}.log || true # Remove escape sequences |
| 278 | """ |
| 279 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | step([$class: 'RobotPublisher', |
| 283 | disableArchiveOutput: false, |
| 284 | logFileName: '**/log*.html', |
| 285 | otherFiles: '', |
| 286 | outputFileName: '**/output*.xml', |
| 287 | outputPath: 'RobotLogs', |
| 288 | passThreshold: 100, |
| 289 | reportFileName: '**/report*.html', |
Andrea Campanella | abc0977 | 2021-06-16 12:08:57 +0200 | [diff] [blame] | 290 | unstableThreshold: 0, |
| 291 | onlyCritical: true |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 292 | ]); |
Matteo Scandolo | 5e7bd1d | 2021-07-16 13:29:42 -0700 | [diff] [blame] | 293 | archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt' |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 294 | } |
Suchitra Vemuri | 8d180ab | 2020-03-12 17:38:24 -0700 | [diff] [blame] | 295 | } |
| 296 | } |