blob: 95d97ca4f3c0f7cc7d2cbbdbdc1ffd6203bcbf4f [file] [log] [blame]
tragait9bbcb1b2020-02-24 16:33:50 +00001#!/bin/bash
2#
3# ============LICENSE_START=======================================================
4# Copyright (C) 2020 Nordix Foundation.
5# ================================================================================
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20
21# @author Rahul Tyagi (rahul.tyagi@est.tech)
22
23
24SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25export PARENT=usecases
26export SUB_PARENT=pnf-sw-upgrade
27source ${WORKSPACE}/plans/$PARENT/$SUB_PARENT/test.properties
28export $PROJECT_NAME
29export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
30export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
31
32if [ "$MTU" == "" ]; then
33 export MTU="1450"
34fi
35unset http_proxy https_proxy
36
37HOST_IP_ADDR=localhost
38
39###################### setup so ##############################
40source $SO_DOCKER_PATH/so_setup.sh
41
42###################### setup sdnc ############################
43source $SDNC_DOCKER_PATH/sdn_setup.sh
44
45###################### setup cds #############################
46source $CDS_DOCKER_PATH/cds_setup.sh
47
48###################### setup pnfsim ##########################
49docker-compose -f $PNF_SIM_DOCKER_PATH/docker-compose.yml -p $PROJECT_NAME up -d
50
51##### update pnf simulator ip in config deploy request #######
52RES_KEY=$(uuidgen -r)
53sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/mount.json
54
55##############################################################
56
57echo "sleeping for 30 sec"
58sleep 30
59
60REPO_IP='127.0.0.1'
61ROBOT_VARIABLES+=" -v REPO_IP:${REPO_IP} "
62ROBOT_VARIABLES+=" -v SCRIPTS:${SCRIPTS} "
63
64
65echo "Finished executing setup for pnf-sw-upgrade"