2 # Copyright (C) 2018 Amdocs, Bell Canada
3 # Modifications Copyright (C) 2019 Samsung
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Execute tags built to support the hands-on demo
21 echo "Usage: demo-k8s.sh <namespace> <command> [<parameters>]"
23 echo " demo-k8s.sh <namespace> init"
24 echo " - Execute both init_customer + distribute"
26 echo " demo-k8s.sh <namespace> init_customer"
27 echo " - Create demo customer (Demonstration) and services, etc."
29 echo " demo-k8s.sh <namespace> distribute [<prefix>]"
30 echo " - Distribute demo models (demoVFW and demoVLB)"
32 echo " demo-k8s.sh <namespace> preload <vnf_name> <module_name>"
33 echo " - Preload data for VNF for the <module_name>"
35 echo " demo-k8s.sh <namespace> appc <module_name>"
36 echo " - provide APPC with vFW module mount point for closed loop"
38 echo " demo-k8s.sh <namespace> init_robot [ <etc_hosts_prefix> ]"
39 echo " - Initialize robot after all ONAP VMs have started"
41 echo " demo-k8s.sh <namespace> instantiateVFW"
42 echo " - Instantiate vFW module for the demo customer (DemoCust<uuid>)"
44 echo " demo-k8s.sh <namespace> deleteVNF <module_name from instantiateVFW>"
45 echo " - Delete the module created by instantiateVFW"
47 echo " demo-k8s.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
48 echo " - Run heatbridge against the stack for the given service instance and service"
50 echo " demo-k8s.sh <namespace> vfwclosedloop <pgn-ip-address>"
51 echo " - vFWCL: Sets the packet generator to high and low rates, and checks whether the policy "
52 echo " kicks in to modulate the rates back to medium"
58 echo "Number of parameters:"
70 ## if more than 1 tag is supplied, the must be provided with -i or -e
81 read -s -p "WEB Site Password for user 'test': " WEB_PASSWORD
82 if [ "$WEB_PASSWORD" = "" ]; then
84 echo "WEB Password is required for user 'test'"
87 VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
90 VARIABLES="$VARIABLES -v HOSTS_PREFIX:$1"
103 TAG="InitDistribution"
106 VARIABLES="$VARIABLES -v DEMO_PREFIX:$1"
114 echo "Usage: demo-k8s.sh <namespace> preload <vnf_name> <module_name>"
117 VARIABLES="$VARIABLES -v VNF_NAME:$1"
119 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
123 TAG="APPCMountPointDemo"
126 echo "Usage: demo-k8s.sh <namespace> appc <module_name>"
129 VARIABLES="$VARIABLES -v MODULE_NAME:$1"
134 VARIABLES="$VARIABLES -v GLOBAL_BUILD_NUMBER:$$"
141 echo "Usage: demo-k8s.sh <namespace> deleteVNF <module_name from instantiateVFW>"
145 if [ -e /opt/eteshare/${VARFILE} ]; then
146 VARIABLES="$VARIABLES -V /share/${VARFILE}"
148 echo "Cache file ${VARFILE} is not found"
157 echo "Usage: demo-k8s.sh <namespace> heatbridge <stack_name> <service_instance_id> <service> <oam-ip-address>"
160 VARIABLES="$VARIABLES -v HB_STACK:$1"
162 VARIABLES="$VARIABLES -v HB_SERVICE_INSTANCE_ID:$1"
164 VARIABLES="$VARIABLES -v HB_SERVICE:$1"
166 VARIABLES="$VARIABLES -v HB_IPV4_OAM_ADDRESS:$1"
174 TAG="distributeVFWNG"
178 TAG="DistributeDemoVFWDT"
181 instantiateDemoVFWDT)
182 TAG="instantiateVFWDT"
188 VARIABLES="$VARIABLES -v pkg_host:$1"
199 POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)
201 ETEHOME=/var/opt/ONAP
203 export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
204 OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key
205 DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
207 VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
209 kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} -i ${TAG} --display $DISPLAY_NUM 2> ${TAG}.out