Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # |
| 4 | # Run the testsuite for the passed tag. Valid tags are ete, health, closedloop, instantiate |
| 5 | # Please clean up logs when you are done... |
| 6 | # Note: Do not run multiple concurrent ete.sh as the --display is not parameterized and tests will collide |
| 7 | # |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 8 | if [ "$1" == "" ] || [ "$2" == "" ]; then |
Helen Chen | 2d72290 | 2018-04-12 18:57:14 -0700 | [diff] [blame] | 9 | echo "Usage: ete-k8s.sh [namespace] [ health | ete | closedloop | instantiate | distribute ]" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 10 | exit |
| 11 | fi |
| 12 | |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 13 | |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 14 | export NAMESPACE="$1" |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 15 | |
| 16 | POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) |
| 17 | |
| 18 | |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 19 | export TAGS="-i $2" |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 20 | export ETEHOME=/var/opt/OpenECOMP_ETE |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 21 | export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l") |
| 22 | export OUTPUT_FOLDER=ETE_$(printf %04d $GLOBAL_BUILD_NUMBER)_$2 |
| 23 | |
| 24 | #export OUTPUT_FOLDER=ETE_$$ |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 25 | |
| 26 | VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py" |
| 27 | VARIABLES="-v GLOBAL_BUILD_NUMBER:$$" |
| 28 | |
BorislavG | 8bfc6cf | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 29 | kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display 88 |
Brian Freeman | 6b89ba0 | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 30 | |