aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
diff options
context:
space:
mode:
authorBjornMagnussonXA <bjorn.magnusson@est.tech>2019-03-26 12:48:27 +0000
committerBjornMagnussonXA <bjorn.magnusson@est.tech>2019-03-26 12:48:27 +0000
commit08294064157fc8a13692c5caa132d9cc68b27aba (patch)
tree60cd68baeb488a484d9680d894a1fe15d7888f34 /test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
parentc25ab4f11ff8944142229ba92d514f2ae58ec966 (diff)
Adapted the simulators for running in CSIT
Adaptation to configure, start and stop all simulators Issue-ID: DCAEGEN2-1313 Change-Id: I653a86443b16e769506311086ea46c5d9dab6248 Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Diffstat (limited to 'test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh')
-rwxr-xr-xtest/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
new file mode 100755
index 000000000..ef1b90a38
--- /dev/null
+++ b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+
+# Starts all simulators with the test settings
+# Intended for CSIT test. For manual start, use the docker-compose-setup.sh
+
+docker-compose -f docker-compose-template.yml config > docker-compose.yml
+
+docker-compose up -d
+
+DR_SIM="$(docker ps -q --filter='name=dfc_dr-sim')"
+DR_RD_SIM="$(docker ps -q --filter='name=dfc_dr-redir-sim')"
+MR_SIM="$(docker ps -q --filter='name=dfc_mr-sim')"
+SFTP_SIM="$(docker ps -q --filter='name=dfc_sftp-server')"
+FTPS_SIM="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd')"
+
+#Wait for initialization of docker containers for all simulators
+for i in {1..10}; do
+if [ $(docker inspect --format '{{ .State.Running }}' $DR_SIM) ] && \
+[ $(docker inspect --format '{{ .State.Running }}' $DR_RD_SIM) ] && \
+[ $(docker inspect --format '{{ .State.Running }}' $MR_SIM) ] && \
+[ $(docker inspect --format '{{ .State.Running }}' $SFTP_SIM) ] && \
+[ $(docker inspect --format '{{ .State.Running }}' $FTPS_SIM) ]
+ then
+ echo "All simulators Running"
+ break
+ else
+ echo sleep $i
+ sleep $i
+ fi
+done
+
+#Populate the ftp server with files
+if [ -z "$NUM_FTPFILES" ]
+ then
+ NUM_FTPFILES=200
+fi
+
+
+docker cp setup-ftp-files-for-image.sh $SFTP_SIM:/tmp/
+docker exec -w /home/onap/ $SFTP_SIM /tmp/setup-ftp-files-for-image.sh $NUM_FTPFILES >/dev/null 2>&1
+
+docker cp setup-ftp-files-for-image.sh $FTPS_SIM:/tmp/setup-ftp-files-for-image.sh
+docker exec -w /srv $FTPS_SIM /tmp/setup-ftp-files-for-image.sh $NUM_FTPFILES >/dev/null 2>&1
+