2 # Copyright (C) 2018 Amdocs, Bell Canada
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # Execute tags built to support the hands on demo,
20 echo "Usage: demo.sh namespace <command> [<parameters>]"
22 echo " demo.sh <namespace> init"
23 echo " - Execute both init_customer + distribute"
25 echo " demo.sh <namespace> init_customer"
26 echo " - Create demo customer (Demonstration) and services, etc."
28 echo " demo.sh <namespace> distribute [<prefix>]"
29 echo " - Distribute demo models (demoVFW and demoVLB)"
31 echo " demo.sh <namespace> preload <vnf_name> <module_name>"
32 echo " - Preload data for VNF for the <module_name>"
34 echo " demo.sh <namespace> appc <module_name>"
35 echo " - provide APPC with vFW module mount point for closed loop"
37 echo " demo.sh <namespace> init_robot [ <etc_hosts_prefix> ]"
38 echo " - Initialize robot after all ONAP VMs have started"
40 echo " demo.sh <namespace> instantiateVFW"
41 echo " - Instantiate vFW module for the a demo customer (DemoCust<uuid>)"
43 echo " demo.sh <namespace> deleteVNF <module_name from instantiateVFW>"
44 echo " - Delete the module created by instantiateVFW"
46 echo " demo.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
47 echo " - Run heatbridge against the stack for the given service instance and service"
49 echo " demo.sh <namespace> vfwclosedloop <pgn-ip-address>"
50 echo " - vFWCL: Sets the packet generator to high and low rates, and checks whether the policy "
51 echo " kicks in to modulate the rates back to medium"
57 echo "Number of parameters:"
69 ## if more than 1 tag is supplied, the must be provided with -i or -e
80 read -s -p "WEB Site Password for user 'test': " WEB_PASSWORD
81 if [ "$WEB_PASSWORD" = "" ]; then
83 echo "WEB Password is required for user 'test'"
86 VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
89 VARIABLES="$VARIABLES -v HOSTS_PREFIX:$1"
102 TAG="InitDistribution"
105 VARIABLES="$VARIABLES -v DEMO_PREFIX:$1"
113 echo "Usage: demo.sh <namespace> preload <vnf_name> <module_name>"
116 VARIABLES="$VARIABLES -v VNF_NAME:$1"
118 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
122 TAG="APPCMountPointDemo"
125 echo "Usage: demo.sh <namespace> appc <module_name>"
128 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
133 VARIABLES="$VARIABLES -v GLOBAL_BUILD_NUMBER:$$"
140 echo "Usage: demo.sh <namespace> deleteVNF <module_name from instantiateVFW>"
144 if [ -e /opt/eteshare/${VARFILE} ]; then
145 VARIABLES="$VARIABLES -V /share/${VARFILE}"
147 echo "Cache file ${VARFILE} is not found"
156 echo "Usage: demo.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
159 VARIABLES="$VARIABLES -v HB_STACK:$1"
161 VARIABLES="$VARIABLES -v HB_SERVICE_INSTANCE_ID:$1"
163 VARIABLES="$VARIABLES -v HB_SERVICE:$1"
165 VARIABLES="$VARIABLES -v HB_IPV4_OAM_ADDRESS:$1"
173 TAG="distributeVFWNG"
177 TAG="DistributeDemoVFWDT"
180 instantiateDemoVFWDT)
181 TAG="instantiateVFWDT"
187 VARIABLES="$VARIABLES -v pkg_host:$1"
198 POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)
200 ETEHOME=/var/opt/ONAP
202 export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
203 OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key
204 DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
206 VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
208 kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} -i ${TAG} --display $DISPLAY_NUM 2> ${TAG}.out