aboutsummaryrefslogtreecommitdiffstats
path: root/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh
blob: 2d276e513a0e4e4d3f3c3251cca0ff802f134386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash

#Stop all running containers
docker kill "$(docker ps -q -a)"
docker rm "$(docker ps -q -a)"
docker system prune -f

# Clone Simulators for DFC from integration repo.
mkdir -p $WORKSPACE/archives/dfc
cd $WORKSPACE/archives/dfc


if [ -z "$SIM_ROOT" ]
then
	#git clone --depth 1 https://gerrit.onap.org/r/integration -b master
	git clone https://github.com/yanhuanwang/integration.git
	#Location of all individual simulators for DFC
	echo "Determine SIM_ROOT based on the WORKSPACE"
	SIM_ROOT=$WORKSPACE/archives/dfc/integration/test/mocks/datafilecollector-testharness

	rm $SIM_ROOT/simulator-group/consul/consul/cbs_localhost_config.hcl || true
else
	echo "Using SIM_ROOT from environmental variable: " $SIM_ROOT
fi

#Location of the above simulators when run as a group. For start+config and stop.
SIMGROUP_ROOT=$SIM_ROOT/simulator-group

#Default IP for all containers
SIM_IP="127.0.0.1"
#Location of script to start and stop dfc
DFC_ROOT=$WORKSPACE/scripts/dcaegen2-collectors-datafile/dfc-management

#Make the env vars availble to the robot scripts
ROBOT_VARIABLES="-b debug.log -v SIMGROUP_ROOT:${SIMGROUP_ROOT} -v SIM_IP:${SIM_IP} -v DFC_ROOT:${DFC_ROOT}"





#Build needed simulator images. DR and MR simulators

cd $SIM_ROOT/mr-sim

docker build -t mrsim:latest .

cd $SIM_ROOT/dr-sim

docker build -t drsim_common:latest .

#Prepare the ftp simulator files.

cd $SIMGROUP_ROOT

#Copy ftp config for the ftp servers
cp -r ../ftps-sftp-server/configuration .
cp -r ../ftps-sftp-server/tls .

cd ../ftps-sftp-server
docker build -t ftps_vsftpd:latest -f Dockerfile-ftps .


#All containers will be started and stopped via the robot tests.