vaibhavjayas | ea9aee0 | 2018-08-31 06:22:26 +0000 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, Bell Canada |
| 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 | |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 15 | #!/bin/bash |
| 16 | |
| 17 | # |
| 18 | # Run the testsuite for the passed tag. Valid tags are ete, health, closedloop, instantiate |
| 19 | # Please clean up logs when you are done... |
| 20 | # Note: Do not run multiple concurrent ete.sh as the --display is not parameterized and tests will collide |
| 21 | # |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 22 | if [ "$1" == "" ] || [ "$2" == "" ]; then |
Gary Wu | 9d5abb4 | 2018-11-02 13:48:21 -0700 | [diff] [blame] | 23 | echo "Usage: ete-k8s.sh [namespace] [ health | healthdist | distribute | instantiate | instantiateVFWCL | instantiateDemoVFWCL | | portal ]" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 24 | exit |
| 25 | fi |
| 26 | |
Gary Wu | bf7f159 | 2018-09-14 10:29:27 -0700 | [diff] [blame] | 27 | set -x |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 28 | |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 29 | export NAMESPACE="$1" |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 30 | |
| 31 | POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) |
| 32 | |
| 33 | |
Gary Wu | 4ec2c67 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 34 | TAGS="-i $2" |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 35 | |
Gary Wu | 4ec2c67 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 36 | ETEHOME=/var/opt/OpenECOMP_ETE |
| 37 | export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l") |
| 38 | OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_ete_$2 |
| 39 | DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90)) |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 40 | |
| 41 | VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py" |
| 42 | VARIABLES="-v GLOBAL_BUILD_NUMBER:$$" |
| 43 | |
Gary Wu | 4ec2c67 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 44 | kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display $DISPLAY_NUM |