#!/bin/bash
# Copyright (C) 2018 Amdocs, Bell Canada
# Modifications Copyright (C) 2019 Samsung
# Modifications Copyright (C) 2020 Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Execute tags built to support the hands-on demo
#
usage ()
{
    echo "Usage: demo-k8s.sh <namespace> <command> [<parameters>] [execscript]"
    echo " "
    echo "       demo-k8s.sh <namespace> init"
    echo "               - Execute both init_customer + distribute"
    echo " "
    echo "       demo-k8s.sh <namespace> init_customer"
    echo "               - Create demo customer (Demonstration) and services, etc."
    echo " "
    echo "       demo-k8s.sh <namespace> distribute  [<prefix>]"
    echo "               - Distribute demo models (demoVFW and demoVLB)"
    echo " "
    echo "       demo-k8s.sh <namespace> preload <vnf_name> <module_name>"
    echo "               - Preload data for VNF for the <module_name>"
    echo " "
    echo "       demo-k8s.sh <namespace> appc <module_name>"
    echo "               - provide APPC with vFW module mount point for closed loop"
    echo " "
    echo "       demo-k8s.sh <namespace> init_robot [ <etc_hosts_prefix> ]"
    echo "               - Initialize robot after all ONAP VMs have started"
    echo " "
    echo "       demo-k8s.sh <namespace> instantiateVFW"
    echo "               - Instantiate vFW module for the demo customer (DemoCust<uuid>)"
    echo " "
    echo "       demo-k8s.sh <namespace> instantiateVFWdirectso  csar_filename"
    echo "               - Instantiate vFW module using direct SO interface using previously distributed model "
        echo "                 that is in /tmp/csar in robot container"
    echo " "
        echo "       demo-k8s.sh <namespace> instantiateVLB_CDS"
        echo "               - Instantiate vLB module using CDS with a preloaded CBA "
        echo " "
    echo "       demo-k8s.sh <namespace> deleteVNF <module_name from instantiateVFW>"
    echo "               - Delete the module created by instantiateVFW"
    echo " "
    echo "       demo-k8s.sh <namespace> vfwclosedloop <pgn-ip-address>"
        echo "               - vFWCL: Sets the packet generator to high and low rates, and checks whether the policy "
        echo "                 kicks in to modulate the rates back to medium"
    echo " "
    echo "       demo-k8s.sh <namespace> <command> [<parameters>] execscript"
    echo "               - Optional parameter to execute user custom scripts located in scripts/demoscript directory"
    echo " "
}

# Check if execscript flag is used and drop it from input arguments

if [ "${!#}" = "execscript" ]; then
        set -- "${@:1:$#-1}"
        execscript=true
fi

# Set the defaults

echo "Number of parameters:"
echo $#

if [ $# -lt 2 ];then
    usage
    exit
fi

NAMESPACE=$1
shift

##
## if more than 1 tag is supplied, the must be provided with -i or -e
##
while [ $# -gt 0 ]
do
    key="$1"
        echo "KEY:"
        echo $key

    case $key in
        init_robot)
            TAG="UpdateWebPage"
            echo "WEB Site Password for user 'test': "
            stty -echo
            read WEB_PASSWORD
            stty echo
            if [ "$WEB_PASSWORD" = "" ]; then
                echo ""
                echo "WEB Password is required for user 'test'"
                exit
            fi
            VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
            shift
            if [ $# -eq 2 ];then
                VARIABLES="$VARIABLES -v HOSTS_PREFIX:$1"
            fi
            shift
            ;;
        init)
            TAG="InitDemo"
            shift
            ;;
        vescollector)
            TAG="vescollector"
            shift
            ;;
        distribute_vcpe)
            TAG="distributeVCPE"
            shift
            ;;
        init_customer)
            TAG="InitCustomer"
            shift
            ;;
        distribute)
            TAG="InitDistribution"
            shift
            if [ $# -eq 1 ];then
                VARIABLES="$VARIABLES -v DEMO_PREFIX:$1"
            fi
            shift
            ;;
        preload)
            TAG="PreloadDemo"
            shift
            if [ $# -ne 2 ];then
                echo "Usage: demo-k8s.sh <namespace> preload <vnf_name> <module_name>"
                exit
            fi
            VARIABLES="$VARIABLES -v VNF_NAME:$1"
            shift
            VARIABLES="$VARIABLES -v MODULE_NAME:$1"
            shift
            ;;
        appc)
            TAG="APPCMountPointDemo"
            shift
            if [ $# -ne 1 ];then
                    echo "Usage: demo-k8s.sh <namespace> appc <module_name>"
                    exit
                fi
            VARIABLES="$VARIABLES -v MODULE_NAME:$1"
            shift
            ;;
        instantiateVFW)
            TAG="instantiateVFW"
            VARIABLES="$VARIABLES -v GLOBAL_BUILD_NUMBER:$$"
            shift
            ;;
        instantiateVFWdirectso)
                        TAG="instantiateVFWdirectso"
                        shift
                        if [ $# -ne 1 ];then
                                        echo "Usage: demo-k8s.sh <namespace> instantiateVFWdirectso <csar_filename>"
                                        exit
                                fi
                        VARIABLES="$VARIABLES -v CSAR_FILE:$1 -v GLOBAL_BUILD_NUMBER:$$"
                        shift
                        ;;
        instantiateVLB_CDS)
                        TAG="instantiateVLB_CDS"
                        VARIABLES="$VARIABLES -v GLOBAL_BUILD_NUMBER:$$"
                        shift
                        ;;
        deleteVNF)
            TAG="deleteVNF"
            shift
            if [ $# -ne 1 ];then
                echo "Usage: demo-k8s.sh <namespace> deleteVNF <module_name from instantiateVFW>"
                exit
            fi
            VARFILE=$1.py
            VARIABLES="$VARIABLES -V /share/${VARFILE}"
            shift
            ;;
        cds)
            TAG="cds"
            shift
            ;;
        distributeVFWNG)
                        TAG="distributeVFWNG"
                        shift
                        ;;
        distributeDemoVFWDT)
                        TAG="DistributeDemoVFWDT"
                        shift
                        ;;
        instantiateDemoVFWDT)
                        TAG="instantiateVFWDT"
                        shift
                        ;;
        vfwclosedloop)
                        TAG="vfwclosedloop"
                        shift
                        VARIABLES="$VARIABLES -v PACKET_GENERATOR_HOST:$1 -v pkg_host:$1"
                        shift
                        ;;
        *)
            usage
            exit
    esac
done

set -x

POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)

DIR=$(dirname "$0")
SCRIPTDIR=scripts/demoscript

ETEHOME=/var/opt/ONAP

if [ $execscript ]; then
   for script in $(ls -1 "$DIR/$SCRIPTDIR"); do
      [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && . "$DIR/$SCRIPTDIR/$script"
   done
fi

export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec  ${POD}  -- bash -c "ls -1q /share/logs/ | wc -l")
OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key
DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))

VARIABLEFILES="-V /share/config/robot_properties.py"

kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} -i ${TAG} --display $DISPLAY_NUM 2> ${TAG}.out
