blob: e3d05df0ef49fd59232eea1122bc3097bc92c5cd [file] [log] [blame]
vaibhavjayas002fb992018-08-31 06:22:26 +00001# 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 Khindaba48b012017-10-26 17:46:43 +000015#!/bin/bash
16
17#
kaihlavie87aac12019-05-09 16:31:15 +030018# Run the testsuite for the passed tag. Valid tags are listed in usage help
Mandeep Khindaba48b012017-10-26 17:46:43 +000019# Please clean up logs when you are done...
Mandeep Khindaba48b012017-10-26 17:46:43 +000020#
BorislavG4e8014a2018-02-27 15:04:26 +000021if [ "$1" == "" ] || [ "$2" == "" ]; then
marekpl1b6baa42019-08-02 18:11:42 +020022 echo "Usage: ete-k8s.sh [namespace] [tag] [execscript]"
Brian Freeman98e80ad2019-05-06 12:12:36 -050023 echo ""
kaihlavie87aac12019-05-09 16:31:15 +030024 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 Freeman77e84852020-11-24 09:47:19 -050031 echo " InitDistribution, PreloadDemo, deleteVNF, instantiateDemoVFWCL, instantiateVFW, "
Brian Freemanb5488192020-04-27 18:26:07 -050032 echo " instantiateVFWCL, instantiateVFWDT, instantiateVFWCLDN"
kaihlavie87aac12019-05-09 16:31:15 +030033 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 ""
marekpl1b6baa42019-08-02 18:11:42 +020040 echo " hvves.robot: HVVES, ete"
kaihlavie87aac12019-05-09 16:31:15 +030041 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020042 echo " model-distribution-vcpe.robot: distributevCPEResCust"
kaihlavie87aac12019-05-09 16:31:15 +030043 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020044 echo " model-distribution.robot: distribute, distributeVFWDT, distributeVLB"
kaihlavie87aac12019-05-09 16:31:15 +030045 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020046 echo " oof-*.robot: cmso, has, homing"
kaihlavie87aac12019-05-09 16:31:15 +030047 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020048 echo " pnf-registration.robot: ete, pnf_registrate"
kaihlavie87aac12019-05-09 16:31:15 +030049 echo ""
kaihlavi5996d7a2019-08-08 15:53:43 +030050 echo " post-install-tests.robot: dmaapacl, postinstall"
51 echo ""
52 echo " sdc-dcae-d.robot: sdc-dcae-d"
kaihlavie87aac12019-05-09 16:31:15 +030053 echo ""
Pawel Wieczorekc3563bc2019-11-25 15:40:04 +010054 echo " security.robot: security"
55 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020056 echo " update_onap_page.robot: UpdateWebPage"
kaihlavie87aac12019-05-09 16:31:15 +030057 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020058 echo " vnf-orchestration-direct-so.robot: instantiateVFWdirectso"
kaihlavie87aac12019-05-09 16:31:15 +030059 echo ""
marekpl1b6baa42019-08-02 18:11:42 +020060 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 Khindaba48b012017-10-26 17:46:43 +000063 exit
64fi
65
Gary Wu9b5fa0a2018-09-14 10:29:27 -070066set -x
Brian Freeman5073cbb2018-04-23 20:54:13 -050067
BorislavG4e8014a2018-02-27 15:04:26 +000068export NAMESPACE="$1"
Brian Freeman5073cbb2018-04-23 20:54:13 -050069
70POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)
71
Gary Wu42c42922018-11-01 11:57:27 -070072TAGS="-i $2"
Brian Freeman5073cbb2018-04-23 20:54:13 -050073
marekpl12dca2e2019-08-01 15:19:41 +020074DIR=$(dirname "$0")
marekpl1b6baa42019-08-02 18:11:42 +020075SCRIPTDIR=scripts/etescript
marekpl12dca2e2019-08-01 15:19:41 +020076
marekpl1b6baa42019-08-02 18:11:42 +020077ETEHOME=/var/opt/ONAP
78
79if [[ "${!#}" == "execscript" ]]; then
80 for script in $(ls -1 "$DIR/$SCRIPTDIR"); do
81 [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script"
marekpl12dca2e2019-08-01 15:19:41 +020082 done
83fi
84
Gary Wu42c42922018-11-01 11:57:27 -070085export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
86OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_ete_$2
87DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
Mandeep Khindaba48b012017-10-26 17:46:43 +000088
DR695H1f1bf372019-08-02 15:42:32 -040089VARIABLEFILES="-V /share/config/robot_properties.py"
Mandeep Khindaba48b012017-10-26 17:46:43 +000090VARIABLES="-v GLOBAL_BUILD_NUMBER:$$"
91
Pawel Wieczorekc3563bc2019-11-25 15:40:04 +010092case $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 ;;
104esac
105
Gary Wu42c42922018-11-01 11:57:27 -0700106kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display $DISPLAY_NUM