vaibhavjayas | 002fb99 | 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 | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 15 | #!/bin/bash |
| 16 | |
| 17 | # |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 18 | # Run the testsuite for the passed tag. Valid tags are listed in usage help |
Mandeep Khinda | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 19 | # Please clean up logs when you are done... |
Mandeep Khinda | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 20 | # |
BorislavG | 4e8014a | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 21 | if [ "$1" == "" ] || [ "$2" == "" ]; then |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 22 | echo "Usage: ete-k8s.sh [namespace] [tag] [execscript]" |
Brian Freeman | 98e80ad | 2019-05-06 12:12:36 -0500 | [diff] [blame] | 23 | echo "" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 24 | echo " List of test case tags (filename for intent: tag)" |
| 25 | echo "" |
| 26 | echo " cds.robot: cds" |
| 27 | echo "" |
| 28 | echo " clamp.robot: clamp" |
| 29 | echo "" |
| 30 | echo " demo.robot: InitDemo, InitCustomer, APPCCDTPreloadDemo, APPCMountPointDemo, DistributeDemoVFWDT, DistributeVFWNG," |
Brian Freeman | b548819 | 2020-04-27 18:26:07 -0500 | [diff] [blame] | 31 | echo " InitDistribution, PreloadDemo, deleteVNF, heatbridge, instantiateDemoVFWCL, instantiateVFW, " |
| 32 | echo " instantiateVFWCL, instantiateVFWDT, instantiateVFWCLDN" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 33 | echo "" |
| 34 | echo " health-check.robot: health, core, small, medium, 3rdparty, api, datarouter, externalapi, health-aaf, health-aai, health-appc," |
| 35 | echo " health-clamp, health-cli, health-dcae, health-dmaap, health-log, health-modeling, health-msb," |
| 36 | echo " health-multicloud, health-oof, health-policy, health-pomba, health-portal, health-sdc, health-sdnc," |
| 37 | echo " health-so, health-uui, health-vfc, health-vid, health-vnfsdk, healthdist, healthlogin, healthmr," |
| 38 | echo " healthportalapp, multicloud, oom" |
| 39 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 40 | echo " hvves.robot: HVVES, ete" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 41 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 42 | echo " model-distribution-vcpe.robot: distributevCPEResCust" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 43 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 44 | echo " model-distribution.robot: distribute, distributeVFWDT, distributeVLB" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 45 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 46 | echo " oof-*.robot: cmso, has, homing" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 47 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 48 | echo " pnf-registration.robot: ete, pnf_registrate" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 49 | echo "" |
kaihlavi | 5996d7a | 2019-08-08 15:53:43 +0300 | [diff] [blame] | 50 | echo " post-install-tests.robot: dmaapacl, postinstall" |
| 51 | echo "" |
| 52 | echo " sdc-dcae-d.robot: sdc-dcae-d" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 53 | echo "" |
Pawel Wieczorek | c3563bc | 2019-11-25 15:40:04 +0100 | [diff] [blame] | 54 | echo " security.robot: security" |
| 55 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 56 | echo " update_onap_page.robot: UpdateWebPage" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 57 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 58 | echo " vnf-orchestration-direct-so.robot: instantiateVFWdirectso" |
kaihlavi | e87aac1 | 2019-05-09 16:31:15 +0300 | [diff] [blame] | 59 | echo "" |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 60 | echo " vnf-orchestration.robot: instantiate, instantiateNoDelete, stability72hr" |
| 61 | echo "" |
| 62 | echo " [execscript] - optional parameter to execute user custom scripts located in scripts/etescript directory" |
Mandeep Khinda | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 63 | exit |
| 64 | fi |
| 65 | |
Gary Wu | 9b5fa0a | 2018-09-14 10:29:27 -0700 | [diff] [blame] | 66 | set -x |
Brian Freeman | 5073cbb | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 67 | |
BorislavG | 4e8014a | 2018-02-27 15:04:26 +0000 | [diff] [blame] | 68 | export NAMESPACE="$1" |
Brian Freeman | 5073cbb | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 69 | |
| 70 | POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) |
| 71 | |
Gary Wu | 42c4292 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 72 | TAGS="-i $2" |
Brian Freeman | 5073cbb | 2018-04-23 20:54:13 -0500 | [diff] [blame] | 73 | |
marekpl | 12dca2e | 2019-08-01 15:19:41 +0200 | [diff] [blame] | 74 | DIR=$(dirname "$0") |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 75 | SCRIPTDIR=scripts/etescript |
marekpl | 12dca2e | 2019-08-01 15:19:41 +0200 | [diff] [blame] | 76 | |
marekpl | 1b6baa4 | 2019-08-02 18:11:42 +0200 | [diff] [blame] | 77 | ETEHOME=/var/opt/ONAP |
| 78 | |
| 79 | if [[ "${!#}" == "execscript" ]]; then |
| 80 | for script in $(ls -1 "$DIR/$SCRIPTDIR"); do |
| 81 | [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script" |
marekpl | 12dca2e | 2019-08-01 15:19:41 +0200 | [diff] [blame] | 82 | done |
| 83 | fi |
| 84 | |
Gary Wu | 42c4292 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 85 | export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l") |
| 86 | OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_ete_$2 |
| 87 | DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90)) |
Mandeep Khinda | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 88 | |
DR695H | 1f1bf37 | 2019-08-02 15:42:32 -0400 | [diff] [blame] | 89 | VARIABLEFILES="-V /share/config/robot_properties.py" |
Mandeep Khinda | ba48b01 | 2017-10-26 17:46:43 +0000 | [diff] [blame] | 90 | VARIABLES="-v GLOBAL_BUILD_NUMBER:$$" |
| 91 | |
Pawel Wieczorek | c3563bc | 2019-11-25 15:40:04 +0100 | [diff] [blame] | 92 | case $2 in |
| 93 | security) |
| 94 | if [ -z "$NODEPORTS_FILE" ]; then |
| 95 | echo "Security tests require gathering additional information on ONAP cluster." |
| 96 | echo "It is unavailable from within Robot pod." |
| 97 | echo "" |
| 98 | echo "Rerun command with \"execscript\" argument, e.g." |
| 99 | echo "$ $0 onap security execscript" |
| 100 | exit |
| 101 | fi |
| 102 | VARIABLES="${VARIABLES} -v ACTUAL_NODEPORTS_FILE:${NODEPORTS_FILE}" |
| 103 | ;; |
| 104 | esac |
| 105 | |
Gary Wu | 42c4292 | 2018-11-01 11:57:27 -0700 | [diff] [blame] | 106 | kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display $DISPLAY_NUM |