e494028096a87538ee583f59dac6a3576a94f141
[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
7 # Clone Simulators for DFC from integration repo. 
8 mkdir -p $WORKSPACE/archives/dfc
9 cd $WORKSPACE/archives/dfc
10 git clone --depth 1 https://gerrit.onap.org/r/integration -b master   #How to make this version controlled for Dublin, El Alto etc etc
11
12 #Location of all individual simulators for DFC
13 SIM_ROOT=$WORKSPACE/archives/dfc/integration/test/mocks/datafilecollector-testharness
14 #Location of the above simulators when run as a group. For start+config and stop.
15 SIMGROUP_ROOT=$SIM_ROOT/simulator-group
16
17 #Default IP for all containers
18 SIM_IP="127.0.0.1"
19 #Location of script to start and stop dfc
20 DFC_ROOT=$WORKSPACE/scripts/dcaegen2-collectors-datafile/dfc-management
21
22 #Make the env vars availble to the robot scripts
23 ROBOT_VARIABLES="-v SIMGROUP_ROOT:${SIMGROUP_ROOT} -v SIM_IP:${SIM_IP} -v DFC_ROOT:${DFC_ROOT}"
24
25 #Build needed simulator images. DR and MR simulators
26
27 cd $SIM_ROOT/mr-sim
28
29 docker build -t mrsim:latest .
30
31 cd $SIM_ROOT/dr-sim
32
33 docker build -t drsim_common:latest .
34
35 #Prepare the ftp simulator files.
36
37 cd $SIMGROUP_ROOT
38
39 #Copy ftp config for the ftp servers
40 cp -r ../ftps-sftp-server/configuration .
41 cp -r ../ftps-sftp-server/tls .
42
43 #All containers will be started and stopped via the robot tests.
44