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