Update DFC tests to use file based conifg
[integration/csit.git] / plans / dcaegen2-collectors-datafile / Functional-suite / setup.sh
1 #!/bin/bash
2
3 #Stop all running containers
4 docker kill "$(docker ps -q -a)"
5 docker rm "$(docker ps -q -a)"
6 docker system prune -f
7
8 # Clone Simulators for DFC from integration repo.
9 mkdir -p $WORKSPACE/archives/dfc
10 cd $WORKSPACE/archives/dfc
11
12
13 if [ -z "$SIM_ROOT" ]
14 then
15         git clone --depth 1 https://gerrit.onap.org/r/integration -b master
16         #Location of all individual simulators for DFC
17         echo "Determine SIM_ROOT based on the WORKSPACE"
18         SIM_ROOT=$WORKSPACE/archives/dfc/integration/test/mocks/datafilecollector-testharness
19
20         rm $SIM_ROOT/simulator-group/consul/consul/cbs_localhost_config.hcl || true
21 else
22         echo "Using SIM_ROOT from environmental variable: " $SIM_ROOT
23 fi
24
25 #Prepare DFC config volume
26 mkdir $SIM_ROOT/simulator-group/dfc_config_volume || true
27
28 #Location of the above simulators when run as a group. For start+config and stop.
29 SIMGROUP_ROOT=$SIM_ROOT/simulator-group
30
31 #Default IP for all containers
32 SIM_IP="127.0.0.1"
33 #Location of script to start and stop dfc
34 DFC_ROOT=$WORKSPACE/scripts/dcaegen2-collectors-datafile/dfc-management
35
36 #Make the env vars availble to the robot scripts
37 ROBOT_VARIABLES="-b debug.log -v SIMGROUP_ROOT:${SIMGROUP_ROOT} -v SIM_IP:${SIM_IP} -v DFC_ROOT:${DFC_ROOT}"
38
39
40
41
42
43 #Build needed simulator images. DR and MR simulators
44
45 cd $SIM_ROOT/mr-sim
46
47 docker build -t mrsim:latest .
48
49 cd $SIM_ROOT/dr-sim
50
51 docker build -t drsim_common:latest .
52
53 #Prepare the ftp simulator files.
54
55 cd $SIMGROUP_ROOT
56
57 #Copy ftp config for the ftp servers
58 cp -r ../ftpes-sftp-server/configuration .
59 cp -r ../ftpes-sftp-server/tls .
60
61 cd ../ftpes-sftp-server
62 docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes .
63
64 #All containers will be started and stopped via the robot tests.
65