1 # Copyright © 2018 Amdocs, Bell Canada
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # Execute tags built to support the hands on demo,
22 echo "Usage: demo.sh namespace <command> [<parameters>]"
24 echo " demo.sh <namespace> init"
25 echo " - Execute both init_customer + distribute"
27 echo " demo.sh <namespace> init_customer"
28 echo " - Create demo customer (Demonstration) and services, etc."
30 echo " demo.sh <namespace> distribute [<prefix>]"
31 echo " - Distribute demo models (demoVFW and demoVLB)"
33 echo " demo.sh <namespace> preload <vnf_name> <module_name>"
34 echo " - Preload data for VNF for the <module_name>"
36 echo " demo.sh <namespace> appc <module_name>"
37 echo " - provide APPC with vFW module mount point for closed loop"
39 echo " demo.sh <namespace> init_robot [ <etc_hosts_prefix> ]"
40 echo " - Initialize robot after all ONAP VMs have started"
42 echo " demo.sh <namespace> instantiateVFW"
43 echo " - Instantiate vFW module for the a demo customer (DemoCust<uuid>)"
45 echo " demo.sh <namespace> deleteVNF <module_name from instantiateVFW>"
46 echo " - Delete the module created by instantiateVFW"
48 echo " demo.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
49 echo " - Run heatbridge against the stack for the given service instance and service"
54 echo "Number of parameters:"
66 ## if more than 1 tag is supplied, the must be provided with -i or -e
77 read -s -p "WEB Site Password for user 'test': " WEB_PASSWORD
78 if [ "$WEB_PASSWORD" = "" ]; then
80 echo "WEB Password is required for user 'test'"
83 VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
86 VARIABLES="$VARIABLES -v HOSTS_PREFIX:$1"
99 TAG="InitDistribution"
102 VARIABLES="$VARIABLES -v DEMO_PREFIX:$1"
110 echo "Usage: demo.sh <namespace> preload <vnf_name> <module_name>"
113 VARIABLES="$VARIABLES -v VNF_NAME:$1"
115 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
119 TAG="APPCMountPointDemo"
122 echo "Usage: demo.sh <namespace> appc <module_name>"
125 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
130 VARIABLES="$VARIABLES -v GLOBAL_BUILD_NUMBER:$$"
137 echo "Usage: demo.sh <namespace> deleteVNF <module_name from instantiateVFW>"
141 if [ -e /opt/eteshare/${VARFILE} ]; then
142 VARIABLES="$VARIABLES -V /share/${VARFILE}"
144 echo "Cache file ${VARFILE} is not found"
153 echo "Usage: demo.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
156 VARIABLES="$VARIABLES -v HB_STACK:$1"
158 VARIABLES="$VARIABLES -v HB_SERVICE_INSTANCE_ID:$1"
160 VARIABLES="$VARIABLES -v HB_SERVICE:$1"
162 VARIABLES="$VARIABLES -v HB_IPV4_OAM_ADDRESS:$1"
170 TAG="distributeVFWNG"
181 POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)
183 ETEHOME=/var/opt/OpenECOMP_ETE
185 export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
186 OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key
187 DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
189 VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
191 kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} -i ${TAG} --display $DISPLAY_NUM 2> ${TAG}.out