diff options
author | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2020-07-27 13:42:09 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-07-29 09:00:45 +0000 |
commit | 7b4d5778c13818b871a5fe5aaf249480981ac15d (patch) | |
tree | 528f085633262f6b8333da40aaaa2864f74f8acd /test/mocks/datafilecollector-testharness | |
parent | 30e199a70b32a6256c2a148eec870800ef1fbefc (diff) |
Adjust DFC test files to use FTPES instead of FTPS
DFC doesn't support FTPS protocol. FTPS is treated exactly like
FTPES and soon DFC won't accept file locations starting with
"ftps://".
Fix mr-sim.py lint issues
Issue-ID: DCAEGEN2-2367
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: Idab56aab3bdb6734a04bfc9c9212f2ea800d0d74
Diffstat (limited to 'test/mocks/datafilecollector-testharness')
33 files changed, 822 insertions, 790 deletions
diff --git a/test/mocks/datafilecollector-testharness/auto-test/25h_backlog_1MB_FTPS.sh b/test/mocks/datafilecollector-testharness/auto-test/25h_backlog_1MB_FTPS.sh index dd1daea54..01b65ce71 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/25h_backlog_1MB_FTPS.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/25h_backlog_1MB_FTPS.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="Simulating a 25h backlog of events for 700 PNF with decreasing number of missing files, then continues with 15 min events from all PNFs using FTPS." +TC_ONELINE_DESCR="Simulating a 25h backlog of events for 700 PNF with decreasing number of missing files, then continues with 15 min events from all PNFs using FTPES." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="300" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -61,4 +61,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh index 18db3b288..3ecfc7729 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="3500 1MB files from 700 PNFs in 3500 events in 5 polls using FTPS, from poll to publish." +TC_ONELINE_DESCR="3500 1MB files from 700 PNFs in 3500 events in 5 polls using FTPES, from poll to publish." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="5" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh index 93e348e12..79c1003d3 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="3500 1KB files from 700 PNFs in 3500 events in 5 polls using FTPS, from poll to publish." +TC_ONELINE_DESCR="3500 1KB files from 700 PNFs in 3500 events in 5 polls using FTPES, from poll to publish." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="5" export NUM_PNFS="700" export FILE_SIZE="1KB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC15.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC15.sh index 44238c31d..96c4844db 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC15.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC15.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="3500 50MB files from 700 PNFs in 3500 events in 5 polls using FTPS, from poll to publish." +TC_ONELINE_DESCR="3500 50MB files from 700 PNFs in 3500 events in 5 polls using FTPES, from poll to publish." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="5" export NUM_PNFS="700" export FILE_SIZE="50MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh index df9b57d3f..b136eece9 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="72800 1MB files from 700 PNFs in 3500 events in 100 polls (35 PNFs each 100 files per poll) using FTPS, from poll to publish." +TC_ONELINE_DESCR="72800 1MB files from 700 PNFs in 3500 events in 100 polls (35 PNFs each 100 files per poll) using FTPES, from poll to publish." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="105" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh index 338a20da0..0ad2a1252 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="DFC file retention (files with SFTP and then same files over FTPS). 1MB, 5MB and 50MB using first SFTP and thenSFTP with restart of MR between each file." +TC_ONELINE_DESCR="DFC file retention (files with SFTP and then same files over FTPES). 1MB, 5MB and 50MB using first SFTP and thenSFTP with restart of MR between each file." . ../common/testcase_common.sh $1 $2 @@ -116,4 +116,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh index 93dd69c0c..be614f2b9 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="One 1MB file from one PNF in one event using FTPS, from poll to publish" +TC_ONELINE_DESCR="One 1MB file from one PNF in one event using FTPES, from poll to publish" . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="1:A" export NUM_FTPFILES="10" export NUM_PNFS="1" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=1 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh index 3de577eee..489cd1ee8 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="One 5MB file from one PNF in one event using FTPS, from poll to publish" +TC_ONELINE_DESCR="One 5MB file from one PNF in one event using FTPES, from poll to publish" . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="1:A" export NUM_FTPFILES="10" export NUM_PNFS="1" export FILE_SIZE="5MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=1 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh index fd3977348..4349cb4fa 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="One 50MB file from one PNF in one event using FTPS, from poll to publish" +TC_ONELINE_DESCR="One 50MB file from one PNF in one event using FTPES, from poll to publish" . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="1:A" export NUM_FTPFILES="10" export NUM_PNFS="1" export FILE_SIZE="50MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=1 @@ -75,4 +75,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh index f16c442f2..c4458a8a7 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="Kill FTPS sever for 10+ sec during download" +TC_ONELINE_DESCR="Kill FTPES sever for 10+ sec during download" . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="2" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=1 @@ -42,9 +42,9 @@ start_dfc 0 dr_greater ctr_published_files 100 200 -stop_ftps 0 +stop_ftpes 0 sleep_wait 30 -start_ftps 0 +start_ftpes 0 dr_equal ctr_published_files 1400 400 @@ -81,4 +81,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh index 08d4d9ea2..ad2073b06 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="Maximum number of 1MB FTPS files during 24h, 700 PNFs. 100 new files per event." +TC_ONELINE_DESCR="Maximum number of 1MB FTPES files during 24h, 700 PNFs. 100 new files per event." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="4000" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -102,4 +102,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh index 6e3368518..431985320 100755 --- a/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh +++ b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh @@ -1,6 +1,6 @@ #!/bin/bash -TC_ONELINE_DESCR="Stabilty over 72hours, 700 PNFs over FTPS. All new files (100) in first event from PNF, then one new 1 new file per event." +TC_ONELINE_DESCR="Stabilty over 72hours, 700 PNFs over FTPES. All new files (100) in first event from PNF, then one new 1 new file per event." . ../common/testcase_common.sh $1 $2 @@ -21,7 +21,7 @@ export DR_REDIR_FEEDS="2:A" export NUM_FTPFILES="1000" export NUM_PNFS="700" export FILE_SIZE="1MB" -export FTP_TYPE="FTPS" +export FTP_TYPE="FTPES" export FTP_FILE_PREFIXES="A" export NUM_FTP_SERVERS=5 @@ -106,4 +106,4 @@ check_dfc_logs store_logs END -print_result
\ No newline at end of file +print_result diff --git a/test/mocks/datafilecollector-testharness/common/README.md b/test/mocks/datafilecollector-testharness/common/README.md index 31f40ef10..f0e3eec79 100644 --- a/test/mocks/datafilecollector-testharness/common/README.md +++ b/test/mocks/datafilecollector-testharness/common/README.md @@ -52,14 +52,14 @@ Stop a SFTP container with the supplied instance id (0-5). **start_sftp <sftp-instance-id>**</br> Start a previously stopped SFTP container with the supplied instance id (0-5). -**kill_ftps <ftps-instance-id>**</br> -Stop and remove a FTPS container with the supplied instance id (0-5). +**kill_ftpes <ftpes-instance-id>**</br> +Stop and remove a FTPES container with the supplied instance id (0-5). -**stop_ftps <ftps-instance-id>**</br> -Stop a FTPS container with the supplied instance id (0-5). +**stop_ftpes <ftpes-instance-id>**</br> +Stop a FTPES container with the supplied instance id (0-5). -**start_ftps <ftps-instance-id>**</br> -Start a previously stopped FTPS container with the supplied instance id (0-5). +**start_ftpes <ftpes-instance-id>**</br> +Start a previously stopped FTPES container with the supplied instance id (0-5). **mr_print <vaiable-name>**</br> Print a variable value from the MR simulator. diff --git a/test/mocks/datafilecollector-testharness/common/test_env.sh b/test/mocks/datafilecollector-testharness/common/test_env.sh index 1a97ffc73..63c0f2ecf 100644 --- a/test/mocks/datafilecollector-testharness/common/test_env.sh +++ b/test/mocks/datafilecollector-testharness/common/test_env.sh @@ -34,24 +34,24 @@ DFC_APP_BASE="dfc_app" #Base name of the dfc containers. Instanc DFC_MAX_NUM=5 #Max number of dfc containers to run in paralell in auto test DFC_MAX_IDX=$(($DFC_MAX_NUM - 1)) #Max index of the dfc containers SFTP_BASE="dfc_sftp-server" #Base name of the dfc_sftp-server containers. Instance 0 will be named dfc_sftp-server0, instance 1 will named dfc_sftp-server1 etc -FTPS_BASE="dfc_ftpes-server-vsftpd" #Base name of the dfc_ftpes-server-vsftpd containers. Instance 0 will be named dfc_ftpes-server-vsftpd0, instance 1 will named dfc_ftpes-server-vsftpd1 etc -FTP_MAX_NUM=5 #Max number of sftp and ftps containers to run in paralell in auto test -FTP_MAX_IDX=$(($FTP_MAX_NUM - 1)) #Max index of sftp and ftps containers +FTPES_BASE="dfc_ftpes-server-vsftpd" #Base name of the dfc_ftpes-server-vsftpd containers. Instance 0 will be named dfc_ftpes-server-vsftpd0, instance 1 will named dfc_ftpes-server-vsftpd1 etc +FTP_MAX_NUM=5 #Max number of sftp and ftpes containers to run in paralell in auto test +FTP_MAX_IDX=$(($FTP_MAX_NUM - 1)) #Max index of sftp and ftpes containers #List of sftp server name and port number, used by MR sim to produce file urls. Theses server names and ports are used when running dfc and the simulators in a private docker network SFTP_SIMS_CONTAINER="sftp-server0:22,sftp-server1:22,sftp-server2:22,sftp-server3:22,sftp-server4:22" #List of sftp server name and port number, used by MR sim to produce file urls. Theses server names and ports are used when running dfc and the simulators in a private docker network -FTPS_SIMS_CONTAINER="ftpes-server-vsftpd0:21,ftpes-server-vsftpd1:21,ftpes-server-vsftpd2:21,ftpes-server-vsftpd3:21,ftpes-server-vsftpd4:21" +FTPES_SIMS_CONTAINER="ftpes-server-vsftpd0:21,ftpes-server-vsftpd1:21,ftpes-server-vsftpd2:21,ftpes-server-vsftpd3:21,ftpes-server-vsftpd4:21" #List of sftp server name and port number, used by MR sim to produce file urls. Theses server names and ports are used when running dfc as stand along app and the simulators in a private docker network SFTP_SIMS_LOCALHOST="localhost:1022,localhost:1023,localhost:1024,localhost:1025,localhost:1026" -#List of ftps server name and port number, used by MR sim to produce file urls. Theses server names and ports are used when running dfc as stand along app and the simulators in a private docker network -FTPS_SIMS_LOCALHOST="localhost:1032,localhost:1033,localhost:1034,localhost:1035,localhost:1036" +#List of ftpes server name and port number, used by MR sim to produce file urls. Theses server names and ports are used when running dfc as stand along app and the simulators in a private docker network +FTPES_SIMS_LOCALHOST="localhost:1032,localhost:1033,localhost:1034,localhost:1035,localhost:1036" export SFTP_SIMS=$SFTP_SIMS_CONTAINER #This env will be set to SFTP_SIMS_LOCALHOST if auto test is executed with 'manual-app' -export FTPS_SIMS=$FTPS_SIMS_CONTAINER #This env will be set to FTPS_SIMS_LOCALHOST if auto test is executed with 'manual-app' +export FTPES_SIMS=$FTPES_SIMS_CONTAINER #This env will be set to FTPES_SIMS_LOCALHOST if auto test is executed with 'manual-app' #Host name of the DR redirect simulator export DR_REDIR_SIM="drsim_redir" #This env will be set to 'localhost' if auto test is executed with arg 'manual-app' diff --git a/test/mocks/datafilecollector-testharness/common/testcase_common.sh b/test/mocks/datafilecollector-testharness/common/testcase_common.sh index a1e092157..d2072c141 100755 --- a/test/mocks/datafilecollector-testharness/common/testcase_common.sh +++ b/test/mocks/datafilecollector-testharness/common/testcase_common.sh @@ -151,15 +151,15 @@ fi echo "" -echo "Building images for the simulators if needed, MR, DR, DR Redir and FTPS simulators" +echo "Building images for the simulators if needed, MR, DR, DR Redir and FTPES simulators" curdir=$PWD cd $SIM_GROUP cd ../dr-sim docker build -t drsim_common:latest . &> /dev/null cd ../mr-sim docker build -t mrsim:latest . &> /dev/null -cd ../ftps-sftp-server -docker build -t ftps_vsftpd:latest -f Dockerfile-ftps . &> /dev/null +cd ../ftpes-sftp-server +docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes . &> /dev/null cd $curdir echo "" @@ -169,7 +169,7 @@ echo "MR simulator " $(docker images | grep mrsim) echo "DR simulator: " $(docker images | grep drsim_common) echo "DR redir simulator: " $(docker images | grep drsim_common) echo "SFTP: " $(docker images | grep atmoz/sftp) -echo "FTPS: " $(docker images | grep ftps_vsftpd) +echo "FTPES: " $(docker images | grep ftpes_vsftpd) echo "Consul: " $(docker images | grep consul) echo "CBS: " $(docker images | grep platform.configbinding.app) echo "" @@ -178,12 +178,12 @@ echo "" #Configure DR sim with correct address for DR redirect simulator if [ $START_ARG == "manual-app" ]; then export SFTP_SIMS=$SFTP_SIMS_LOCALHOST - export FTPS_SIMS=$FTPS_SIMS_LOCALHOST + export FTPES_SIMS=$FTPES_SIMS_LOCALHOST export DR_REDIR_SIM="localhost" fi #else # export SFTP_SIMS=$SFTP_SIMS_CONTAINER -# export FTPS_SIMS=$FTPS_SIMS_CONTAINER +# export FTPES_SIMS=$FTPES_SIMS_CONTAINER # export DR_REDIR_SIM="drsim_redir" #fi @@ -507,7 +507,7 @@ log_sim_settings() { echo "FTP_FILE_PREFIXES= "$FTP_FILE_PREFIXES echo "NUM_FTP_SERVERS= "$NUM_FTP_SERVERS echo "SFTP_SIMS= "$SFTP_SIMS - echo "FTPS_SIMS= "$FTPS_SIMS + echo "FTPES_SIMS= "$FTPES_SIMS echo "" } @@ -699,11 +699,11 @@ start_sftp() { __docker_start $appname } -# Stop and remove the FTPS container, arg: <ftps-instance-id> -kill_ftps() { +# Stop and remove the FTPES container, arg: <ftpes-instance-id> +kill_ftpes() { if [ $# != 1 ]; then - __print_err "need one arg, <ftpS-instance-id>" + __print_err "need one arg, <ftpes-instance-id>" exit 1 fi @@ -711,19 +711,19 @@ kill_ftps() { __print_err "arg should be 0.."$FTP_MAX_IDX exit 1 fi - appname=$FTPS_BASE$1 + appname=$FTPES_BASE$1 - echo "Killing FTPS, instance id: "$1 + echo "Killing FTPES, instance id: "$1 __docker_stop $appname __docker_rm $appname } -# Stop FTPS container, arg: <ftps-instance-id> -stop_ftps() { +# Stop FTPES container, arg: <ftpes-instance-id> +stop_ftpes() { if [ $# != 1 ]; then - __print_err "need one arg, <ftps-instance-id>" + __print_err "need one arg, <ftpes-instance-id>" exit 1 fi @@ -731,18 +731,18 @@ stop_ftps() { __print_err "arg should be 0.."$FTP_MAX_IDX exit 1 fi - appname=$FTPS_BASE$1 + appname=$FTPES_BASE$1 - echo "Stopping FTPS, instance id: "$1 + echo "Stopping FTPES, instance id: "$1 __docker_stop $appname } -# Starts a stopped FTPS container, arg: <ftps-instance-id> -start_ftps() { +# Starts a stopped FTPES container, arg: <ftpes-instance-id> +start_ftpes() { if [ $# != 1 ]; then - __print_err "need one arg, <ftps-instance-id>" + __print_err "need one arg, <ftpes-instance-id>" exit 1 fi @@ -750,9 +750,9 @@ start_ftps() { __print_err "arg should be 0.."$FTP_MAX_IDX exit 1 fi - appname=$FTPS_BASE$1 + appname=$FTPES_BASE$1 - echo "Starting FTPS, instance id: "$1 + echo "Starting FTPES, instance id: "$1 __docker_start $appname } @@ -1128,7 +1128,7 @@ store_logs() { for (( i=0; i<=$FTP_MAX_IDX; i++ )); do appname=$SFTP_BASE$i docker logs $appname > $TESTLOGS/$ATC/${1}_${appname}.log 2>&1 - appname=$FTPS_BASE$i + appname=$FTPES_BASE$i docker logs $appname > $TESTLOGS/$ATC/${1}_${appname}.log 2>&1 done diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/.gitignore b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/.gitignore index bd6c5bed8..bd6c5bed8 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/.gitignore +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/.gitignore diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/Dockerfile-ftpes index a0d6cfafc..a0d6cfafc 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/Dockerfile-ftpes diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/README.md b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/README.md index f20b29698..44d329e76 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/README.md +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/README.md @@ -23,7 +23,7 @@ symbolic links to these files to simulate PM files. The files names maches the f the events produced by the MR simulator. The dirs with the files will be mounted by the ftp containers, defined in the docker-compse file, when started -# Starting/stopping the FTPS/SFTP server(s) +# Starting/stopping the FTPES/SFTP server(s) Start: `docker-compose up` diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/configuration/vsftpd_ssl.conf index 0a24e38a8..0a24e38a8 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/configuration/vsftpd_ssl.conf diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/docker-compose.yml b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/docker-compose.yml index cdee4d56c..5bc91efa1 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/docker-compose.yml +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/docker-compose.yml @@ -30,6 +30,6 @@ services: - ./tls/dfc.crt:/etc/ssl/private/dfc.crt:ro - ./configuration/vsftpd_ssl.conf:/etc/vsftpd_ssl.conf:ro - - ./files/onap/ftps/:/srv/ + - ./files/onap/ftpes/:/srv/ restart: on-failure command: vsftpd /etc/vsftpd_ssl.conf diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/prepare.sh b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/prepare.sh index 086d43a49..086d43a49 100755 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/prepare.sh +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/prepare.sh diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/test_cases.yml b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/test_cases.yml index ce68be40c..e07e3a0c6 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/test_cases.yml +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/test_cases.yml @@ -1,16 +1,16 @@ -# EXAMPLE: TC1 generates (i) 10 files of 1 MB in ftps directory, +# EXAMPLE: TC1 generates (i) 10 files of 1 MB in ftpes directory, # (ii) 30 files of 5 MB in sftp directory, and (iii) 10 files of 10 MB in sftp directory TC1: size_files: 1 5 10 number_files: 10 30 10 - directory_files: ftps sftp sftp + directory_files: ftpes sftp sftp TC2: size_files: 0.5 1 5 number_files: 2 3 1 - directory_files: ftps ftps sftp + directory_files: ftpes ftpes sftp TC_10000: size_files: 1 1 5 5 50 50 number_files: 10000 10000 10000 10000 1 1 - directory_files: ftps sftp ftps sftp ftps sftp + directory_files: ftpes sftp ftpes sftp ftpes sftp diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/README.md b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/README.md index 5edfeddec..5edfeddec 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/README.md +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/README.md diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/dfc.crt b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/dfc.crt index f747f20bb..f747f20bb 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/dfc.crt +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/dfc.crt diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/ftp.crt b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/ftp.crt index f412d013c..f412d013c 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/ftp.crt +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/ftp.crt diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/ftp.key b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/ftp.key index f90c781d3..f90c781d3 100644 --- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/tls/ftp.key +++ b/test/mocks/datafilecollector-testharness/ftpes-sftp-server/tls/ftp.key diff --git a/test/mocks/datafilecollector-testharness/mr-sim/README.md b/test/mocks/datafilecollector-testharness/mr-sim/README.md index 653b47e8f..056136f94 100644 --- a/test/mocks/datafilecollector-testharness/mr-sim/README.md +++ b/test/mocks/datafilecollector-testharness/mr-sim/README.md @@ -30,7 +30,7 @@ The simulator listens to port 2222. The following envrionment vaiables are used: -- **FTPS_SIMS** - A comma-separated list of hostname:port for the FTP servers to generate ftps file urls for. If not set MR sim will assume 'localhost:21'. Minimum 1 and maximum 5 host-port pairs can be given. +- **FTPES_SIMS** - A comma-separated list of hostname:port for the FTP servers to generate ftpes file urls for. If not set MR sim will assume 'localhost:21'. Minimum 1 and maximum 5 host-port pairs can be given. - **SFTP_SIMS** - A comma-separated list of hostname:port for the FTP servers to generate sftp file urls for. If not set MR sim will assume 'localhost:1022'. Minimum 1 and maximum 5 host-port pairs can be given. - **NUM_FTP_SERVERS** - Number of FTP servers to use out of those specified in the envrioment variables above. The number shall be in the range 1-5. - **MR_GROUPS** - A comma-separated list of consummer-group:changeId[:changeId]\*. Defines which change identifier that should be used for each consumer gropu. If not set the MR-sim will assume 'OpenDcae-c12:PM_MEAS_FILES'. @@ -175,15 +175,15 @@ TC1302 - 700 ME, SFTP, 50MB files, 100 files per event, endless number of events TC1500 - 700 ME, SFTP, 1MB files, 100 files per event, 35 events per poll, simulating 25h backlog of decreasing number of outdated files and then 20 event polls every 15min for 1h -Changing the first digit in tc number will change the test case to run FTPS instead. Eg. TC201 is FTPS version of TC101. +Changing the first digit in tc number will change the test case to run FTPES instead. Eg. TC201 is FTPES version of TC101. -TC2XX is same as TC1XX but with FTPS +TC2XX is same as TC1XX but with FTPES -TC6XX is same as TC5XX but with FTPS +TC6XX is same as TC5XX but with FTPES -TC8XX is same as TC7XX but with FTPS +TC8XX is same as TC7XX but with FTPES -TC2XXX is same as TC1XXX but with FTPS +TC2XXX is same as TC1XXX but with FTPES ## Developer workflow diff --git a/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py b/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py index 6345ab69f..f2b781bd9 100644 --- a/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py +++ b/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py @@ -1,229 +1,249 @@ import argparse -import json import os import sys import time from time import sleep -from flask import Flask, render_template, request -from werkzeug import secure_filename +from flask import Flask app = Flask(__name__) -#Server info +# Server info HOST_IP = "0.0.0.0" HOST_PORT = 2222 HOST_PORT_TLS = 2223 -sftp_hosts=[] -sftp_ports=[] -ftps_hosts=[] -ftps_ports=[] -num_ftp_servers=1 +sftp_hosts = [] +sftp_ports = [] +ftpes_hosts = [] +ftpes_ports = [] +num_ftp_servers = 1 + def sumList(ctrArray): - tmp=0 + tmp = 0 for i in range(len(ctrArray)): - tmp=tmp+ctrArray[i]; + tmp = tmp + ctrArray[i] + + return str(tmp) - return str(tmp); def sumListLength(ctrArray): - tmp=0 + tmp = 0 for i in range(len(ctrArray)): - tmp=tmp+len(ctrArray[i]); + tmp = tmp + len(ctrArray[i]) - return str(tmp); + return str(tmp) -#Test function to check server running + +# Test function to check server running @app.route('/', - methods=['GET']) + methods=['GET']) def index(): return 'Hello world' -#Returns the list of configured groups + +# Returns the list of configured groups @app.route('/groups', - methods=['GET']) + methods=['GET']) def group_ids(): global configuredGroups return configuredGroups -#Returns the list of configured changeids + +# Returns the list of configured changeids @app.route('/changeids', - methods=['GET']) + methods=['GET']) def change_ids(): global configuredChangeIds return configuredChangeIds -#Returns the list of configured fileprefixes + +# Returns the list of configured fileprefixes @app.route('/fileprefixes', - methods=['GET']) + methods=['GET']) def fileprefixes(): global configuredPrefixes return configuredPrefixes -#Returns number of polls +# Returns number of polls @app.route('/ctr_requests', - methods=['GET']) + methods=['GET']) def counter_requests(): global ctr_requests return sumList(ctr_requests) -#Returns number of polls for all groups + +# Returns number of polls for all groups @app.route('/groups/ctr_requests', - methods=['GET']) + methods=['GET']) def group_counter_requests(): global ctr_requests global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(ctr_requests[i]) + tmp = tmp + ',' + tmp = tmp + str(ctr_requests[i]) return tmp -#Returns the total number of polls for a group + +# Returns the total number of polls for a group @app.route('/ctr_requests/<groupId>', - methods=['GET']) + methods=['GET']) def counter_requests_group(groupId): global ctr_requests global groupNameIndexes return str(ctr_requests[groupNameIndexes[groupId]]) -#Returns number of poll replies + +# Returns number of poll replies @app.route('/ctr_responses', - methods=['GET']) + methods=['GET']) def counter_responses(): global ctr_responses return sumList(ctr_responses) -#Returns number of poll replies for all groups + +# Returns number of poll replies for all groups @app.route('/groups/ctr_responses', - methods=['GET']) + methods=['GET']) def group_counter_responses(): global ctr_responses global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(ctr_responses[i]) + tmp = tmp + ',' + tmp = tmp + str(ctr_responses[i]) return tmp -#Returns the total number of poll replies for a group + +# Returns the total number of poll replies for a group @app.route('/ctr_responses/<groupId>', - methods=['GET']) + methods=['GET']) def counter_responses_group(groupId): global ctr_responses global groupNameIndexes return str(ctr_responses[groupNameIndexes[groupId]]) -#Returns the total number of files + +# Returns the total number of files @app.route('/ctr_files', - methods=['GET']) + methods=['GET']) def counter_files(): global ctr_files return sumList(ctr_files) -#Returns the total number of file for all groups + +# Returns the total number of file for all groups @app.route('/groups/ctr_files', - methods=['GET']) + methods=['GET']) def group_counter_files(): global ctr_files global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(ctr_files[i]) + tmp = tmp + ',' + tmp = tmp + str(ctr_files[i]) return tmp -#Returns the total number of files for a group + +# Returns the total number of files for a group @app.route('/ctr_files/<groupId>', - methods=['GET']) + methods=['GET']) def counter_files_group(groupId): global ctr_files global groupNameIndexes return str(ctr_files[groupNameIndexes[groupId]]) -#Returns number of unique files +# Returns number of unique files @app.route('/ctr_unique_files', - methods=['GET']) + methods=['GET']) def counter_uniquefiles(): global fileMap return sumListLength(fileMap) -#Returns number of unique files for all groups + +# Returns number of unique files for all groups @app.route('/groups/ctr_unique_files', - methods=['GET']) + methods=['GET']) def group_counter_uniquefiles(): global fileMap global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(len(fileMap[i])) + tmp = tmp + ',' + tmp = tmp + str(len(fileMap[i])) return tmp -#Returns the total number of unique files for a group + +# Returns the total number of unique files for a group @app.route('/ctr_unique_files/<groupId>', - methods=['GET']) + methods=['GET']) def counter_uniquefiles_group(groupId): global fileMap global groupNameIndexes return str(len(fileMap[groupNameIndexes[groupId]])) -#Returns tc info + +# Returns tc info @app.route('/tc_info', - methods=['GET']) + methods=['GET']) def testcase_info(): global tc_num return tc_num -#Returns number of events + +# Returns number of events @app.route('/ctr_events', - methods=['GET']) + methods=['GET']) def counter_events(): global ctr_events return sumList(ctr_events) -#Returns number of events for all groups + +# Returns number of events for all groups @app.route('/groups/ctr_events', - methods=['GET']) + methods=['GET']) def group_counter_events(): global ctr_events global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(ctr_events[i]) + tmp = tmp + ',' + tmp = tmp + str(ctr_events[i]) return tmp -#Returns the total number of events for a group + +# Returns the total number of events for a group @app.route('/ctr_events/<groupId>', - methods=['GET']) + methods=['GET']) def counter_events_group(groupId): global ctr_events global groupNameIndexes return str(ctr_events[groupNameIndexes[groupId]]) -#Returns execution time in mm:ss + +# Returns execution time in mm:ss @app.route('/execution_time', - methods=['GET']) + methods=['GET']) def exe_time(): global startTime stopTime = time.time() - minutes, seconds = divmod(stopTime-startTime, 60) - return "{:0>2}:{:0>2}".format(int(minutes),int(seconds)) + minutes, seconds = divmod(stopTime - startTime, 60) + return "{:0>2}:{:0>2}".format(int(minutes), int(seconds)) -#Returns the timestamp for first poll + +# Returns the timestamp for first poll @app.route('/exe_time_first_poll', - methods=['GET']) + methods=['GET']) def exe_time_first_poll(): global firstPollTime @@ -234,92 +254,100 @@ def exe_time_first_poll(): if (tmp == 0): return "--:--" - minutes, seconds = divmod(time.time()-tmp, 60) - return "{:0>2}:{:0>2}".format(int(minutes),int(seconds)) + minutes, seconds = divmod(time.time() - tmp, 60) + return "{:0>2}:{:0>2}".format(int(minutes), int(seconds)) -#Returns the timestamp for first poll for all groups + +# Returns the timestamp for first poll for all groups @app.route('/groups/exe_time_first_poll', - methods=['GET']) + methods=['GET']) def group_exe_time_first_poll(): global firstPollTime global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' + tmp = tmp + ',' if (firstPollTime[i] == 0): - tmp=tmp+ "--:--" + tmp = tmp + "--:--" else: - minutes, seconds = divmod(time.time()-firstPollTime[i], 60) - tmp=tmp+"{:0>2}:{:0>2}".format(int(minutes),int(seconds)) + minutes, seconds = divmod(time.time() - firstPollTime[i], 60) + tmp = tmp + "{:0>2}:{:0>2}".format(int(minutes), int(seconds)) return tmp -#Returns the timestamp for first poll for a group + +# Returns the timestamp for first poll for a group @app.route('/exe_time_first_poll/<groupId>', - methods=['GET']) + methods=['GET']) def exe_time_first_poll_group(groupId): global ctr_requests global groupNameIndexes if (firstPollTime[groupNameIndexes[groupId]] == 0): return "--:--" - minutes, seconds = divmod(time.time()-firstPollTime[groupNameIndexes[groupId]], 60) - return "{:0>2}:{:0>2}".format(int(minutes),int(seconds)) + minutes, seconds = divmod(time.time() - firstPollTime[groupNameIndexes[groupId]], 60) + return "{:0>2}:{:0>2}".format(int(minutes), int(seconds)) -#Starts event delivery + +# Starts event delivery @app.route('/start', - methods=['GET']) + methods=['GET']) def start(): global runningState - runningState="Started" + runningState = "Started" return runningState -#Stops event delivery + +# Stops event delivery @app.route('/stop', - methods=['GET']) + methods=['GET']) def stop(): global runningState - runningState="Stopped" + runningState = "Stopped" return runningState -#Returns the running state + +# Returns the running state @app.route('/status', - methods=['GET']) + methods=['GET']) def status(): global runningState return runningState -#Returns number of unique PNFs + +# Returns number of unique PNFs @app.route('/ctr_unique_PNFs', - methods=['GET']) + methods=['GET']) def counter_uniquePNFs(): global pnfMap return sumListLength(pnfMap) -#Returns number of unique PNFs for all groups + +# Returns number of unique PNFs for all groups @app.route('/groups/ctr_unique_PNFs', - methods=['GET']) + methods=['GET']) def group_counter_uniquePNFs(): global pnfMap global groupNames - tmp='' + tmp = '' for i in range(len(groupNames)): if (i > 0): - tmp=tmp+',' - tmp=tmp+str(len(pnfMap[i])) + tmp = tmp + ',' + tmp = tmp + str(len(pnfMap[i])) return tmp -#Returns the unique PNFs for a group + +# Returns the unique PNFs for a group @app.route('/ctr_unique_PNFs/<groupId>', - methods=['GET']) + methods=['GET']) def counter_uniquePNFs_group(groupId): global pnfMap global groupNameIndexes return str(len(pnfMap[groupNameIndexes[groupId]])) -#Messages polling function +# Messages polling function @app.route( "/events/unauthenticated.VES_NOTIFICATION_OUTPUT/<consumerGroup>/<consumerId>", methods=['GET']) @@ -332,12 +360,14 @@ def MR_reply(consumerGroup, consumerId): global groupNameIndexes global changeIds global filePrefixes + print("Received request at /events/unauthenticated.VES_NOTIFICATION_OUTPUT/ for consumerGroup: " + consumerGroup + + " with consumerId: " + consumerId) groupIndex = groupNameIndexes[consumerGroup] print("Setting groupIndex: " + str(groupIndex)) reqCtr = ctr_requests[groupIndex] - changeId = changeIds[groupIndex][reqCtr%len(changeIds[groupIndex])] + changeId = changeIds[groupIndex][reqCtr % len(changeIds[groupIndex])] print("Setting changeid: " + changeId) filePrefix = filePrefixes[changeId] print("Setting file name prefix: " + filePrefix) @@ -352,165 +382,164 @@ def MR_reply(consumerGroup, consumerId): ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 return buildOkResponse("[]") - - if args.tc100: - return tc100(groupIndex, changeId, filePrefix, "sftp", "1MB") + return tc100(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc101: - return tc100(groupIndex, changeId, filePrefix, "sftp", "5MB") + return tc100(groupIndex, changeId, filePrefix, "sftp", "5MB") elif args.tc102: - return tc100(groupIndex, changeId, filePrefix, "sftp", "50MB") + return tc100(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc110: - return tc110(groupIndex, changeId, filePrefix, "sftp") + return tc110(groupIndex, changeId, filePrefix, "sftp") elif args.tc111: - return tc111(groupIndex, changeId, filePrefix, "sftp") + return tc111(groupIndex, changeId, filePrefix, "sftp") elif args.tc112: - return tc112(groupIndex, changeId, filePrefix, "sftp") + return tc112(groupIndex, changeId, filePrefix, "sftp") elif args.tc113: - return tc113(groupIndex, changeId, filePrefix, "sftp") + return tc113(groupIndex, changeId, filePrefix, "sftp") elif args.tc120: - return tc120(groupIndex, changeId, filePrefix, "sftp") + return tc120(groupIndex, changeId, filePrefix, "sftp") elif args.tc121: - return tc121(groupIndex, changeId, filePrefix, "sftp") + return tc121(groupIndex, changeId, filePrefix, "sftp") elif args.tc122: - return tc122(groupIndex, changeId, filePrefix, "sftp") + return tc122(groupIndex, changeId, filePrefix, "sftp") elif args.tc1000: - return tc1000(groupIndex, changeId, filePrefix, "sftp") + return tc1000(groupIndex, changeId, filePrefix, "sftp") elif args.tc1001: - return tc1001(groupIndex, changeId, filePrefix, "sftp") + return tc1001(groupIndex, changeId, filePrefix, "sftp") elif args.tc1100: - return tc1100(groupIndex, changeId, filePrefix, "sftp","1MB") + return tc1100(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc1101: - return tc1100(groupIndex, changeId, filePrefix, "sftp","50MB") + return tc1100(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc1102: - return tc1100(groupIndex, changeId, filePrefix, "sftp","50MB") + return tc1100(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc1200: - return tc1200(groupIndex, changeId, filePrefix, "sftp","1MB") + return tc1200(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc1201: - return tc1200(groupIndex, changeId, filePrefix, "sftp","5MB") + return tc1200(groupIndex, changeId, filePrefix, "sftp", "5MB") elif args.tc1202: - return tc1200(groupIndex, changeId, filePrefix, "sftp","50MB") + return tc1200(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc1300: - return tc1300(groupIndex, changeId, filePrefix, "sftp","1MB") + return tc1300(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc1301: - return tc1300(groupIndex, changeId, filePrefix, "sftp","5MB") + return tc1300(groupIndex, changeId, filePrefix, "sftp", "5MB") elif args.tc1302: - return tc1300(groupIndex, changeId, filePrefix, "sftp","50MB") + return tc1300(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc1500: - return tc1500(groupIndex, changeId, filePrefix, "sftp","1MB") + return tc1500(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc500: - return tc500(groupIndex, changeId, filePrefix, "sftp","1MB") + return tc500(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc501: - return tc500(groupIndex, changeId, filePrefix, "sftp","5MB") + return tc500(groupIndex, changeId, filePrefix, "sftp", "5MB") elif args.tc502: - return tc500(groupIndex, changeId, filePrefix, "sftp","50MB") + return tc500(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc510: - return tc510(groupIndex, changeId, filePrefix, "sftp", "1MB") + return tc510(groupIndex, changeId, filePrefix, "sftp", "1MB") elif args.tc511: - return tc511(groupIndex, changeId, filePrefix, "sftp", "1KB") + return tc511(groupIndex, changeId, filePrefix, "sftp", "1KB") elif args.tc550: - return tc510(groupIndex, changeId, filePrefix, "sftp", "50MB") + return tc510(groupIndex, changeId, filePrefix, "sftp", "50MB") elif args.tc710: - return tc710(groupIndex, changeId, filePrefix, "sftp") + return tc710(groupIndex, changeId, filePrefix, "sftp") elif args.tc200: - return tc100(groupIndex, changeId, filePrefix, "ftps", "1MB") + return tc100(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc201: - return tc100(groupIndex, changeId, filePrefix, "ftps", "5MB") + return tc100(groupIndex, changeId, filePrefix, "ftpes", "5MB") elif args.tc202: - return tc100(groupIndex, changeId, filePrefix, "ftps", "50MB") + return tc100(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc210: - return tc110(groupIndex, changeId, filePrefix, "ftps") + return tc110(groupIndex, changeId, filePrefix, "ftpes") elif args.tc211: - return tc111(groupIndex, changeId, filePrefix, "ftps") + return tc111(groupIndex, changeId, filePrefix, "ftpes") elif args.tc212: - return tc112(groupIndex, changeId, filePrefix, "ftps") + return tc112(groupIndex, changeId, filePrefix, "ftpes") elif args.tc213: - return tc113(groupIndex, changeId, filePrefix, "ftps") + return tc113(groupIndex, changeId, filePrefix, "ftpes") elif args.tc220: - return tc120(groupIndex, changeId, filePrefix, "ftps") + return tc120(groupIndex, changeId, filePrefix, "ftpes") elif args.tc221: - return tc121(groupIndex, changeId, filePrefix, "ftps") + return tc121(groupIndex, changeId, filePrefix, "ftpes") elif args.tc222: - return tc122(groupIndex, changeId, filePrefix, "ftps") + return tc122(groupIndex, changeId, filePrefix, "ftpes") elif args.tc2000: - return tc1000(groupIndex, changeId, filePrefix, "ftps") + return tc1000(groupIndex, changeId, filePrefix, "ftpes") elif args.tc2001: - return tc1001(groupIndex, changeId, filePrefix, "ftps") + return tc1001(groupIndex, changeId, filePrefix, "ftpes") elif args.tc2100: - return tc1100(groupIndex, changeId, filePrefix, "ftps","1MB") + return tc1100(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc2101: - return tc1100(groupIndex, changeId, filePrefix, "ftps","50MB") + return tc1100(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc2102: - return tc1100(groupIndex, changeId, filePrefix, "ftps","50MB") + return tc1100(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc2200: - return tc1200(groupIndex, changeId, filePrefix, "ftps","1MB") + return tc1200(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc2201: - return tc1200(groupIndex, changeId, filePrefix, "ftps","5MB") + return tc1200(groupIndex, changeId, filePrefix, "ftpes", "5MB") elif args.tc2202: - return tc1200(groupIndex, changeId, filePrefix, "ftps","50MB") + return tc1200(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc2300: - return tc1300(groupIndex, changeId, filePrefix, "ftps","1MB") + return tc1300(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc2301: - return tc1300(groupIndex, changeId, filePrefix, "ftps","5MB") + return tc1300(groupIndex, changeId, filePrefix, "ftpes", "5MB") elif args.tc2302: - return tc1300(groupIndex, changeId, filePrefix, "ftps","50MB") + return tc1300(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc2500: - return tc1500(groupIndex, changeId, filePrefix, "ftps","1MB") + return tc1500(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc600: - return tc500(groupIndex, changeId, filePrefix, "ftps","1MB") + return tc500(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc601: - return tc500(groupIndex, changeId, filePrefix, "ftps","5MB") + return tc500(groupIndex, changeId, filePrefix, "ftpes", "5MB") elif args.tc602: - return tc500(groupIndex, changeId, filePrefix, "ftps","50MB") + return tc500(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc610: - return tc510(groupIndex, changeId, filePrefix, "ftps", "1MB") + return tc510(groupIndex, changeId, filePrefix, "ftpes", "1MB") elif args.tc611: - return tc511(groupIndex, changeId, filePrefix, "ftps", "1KB") + return tc511(groupIndex, changeId, filePrefix, "ftpes", "1KB") elif args.tc650: - return tc510(groupIndex, changeId, filePrefix, "ftps", "50MB") + return tc510(groupIndex, changeId, filePrefix, "ftpes", "50MB") elif args.tc810: - return tc710(groupIndex, changeId, filePrefix, "ftps") + return tc710(groupIndex, changeId, filePrefix, "ftpes") #### Test case functions def tc100(groupIndex, changeId, filePrefix, ftpType, fileSize): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 1): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 1): - return buildOkResponse("[]") + seqNr = (ctr_responses[groupIndex] - 1) + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) + msg = getEventHead(groupIndex, changeId, nodeName) + getEventName(fileName, ftpType, "onap", "pano", + nodeIndex) + getEventEnd() + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 + return buildOkResponse("[" + msg + "]") - seqNr = (ctr_responses[groupIndex]-1) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) - msg = getEventHead(groupIndex, changeId, nodeName) + getEventName(fileName,ftpType,"onap","pano",nodeIndex) + getEventEnd() - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr - ctr_events[groupIndex] = ctr_events[groupIndex]+1 - return buildOkResponse("["+msg+"]") -#def tc101(groupIndex, ftpType): +# def tc101(groupIndex, ftpType): # global ctr_responses # global ctr_events # @@ -527,7 +556,7 @@ def tc100(groupIndex, changeId, filePrefix, ftpType, fileSize): # ctr_events[groupIndex] = ctr_events[groupIndex]+1 # return buildOkResponse("["+msg+"]") # -#def tc102(groupIndex, ftpType): +# def tc102(groupIndex, ftpType): # global ctr_responses # global ctr_events # @@ -545,582 +574,579 @@ def tc100(groupIndex, changeId, filePrefix, ftpType, fileSize): # return buildOkResponse("["+msg+"]") def tc110(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + seqNr = (ctr_responses[groupIndex] - 1) + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = getEventHead(groupIndex, changeId, nodeName) + getEventName(fileName, ftpType, "onap", "pano", + nodeIndex) + getEventEnd() + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 + return buildOkResponse("[" + msg + "]") - seqNr = (ctr_responses[groupIndex]-1) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = getEventHead(groupIndex, changeId, nodeName) + getEventName(fileName,ftpType,"onap","pano",nodeIndex) + getEventEnd() - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr - ctr_events[groupIndex] = ctr_events[groupIndex]+1 - return buildOkResponse("["+msg+"]") def tc111(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc112(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "5MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "5MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc113(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - if (ctr_responses[groupIndex] > 1): - return buildOkResponse("[]") + if (ctr_responses[groupIndex] > 1): + return buildOkResponse("[]") - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = "" + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = "" - for evts in range(100): # build 100 evts - if (evts > 0): - msg = msg + "," - msg = msg + getEventHead(groupIndex, changeId, nodeName) - for i in range(100): # build 100 files - seqNr = i+evts+100*(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + for evts in range(100): # build 100 evts + if (evts > 0): + msg = msg + "," + msg = msg + getEventHead(groupIndex, changeId, nodeName) + for i in range(100): # build 100 files + seqNr = i + evts + 100 * (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - return buildOkResponse("["+msg+"]") + return buildOkResponse("[" + msg + "]") def tc120(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - nodeIndex=0 - nodeName = createNodeName(nodeIndex) + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] % 10 == 2): - return # Return nothing + if (ctr_responses[groupIndex] % 10 == 2): + return # Return nothing - if (ctr_responses[groupIndex] % 10 == 3): - return buildOkResponse("") # Return empty message + if (ctr_responses[groupIndex] % 10 == 3): + return buildOkResponse("") # Return empty message - if (ctr_responses[groupIndex] % 10 == 4): - return buildOkResponse(getEventHead(groupIndex, changeId, nodeName)) # Return part of a json event + if (ctr_responses[groupIndex] % 10 == 4): + return buildOkResponse(getEventHead(groupIndex, changeId, nodeName)) # Return part of a json event - if (ctr_responses[groupIndex] % 10 == 5): - return buildEmptyResponse(404) # Return empty message with status code + if (ctr_responses[groupIndex] % 10 == 5): + return buildEmptyResponse(404) # Return empty message with status code - if (ctr_responses[groupIndex] % 10 == 6): - sleep(60) + if (ctr_responses[groupIndex] % 10 == 6): + sleep(60) + msg = getEventHead(groupIndex, changeId, nodeName) - msg = getEventHead(groupIndex, changeId, nodeName) + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc121(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + fileName = "" + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if (seqNr % 10 == 0): # Every 10th file is "missing" + fileName = createMissingFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + else: + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - fileName = "" - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if (seqNr%10 == 0): # Every 10th file is "missing" - fileName = createMissingFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - else: - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + if i != 0: msg = msg + "," + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) - if i != 0: msg = msg + "," - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc122(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - for i in range(100): - fileName = createFileName(groupIndex, filePrefix, nodeName, 0, "1MB") # All files identical names - if i != 0: msg = msg + "," - msg = msg + getEventName(fileName,ftpType,"onap","pano", nodeIndex) + for i in range(100): + fileName = createFileName(groupIndex, filePrefix, nodeName, 0, "1MB") # All files identical names + if i != 0: msg = msg + "," + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) - fileMap[groupIndex][0] = 0 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + fileMap[groupIndex][0] = 0 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - return buildOkResponse("["+msg+"]") + return buildOkResponse("[" + msg + "]") def tc1000(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc1001(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - nodeIndex=0 - nodeName = createNodeName(nodeIndex) - msg = getEventHead(groupIndex, changeId, nodeName) + nodeIndex = 0 + nodeName = createNodeName(nodeIndex) + msg = getEventHead(groupIndex, changeId, nodeName) - for i in range(100): - seqNr = i+(ctr_responses[groupIndex]-1) - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "5MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + for i in range(100): + seqNr = i + (ctr_responses[groupIndex] - 1) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "5MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - return buildOkResponse("["+msg+"]") + return buildOkResponse("[" + msg + "]") def tc1100(groupIndex, changeId, filePrefix, ftpType, filesize): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + msg = "" - msg = "" + batch = (ctr_responses[groupIndex] - 1) % 20 - batch = (ctr_responses[groupIndex]-1)%20; + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for i in range(100): # 100 files per event + seqNr = i + int((ctr_responses[groupIndex] - 1) / 20) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): # 100 files per event - seqNr = i + int((ctr_responses[groupIndex]-1)/20); - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc1200(groupIndex, changeId, filePrefix, ftpType, filesize): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - msg = "" + msg = "" - batch = (ctr_responses[groupIndex]-1)%20; + batch = (ctr_responses[groupIndex] - 1) % 20 - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for i in range(100): # 100 files per event, all new files - seqNr = i+100 * int((ctr_responses[groupIndex]-1)/20); - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + for i in range(100): # 100 files per event, all new files + seqNr = i + 100 * int((ctr_responses[groupIndex] - 1) / 20) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - return buildOkResponse("["+msg+"]") + return buildOkResponse("[" + msg + "]") def tc1300(groupIndex, changeId, filePrefix, ftpType, filesize): - global ctr_responses - global ctr_events - global rop_counter - global rop_timestamp + global ctr_responses + global ctr_events + global rop_counter + global rop_timestamp - if (rop_counter == 0): - rop_timestamp = time.time() + if (rop_counter == 0): + rop_timestamp = time.time() - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - #Start a event deliver for all 700 nodes every 15min - rop = time.time()-rop_timestamp - if ((rop < 900) & (rop_counter%20 == 0) & (rop_counter != 0)): - return buildOkResponse("[]") - else: - if (rop_counter%20 == 0) & (rop_counter > 0): - rop_timestamp = rop_timestamp+900 + # Start a event deliver for all 700 nodes every 15min + rop = time.time() - rop_timestamp + if ((rop < 900) & (rop_counter % 20 == 0) & (rop_counter != 0)): + return buildOkResponse("[]") + else: + if (rop_counter % 20 == 0) & (rop_counter > 0): + rop_timestamp = rop_timestamp + 900 - rop_counter = rop_counter+1 + rop_counter = rop_counter + 1 - msg = "" + msg = "" - batch = (rop_counter-1)%20; + batch = (rop_counter - 1) % 20 - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for i in range(100): # 100 files per event - seqNr = i + int((rop_counter-1)/20); - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + for i in range(100): # 100 files per event + seqNr = i + int((rop_counter - 1) / 20) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 + + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc1500(groupIndex, changeId, filePrefix, ftpType, filesize): - global ctr_responses - global ctr_events - global rop_counter - global rop_timestamp + global ctr_responses + global ctr_events + global rop_counter + global rop_timestamp - if (rop_counter == 0): - rop_timestamp = time.time() + if (rop_counter == 0): + rop_timestamp = time.time() - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - if (ctr_responses[groupIndex] <= 2000 ): #first 25h of event doess not care of 15min rop timer + if (ctr_responses[groupIndex] <= 2000): # first 25h of event doess not care of 15min rop timer - msg = "" + msg = "" - batch = (ctr_responses[groupIndex]-1)%20; + batch = (ctr_responses[groupIndex] - 1) % 20 - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for i in range(100): # 100 files per event - seqNr = i + int((ctr_responses[groupIndex]-1)/20); - if i != 0: msg = msg + "," - if (seqNr < 100): - fileName = createMissingFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - else: - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) + for i in range(100): # 100 files per event + seqNr = i + int((ctr_responses[groupIndex] - 1) / 20) + if i != 0: msg = msg + "," + if (seqNr < 100): + fileName = createMissingFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + else: + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + rop_counter = rop_counter + 1 + return buildOkResponse("[" + msg + "]") - rop_counter = rop_counter+1 - return buildOkResponse("["+msg+"]") + # Start an event delivery for all 700 nodes every 15min + rop = time.time() - rop_timestamp + if ((rop < 900) & (rop_counter % 20 == 0) & (rop_counter != 0)): + return buildOkResponse("[]") + else: + if (rop_counter % 20 == 0): + rop_timestamp = time.time() - #Start an event delivery for all 700 nodes every 15min - rop = time.time()-rop_timestamp - if ((rop < 900) & (rop_counter%20 == 0) & (rop_counter != 0)): - return buildOkResponse("[]") - else: - if (rop_counter%20 == 0): - rop_timestamp = time.time() + rop_counter = rop_counter + 1 - rop_counter = rop_counter+1 + msg = "" - msg = "" + batch = (rop_counter - 1) % 20 - batch = (rop_counter-1)%20; + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for i in range(100): # 100 files per event + seqNr = i + int((rop_counter - 1) / 20) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(100): # 100 files per event - seqNr = i + int((rop_counter-1)/20); - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) - msg = msg + getEventName(fileName,ftpType,"onap","pano", nodeIndex) - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc500(groupIndex, changeId, filePrefix, ftpType, filesize): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - if (ctr_responses[groupIndex] > 1): - return buildOkResponse("[]") + if (ctr_responses[groupIndex] > 1): + return buildOkResponse("[]") - msg = "" + msg = "" + for pnfs in range(700): + if (pnfs > 0): + msg = msg + "," + nodeName = createNodeName(pnfs) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for pnfs in range(700): - if (pnfs > 0): - msg = msg + "," - nodeName = createNodeName(pnfs) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for i in range(2): + seqNr = i + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", pnfs) + seqNr = seqNr + pnfs * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - for i in range(2): - seqNr = i; - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, filesize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",pnfs) - seqNr = seqNr + pnfs*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc510(groupIndex, changeId, filePrefix, ftpType, fileSize): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 5): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 5): - return buildOkResponse("[]") + msg = "" - msg = "" + for pnfs in range(700): # build events for 700 MEs + if (pnfs > 0): + msg = msg + "," + nodeName = createNodeName(pnfs) + msg = msg + getEventHead(groupIndex, changeId, nodeName) + seqNr = (ctr_responses[groupIndex] - 1) + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", pnfs) + seqNr = seqNr + pnfs * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - for pnfs in range(700): # build events for 700 MEs - if (pnfs > 0): - msg = msg + "," - nodeName = createNodeName(pnfs) - msg = msg + getEventHead(groupIndex, changeId, nodeName) - seqNr = (ctr_responses[groupIndex]-1) - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",pnfs) - seqNr = seqNr + pnfs*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc511(groupIndex, changeId, filePrefix, ftpType, fileSize): - global ctr_responses - global ctr_events + global ctr_responses + global ctr_events + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + if (ctr_responses[groupIndex] > 5): + return buildOkResponse("[]") - if (ctr_responses[groupIndex] > 5): - return buildOkResponse("[]") + msg = "" - msg = "" + for pnfs in range(700): # build events for 700 MEs + if (pnfs > 0): + msg = msg + "," + nodeName = createNodeName(pnfs) + msg = msg + getEventHead(groupIndex, changeId, nodeName) + seqNr = (ctr_responses[groupIndex] - 1) + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) + msg = msg + getEventName(fileName, ftpType, "onap", "pano", pnfs) + seqNr = seqNr + pnfs * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - for pnfs in range(700): # build events for 700 MEs - if (pnfs > 0): - msg = msg + "," - nodeName = createNodeName(pnfs) - msg = msg + getEventHead(groupIndex, changeId, nodeName) - seqNr = (ctr_responses[groupIndex]-1) - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, fileSize) - msg = msg + getEventName(fileName,ftpType,"onap","pano",pnfs) - seqNr = seqNr + pnfs*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + return buildOkResponse("[" + msg + "]") - return buildOkResponse("["+msg+"]") def tc710(groupIndex, changeId, filePrefix, ftpType): - global ctr_responses - global ctr_events - + global ctr_responses + global ctr_events - ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 + ctr_responses[groupIndex] = ctr_responses[groupIndex] + 1 - if (ctr_responses[groupIndex] > 100): - return buildOkResponse("[]") + if (ctr_responses[groupIndex] > 100): + return buildOkResponse("[]") - msg = "" + msg = "" - batch = (ctr_responses[groupIndex]-1)%20; + batch = (ctr_responses[groupIndex] - 1) % 20 - for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 - if (pnfs > 0): - msg = msg + "," - nodeIndex=pnfs + batch*35 - nodeName = createNodeName(nodeIndex) - msg = msg + getEventHead(groupIndex, changeId, nodeName) + for pnfs in range(35): # build events for 35 PNFs at a time. 20 batches -> 700 + if (pnfs > 0): + msg = msg + "," + nodeIndex = pnfs + batch * 35 + nodeName = createNodeName(nodeIndex) + msg = msg + getEventHead(groupIndex, changeId, nodeName) - for i in range(100): # 100 files per event - seqNr = i + int((ctr_responses[groupIndex]-1)/20); - if i != 0: msg = msg + "," - fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") - msg = msg + getEventName(fileName,ftpType,"onap","pano",nodeIndex) - seqNr = seqNr + (pnfs+batch*35)*1000000 #Create unique id for this node and file - fileMap[groupIndex][seqNr*hash(filePrefix)] = seqNr + for i in range(100): # 100 files per event + seqNr = i + int((ctr_responses[groupIndex] - 1) / 20) + if i != 0: msg = msg + "," + fileName = createFileName(groupIndex, filePrefix, nodeName, seqNr, "1MB") + msg = msg + getEventName(fileName, ftpType, "onap", "pano", nodeIndex) + seqNr = seqNr + (pnfs + batch * 35) * 1000000 # Create unique id for this node and file + fileMap[groupIndex][seqNr * hash(filePrefix)] = seqNr - msg = msg + getEventEnd() - ctr_events[groupIndex] = ctr_events[groupIndex]+1 + msg = msg + getEventEnd() + ctr_events[groupIndex] = ctr_events[groupIndex] + 1 - return buildOkResponse("["+msg+"]") + return buildOkResponse("[" + msg + "]") #### Functions to build json messages and respones #### def createNodeName(index): - return "PNF"+str(index); + return "PNF" + str(index) + def createFileName(groupIndex, filePrefix, nodeName, index, size): global ctr_files ctr_files[groupIndex] = ctr_files[groupIndex] + 1 - return filePrefix+"20000626.2315+0200-2330+0200_" + nodeName + "-" + str(index) + "-" +size + ".tar.gz"; + return filePrefix + "20000626.2315+0200-2330+0200_" + nodeName + "-" + str(index) + "-" + size + ".tar.gz" + def createMissingFileName(groupIndex, filePrefix, nodeName, index, size): global ctr_files ctr_files[groupIndex] = ctr_files[groupIndex] + 1 - return filePrefix+"MissingFile_" + nodeName + "-" + str(index) + "-" +size + ".tar.gz"; + return filePrefix + "MissingFile_" + nodeName + "-" + str(index) + "-" + size + ".tar.gz" # Function to build fixed beginning of an event def getEventHead(groupIndex, changeId, nodename): - global pnfMap - pnfMap[groupIndex].add(nodename) - headStr = """ + global pnfMap + pnfMap[groupIndex].add(nodename) + headStr = """ { "event": { "commonEventHeader": { @@ -1146,31 +1172,34 @@ def getEventHead(groupIndex, changeId, nodename): "changeIdentifier": \"""" + changeId + """", "arrayOfNamedHashMap": [ """ - return headStr + return headStr + # Function to build the variable part of an event -def getEventName(fn,type,user,passwd, nodeIndex): - nodeIndex=nodeIndex%num_ftp_servers +def getEventName(fn, type, user, passwd, nodeIndex): + nodeIndex = nodeIndex % num_ftp_servers port = sftp_ports[nodeIndex] ip = sftp_hosts[nodeIndex] - if (type == "ftps"): - port = ftps_ports[nodeIndex] - ip = ftps_hosts[nodeIndex] + if (type == "ftpes"): + port = ftpes_ports[nodeIndex] + ip = ftpes_hosts[nodeIndex] - nameStr = """{ + nameStr = """{ "name": \"""" + fn + """", "hashMap": { "fileFormatType": "org.3GPP.32.435#measCollec", - "location": \"""" + type + """://""" + user + """:""" + passwd + """@""" + ip + """:""" + str(port) + """/""" + fn + """", + "location": \"""" + type + """://""" + user + """:""" + passwd + """@""" + ip + """:""" + str( + port) + """/""" + fn + """", "fileFormatVersion": "V10", "compression": "gzip" } } """ return nameStr + # Function to build fixed end of an event def getEventEnd(): - endStr = """ + endStr = """ ] } } @@ -1178,100 +1207,102 @@ def getEventEnd(): """ return endStr + # Function to build an OK reponse from a message string def buildOkResponse(msg): - response = app.response_class( - response=str.encode(msg), - status=200, - mimetype='application/json') - return response + response = app.response_class( + response=str.encode(msg), + status=200, + mimetype='application/json') + return response + # Function to build an empty message with status def buildEmptyResponse(status_code): - response = app.response_class( - response=str.encode(""), - status=status_code, - mimetype='application/json') - return response + response = app.response_class( + response=str.encode(""), + status=status_code, + mimetype='application/json') + return response if __name__ == "__main__": # IP addresses to use for ftp servers, using localhost if not env var is set sftp_sims = os.environ.get('SFTP_SIMS', 'localhost:1022') - ftps_sims = os.environ.get('FTPS_SIMS', 'localhost:21') + ftpes_sims = os.environ.get('FTPES_SIMS', 'localhost:21') num_ftp_servers = int(os.environ.get('NUM_FTP_SERVERS', 1)) print("Configured sftp sims: " + sftp_sims) - print("Configured ftps sims: " + ftps_sims) + print("Configured ftpes sims: " + ftpes_sims) print("Configured number of ftp servers: " + str(num_ftp_servers)) - tmp=sftp_sims.split(',') + tmp = sftp_sims.split(',') for i in range(len(tmp)): - hp=tmp[i].split(':') + hp = tmp[i].split(':') sftp_hosts.append(hp[0]) sftp_ports.append(hp[1]) - tmp=ftps_sims.split(',') + tmp = ftpes_sims.split(',') for i in range(len(tmp)): - hp=tmp[i].split(':') - ftps_hosts.append(hp[0]) - ftps_ports.append(hp[1]) + hp = tmp[i].split(':') + ftpes_hosts.append(hp[0]) + ftpes_ports.append(hp[1]) groups = os.environ.get('MR_GROUPS', 'OpenDcae-c12:PM_MEAS_FILES') - print("Groups detected: " + groups ) + print("Groups detected: " + groups) configuredPrefixes = os.environ.get('MR_FILE_PREFIX_MAPPING', 'PM_MEAS_FILES:A') - if (len(groups) == 0 ): - groups='OpenDcae-c12:PM_MEAS_FILES' + if not groups: + groups = 'OpenDcae-c12:PM_MEAS_FILES' print("Using default group: " + groups) else: print("Configured groups: " + groups) - if (len(configuredPrefixes) == 0 ): - configuredPrefixes='PM_MEAS_FILES:A' + if not configuredPrefixes: + configuredPrefixes = 'PM_MEAS_FILES:A' print("Using default changeid to file prefix mapping: " + configuredPrefixes) else: print("Configured changeid to file prefix mapping: " + configuredPrefixes) - #Counters + # Counters ctr_responses = [] ctr_requests = [] - ctr_files=[] + ctr_files = [] ctr_events = [] startTime = time.time() firstPollTime = [] runningState = "Started" - #Keeps all responded file names + # Keeps all responded file names fileMap = [] - #Keeps all responded PNF names + # Keeps all responded PNF names pnfMap = [] - #Handles rop periods for tests that deliveres events every 15 min + # Handles rop periods for tests that deliveres events every 15 min rop_counter = 0 rop_timestamp = time.time() - #List of configured group names + # List of configured group names groupNames = [] - #Mapping between group name and index in groupNames + # Mapping between group name and index in groupNames groupNameIndexes = {} - #String of configured groups + # String of configured groups configuredGroups = "" - #String of configured change identifiers + # String of configured change identifiers configuredChangeIds = "" - #List of changed identifiers + # List of changed identifiers changeIds = [] - #List of filePrefixes + # List of filePrefixes filePrefixes = {} - tmp=groups.split(',') + tmp = groups.split(',') for i in range(len(tmp)): - g=tmp[i].split(':') + g = tmp[i].split(':') for j in range(len(g)): g[j] = g[j].strip() if (j == 0): - if (len(configuredGroups) > 0): - configuredGroups=configuredGroups+"," - configuredGroups=configuredGroups+g[0] + if configuredGroups: + configuredGroups = configuredGroups + "," + configuredGroups = configuredGroups + g[0] groupNames.append(g[0]) groupNameIndexes[g[0]] = i changeIds.append({}) @@ -1282,18 +1313,18 @@ if __name__ == "__main__": firstPollTime.append(0) pnfMap.append(set()) fileMap.append({}) - if (len(configuredChangeIds) > 0): - configuredChangeIds=configuredChangeIds+"," + if configuredGroups: + configuredChangeIds = configuredChangeIds + "," else: - changeIds[i][j-1]=g[j] + changeIds[i][j - 1] = g[j] if (j > 1): - configuredChangeIds=configuredChangeIds+":" - configuredChangeIds=configuredChangeIds+g[j] + configuredChangeIds = configuredChangeIds + ":" + configuredChangeIds = configuredChangeIds + g[j] # Create a map between changeid and file name prefix - tmp=configuredPrefixes.split(',') + tmp = configuredPrefixes.split(',') for i in range(len(tmp)): - p=tmp[i].split(':') + p = tmp[i].split(':') filePrefixes[p[0]] = p[1] tc_num = "Not set" @@ -1301,7 +1332,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser() -#SFTP TCs with single ME + # SFTP TCs with single ME parser.add_argument( '--tc100', action='store_true', @@ -1354,7 +1385,7 @@ if __name__ == "__main__": action='store_true', help='TC1001 - One ME, SFTP, 5MB files, 100 files per event, endless number of events, 1 event per poll') -# SFTP TCs with multiple MEs + # SFTP TCs with multiple MEs parser.add_argument( '--tc500', action='store_true', @@ -1434,143 +1465,140 @@ if __name__ == "__main__": action='store_true', help='TC1500 - 700 ME, SFTP, 1MB files, 100 files per event, 35 events per poll, simulating 25h backlog of decreasing number of outdated files and then 20 event polls every 15min for 1h') -# FTPS TCs with single ME + # FTPES TCs with single ME parser.add_argument( '--tc200', action='store_true', - help='TC200 - One ME, FTPS, 1 1MB file, 1 event') + help='TC200 - One ME, FTPES, 1 1MB file, 1 event') parser.add_argument( '--tc201', action='store_true', - help='TC201 - One ME, FTPS, 1 5MB file, 1 event') + help='TC201 - One ME, FTPES, 1 5MB file, 1 event') parser.add_argument( '--tc202', action='store_true', - help='TC202 - One ME, FTPS, 1 50MB file, 1 event') + help='TC202 - One ME, FTPES, 1 50MB file, 1 event') parser.add_argument( '--tc210', action='store_true', - help='TC210 - One ME, FTPS, 1MB files, 1 file per event, 100 events, 1 event per poll.') + help='TC210 - One ME, FTPES, 1MB files, 1 file per event, 100 events, 1 event per poll.') parser.add_argument( '--tc211', action='store_true', - help='TC211 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll.') + help='TC211 - One ME, FTPES, 1MB files, 100 files per event, 100 events, 1 event per poll.') parser.add_argument( '--tc212', action='store_true', - help='TC212 - One ME, FTPS, 5MB files, 100 files per event, 100 events, 1 event per poll.') + help='TC212 - One ME, FTPES, 5MB files, 100 files per event, 100 events, 1 event per poll.') parser.add_argument( '--tc213', action='store_true', - help='TC213 - One ME, FTPS, 1MB files, 100 files per event, 100 events. All events in one poll.') + help='TC213 - One ME, FTPES, 1MB files, 100 files per event, 100 events. All events in one poll.') parser.add_argument( '--tc220', action='store_true', - help='TC220 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% of replies each: no response, empty message, slow response, 404-error, malformed json') + help='TC220 - One ME, FTPES, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% of replies each: no response, empty message, slow response, 404-error, malformed json') parser.add_argument( '--tc221', action='store_true', - help='TC221 - One ME, FTPS, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% missing files') + help='TC221 - One ME, FTPES, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% missing files') parser.add_argument( '--tc222', action='store_true', - help='TC222 - One ME, FTPS, 1MB files, 100 files per event, 100 events. 1 event per poll. All files with identical name. ') + help='TC222 - One ME, FTPES, 1MB files, 100 files per event, 100 events. 1 event per poll. All files with identical name. ') parser.add_argument( '--tc2000', action='store_true', - help='TC2000 - One ME, FTPS, 1MB files, 100 files per event, endless number of events, 1 event per poll') + help='TC2000 - One ME, FTPES, 1MB files, 100 files per event, endless number of events, 1 event per poll') parser.add_argument( '--tc2001', action='store_true', - help='TC2001 - One ME, FTPS, 5MB files, 100 files per event, endless number of events, 1 event per poll') - + help='TC2001 - One ME, FTPES, 5MB files, 100 files per event, endless number of events, 1 event per poll') parser.add_argument( '--tc2100', action='store_true', - help='TC2100 - 700 ME, FTPS, 1MB files, 100 files per event, endless number of events, 35 event per poll') + help='TC2100 - 700 ME, FTPES, 1MB files, 100 files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2101', action='store_true', - help='TC2101 - 700 ME, FTPS, 5MB files, 100 files per event, endless number of events, 35 event per poll') + help='TC2101 - 700 ME, FTPES, 5MB files, 100 files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2102', action='store_true', - help='TC2102 - 700 ME, FTPS, 50MB files, 100 files per event, endless number of events, 35 event per poll') + help='TC2102 - 700 ME, FTPES, 50MB files, 100 files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2200', action='store_true', - help='TC2200 - 700 ME, FTPS, 1MB files, 100 new files per event, endless number of events, 35 event per poll') + help='TC2200 - 700 ME, FTPES, 1MB files, 100 new files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2201', action='store_true', - help='TC2201 - 700 ME, FTPS, 5MB files, 100 new files per event, endless number of events, 35 event per poll') + help='TC2201 - 700 ME, FTPES, 5MB files, 100 new files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2202', action='store_true', - help='TC2202 - 700 ME, FTPS, 50MB files, 100 new files per event, endless number of events, 35 event per poll') + help='TC2202 - 700 ME, FTPES, 50MB files, 100 new files per event, endless number of events, 35 event per poll') parser.add_argument( '--tc2300', action='store_true', - help='TC2300 - 700 ME, FTPS, 1MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') + help='TC2300 - 700 ME, FTPES, 1MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') parser.add_argument( '--tc2301', action='store_true', - help='TC2301 - 700 ME, FTPS, 5MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') + help='TC2301 - 700 ME, FTPES, 5MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') parser.add_argument( '--tc2302', action='store_true', - help='TC2302 - 700 ME, FTPS, 50MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') + help='TC2302 - 700 ME, FTPES, 50MB files, 100 files per event, endless number of events, 35 event per poll, 20 event polls every 15min') parser.add_argument( '--tc2500', action='store_true', - help='TC2500 - 700 ME, FTPS, 1MB files, 100 files per event, 35 events per poll, simulating 25h backlog of decreasing number of outdated files and then 20 event polls every 15min for 1h') + help='TC2500 - 700 ME, FTPES, 1MB files, 100 files per event, 35 events per poll, simulating 25h backlog of decreasing number of outdated files and then 20 event polls every 15min for 1h') parser.add_argument( '--tc600', action='store_true', - help='TC600 - 700 MEs, FTPS, 1MB files, 2 new files per event, 700 events, all event in one poll.') + help='TC600 - 700 MEs, FTPES, 1MB files, 2 new files per event, 700 events, all event in one poll.') parser.add_argument( '--tc601', action='store_true', - help='TC601 - 700 MEs, FTPS, 5MB files, 2 new files per event, 700 events, all event in one poll.') + help='TC601 - 700 MEs, FTPES, 5MB files, 2 new files per event, 700 events, all event in one poll.') parser.add_argument( '--tc602', action='store_true', - help='TC602 - 700 MEs, FTPS, 50MB files, 2 new files per event, 700 events, all event in one poll.') + help='TC602 - 700 MEs, FTPES, 50MB files, 2 new files per event, 700 events, all event in one poll.') parser.add_argument( '--tc610', action='store_true', - help='TC610 - 700 MEs, FTPS, 1MB files, 1 file per event, 3500 events, 700 event per poll.') + help='TC610 - 700 MEs, FTPES, 1MB files, 1 file per event, 3500 events, 700 event per poll.') parser.add_argument( '--tc611', action='store_true', - help='TC611 - 700 MEs, FTPS, 1KB files, 1 file per event, 3500 events, 700 event per poll.') + help='TC611 - 700 MEs, FTPES, 1KB files, 1 file per event, 3500 events, 700 event per poll.') parser.add_argument( '--tc650', action='store_true', - help='TC610 - 700 MEs, FTPS, 50MB files, 1 file per event, 3500 events, 700 event per poll.') + help='TC610 - 700 MEs, FTPES, 50MB files, 1 file per event, 3500 events, 700 event per poll.') parser.add_argument( '--tc810', action='store_true', - help='TC810 - 700 MEs, FTPS, 1MB files, 100 files per event, 3500 events, 35 event per poll.') + help='TC810 - 700 MEs, FTPES, 1MB files, 100 files per event, 3500 events, 35 event per poll.') args = parser.parse_args() - - if args.tc100: tc_num = "TC# 100" elif args.tc101: @@ -1711,23 +1739,27 @@ if __name__ == "__main__": print("TC num: " + tc_num) for i in range(len(sftp_hosts)): - print("Using " + str(sftp_hosts[i]) + ":" + str(sftp_ports[i]) + " for sftp server with index " + str(i) + " for sftp server address and port in file urls.") + print("Using " + str(sftp_hosts[i]) + ":" + str(sftp_ports[i]) + " for sftp server with index " + str( + i) + " for sftp server address and port in file urls.") - for i in range(len(ftps_hosts)): - print("Using " + str(ftps_hosts[i]) + ":" + str(ftps_ports[i]) + " for ftps server with index " + str(i) + " for ftps server address and port in file urls.") + for i in range(len(ftpes_hosts)): + print("Using " + str(ftpes_hosts[i]) + ":" + str(ftpes_ports[i]) + " for ftpes server with index " + str( + i) + " for ftpes server address and port in file urls.") print("Using up to " + str(num_ftp_servers) + " ftp servers, for each protocol for PNFs.") + def https_app(**kwargs): import ssl context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) context.load_cert_chain('cert/cert.pem', 'cert/key.pem') app.run(ssl_context=context, **kwargs) + from multiprocessing import Process kwargs = dict(host=HOST_IP) Process(target=https_app, kwargs=dict(kwargs, port=HOST_PORT_TLS), daemon=True).start() - app.run(port=HOST_PORT, host=HOST_IP)
\ No newline at end of file + app.run(port=HOST_PORT, host=HOST_IP) diff --git a/test/mocks/datafilecollector-testharness/simulator-group/README.md b/test/mocks/datafilecollector-testharness/simulator-group/README.md index 1af9e3e80..a37c2fb8d 100644 --- a/test/mocks/datafilecollector-testharness/simulator-group/README.md +++ b/test/mocks/datafilecollector-testharness/simulator-group/README.md @@ -33,11 +33,11 @@ There are 5 different types of simulators. For futher details, see the README.md 4. The SFTP simulator(s) handles the ftp download requests. 5 of these simulators are always started and in the MR sim it is possible to configure the distrubution of files over these 5 servers (from 1 up to 5 severs). At start of the server, the server is populated with files to download. -5. The FTPS simulator(s) is the same as the SFTP except that it using the FTPS protocol. +5. The FTPES simulator(s) is the same as the SFTP except that it using the FTPES protocol. # Build the simulator images -Run the script `prepare-images.sh` to build the docker images for MR, DR and FTPS servers. +Run the script `prepare-images.sh` to build the docker images for MR, DR and FTPES servers. # Edit simulator env variables @@ -63,9 +63,9 @@ Do the manual steps to prepare the simulator images: - Run the docker build command to build the image for the MR simulator: 'docker build -t mrsim:latest .' - cd ../dr-sim - Run the docker build command to build the image for the DR simulators: \`docker build -t drsim_common:latest .' -- cd ../ftps-sftp-server -- Check the README.md in ftps-sftp-server dir in case the cert need to be updated. -- Run the docker build command to build the image for the DR simulators: \`docker build -t ftps_vsftpd:latest -f Dockerfile-ftps .' +- cd ../ftpes-sftp-server +- Check the README.md in ftpes-sftp-server dir in case the cert need to be updated. +- Run the docker build command to build the image for the DR simulators: \`docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes .' ## Execution @@ -91,16 +91,16 @@ NUM_PNFS="2" #Two PNFs To minimize the number of ftp file creation, the following two variables can be configured in the same file. FILE_SIZE="1MB" #File size for FTP file (1KB, 1MB, 5MB, 50MB or ALL) -FTP_TYPE="SFTP" #Type of FTP files to generate (SFTP, FTPS or ALL) +FTP_TYPE="SFTP" #Type of FTP files to generate (SFTP, FTPES or ALL) -If `FTP_TYPE` is set to `ALL`, both ftp servers will be populated with the same files. If set to `SFTP` or `FTPS` then only the server serving that protocol will be populated with files. +If `FTP_TYPE` is set to `ALL`, both ftp servers will be populated with the same files. If set to `SFTP` or `FTPES` then only the server serving that protocol will be populated with files. Run the script `docker-compose-setup.sh`to create a docker-compose with the desired settings. The desired setting in the script need to be manually adapted to for each specific simulator behavior according to the above. Check each simulator for available parameters. All simulators will be started with the generated docker-compose.yml file -To generate ftp url with IP different from localhost, set SFTP_SIM_IP and/or FTPS_SIM_IP env variables to the addreses of the ftp servers before starting. +To generate ftp url with IP different from localhost, set SFTP_SIM_IP and/or FTPES_SIM_IP env variables to the addreses of the ftp servers before starting. So farm, this only works when the simulator python script is started from the command line. Kill all the containers with `simulators-kill.se` diff --git a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-setup.sh b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-setup.sh index b212fc26c..e6df022ce 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-setup.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-setup.sh @@ -16,12 +16,12 @@ export DR_REDIR_FEEDS="1:A,2:B,3:C,4:D" # Comma-separated of <fee export NUM_FTPFILES="105" # Number of FTP files to generate per PNF export NUM_PNFS="700" # Number of unuqie PNFs to generate FTP file for export FILE_SIZE="1MB" # File size for FTP file (1KB, 1MB, 5MB, 50MB or ALL) -export FTP_TYPE="SFTP" # Type of FTP files to generate (SFTP, FTPS or ALL) +export FTP_TYPE="SFTP" # Type of FTP files to generate (SFTP, FTPES or ALL) export FTP_FILE_PREFIXES="A,B,C,D" # Comma separated list of file name prefixes for ftp files export NUM_FTP_SERVERS=1 # Number of FTP server to distribute the PNFs (Max 5) export SFTP_SIMS="localhost:21,localhost:22,localhost:23,localhost:24,localhost:25" # Comma separated list for SFTP servers host:port -export FTPS_SIMS="localhost:1022,localhost:1023,localhost:1024,localhost:1026,localhost:1026" # Comma separated list for FTPS servers host:port +export FTPES_SIMS="localhost:1022,localhost:1023,localhost:1024,localhost:1026,localhost:1026" # Comma separated list for FTPES servers host:port export DR_REDIR_SIM="localhost" # Hostname of DR redirect server diff --git a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml index 2d2a3ea2c..41cafc386 100644 --- a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml +++ b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml @@ -76,7 +76,7 @@ services: - dfcnet environment: SFTP_SIMS: ${SFTP_SIMS} - FTPS_SIMS: ${FTPS_SIMS} + FTPES_SIMS: ${FTPES_SIMS} NUM_FTP_SERVERS: ${NUM_FTP_SERVERS} MR_GROUPS: ${MR_GROUPS} MR_FILE_PREFIX_MAPPING: ${MR_FILE_PREFIX_MAPPING} @@ -145,7 +145,7 @@ services: networks: - dfcnet container_name: dfc_ftpes-server-vsftpd0 - image: ftps_vsftpd:latest + image: ftpes_vsftpd:latest ports: - "1032:21" environment: @@ -162,7 +162,7 @@ services: networks: - dfcnet container_name: dfc_ftpes-server-vsftpd1 - image: ftps_vsftpd:latest + image: ftpes_vsftpd:latest ports: - "1033:21" environment: @@ -179,7 +179,7 @@ services: networks: - dfcnet container_name: dfc_ftpes-server-vsftpd2 - image: ftps_vsftpd:latest + image: ftpes_vsftpd:latest ports: - "1034:21" environment: @@ -196,7 +196,7 @@ services: networks: - dfcnet container_name: dfc_ftpes-server-vsftpd3 - image: ftps_vsftpd:latest + image: ftpes_vsftpd:latest ports: - "1035:21" environment: @@ -213,7 +213,7 @@ services: networks: - dfcnet container_name: dfc_ftpes-server-vsftpd4 - image: ftps_vsftpd:latest + image: ftpes_vsftpd:latest ports: - "1036:21" environment: diff --git a/test/mocks/datafilecollector-testharness/simulator-group/prepare-images.sh b/test/mocks/datafilecollector-testharness/simulator-group/prepare-images.sh index 666e14a8e..11e4c0e11 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/prepare-images.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/prepare-images.sh @@ -12,8 +12,8 @@ cd ../dr-sim docker build -t drsim_common:latest . -#Build image for ftps server -cd ../ftps-sftp-server +#Build image for ftpes server +cd ../ftpes-sftp-server -docker build -t ftps_vsftpd:latest -f Dockerfile-ftps . +docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes . diff --git a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh index 5c7c32f41..25750d38f 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh @@ -24,7 +24,7 @@ server_check_https() { echo "Simulator " $1 " on https://localhost:$2$3 - no response" } -ftps_server_check() { +ftpes_server_check() { for i in {1..10}; do res=$(curl --silent --max-time 3 localhost:$2 2>&1 | grep vsFTPd) if ! [ -z "$res" ]; then @@ -63,7 +63,7 @@ sudo chown $(id -u):$(id -g) consul sudo chown $(id -u):$(id -g) consul/consul/ declare -a SFTP_SIM -declare -a FTPS_SIM +declare -a FTPES_SIM DR_SIM="$(docker ps -q --filter='name=dfc_dr-sim')" DR_RD_SIM="$(docker ps -q --filter='name=dfc_dr-redir-sim')" @@ -73,11 +73,11 @@ SFTP_SIM[1]="$(docker ps -q --filter='name=dfc_sftp-server1')" SFTP_SIM[2]="$(docker ps -q --filter='name=dfc_sftp-server2')" SFTP_SIM[3]="$(docker ps -q --filter='name=dfc_sftp-server3')" SFTP_SIM[4]="$(docker ps -q --filter='name=dfc_sftp-server4')" -FTPS_SIM[0]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd0')" -FTPS_SIM[1]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd1')" -FTPS_SIM[2]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd2')" -FTPS_SIM[3]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd3')" -FTPS_SIM[4]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd4')" +FTPES_SIM[0]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd0')" +FTPES_SIM[1]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd1')" +FTPES_SIM[2]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd2')" +FTPES_SIM[3]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd3')" +FTPES_SIM[4]="$(docker ps -q --filter='name=dfc_ftpes-server-vsftpd4')" CBS_SIM="$(docker ps -q --filter='name=dfc_cbs')" CONSUL_SIM="$(docker ps -q --filter='name=dfc_consul')" @@ -91,11 +91,11 @@ if [ $(docker inspect --format '{{ .State.Running }}' $DR_SIM) ] && \ [ $(docker inspect --format '{{ .State.Running }}' ${SFTP_SIM[2]}) ] && \ [ $(docker inspect --format '{{ .State.Running }}' ${SFTP_SIM[3]}) ] && \ [ $(docker inspect --format '{{ .State.Running }}' ${SFTP_SIM[4]}) ] && \ -[ $(docker inspect --format '{{ .State.Running }}' ${FTPS_SIM[0]}) ] && \ -[ $(docker inspect --format '{{ .State.Running }}' ${FTPS_SIM[1]}) ] && \ -[ $(docker inspect --format '{{ .State.Running }}' ${FTPS_SIM[2]}) ] && \ -[ $(docker inspect --format '{{ .State.Running }}' ${FTPS_SIM[3]}) ] && \ -[ $(docker inspect --format '{{ .State.Running }}' ${FTPS_SIM[4]}) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' ${FTPES_SIM[0]}) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' ${FTPES_SIM[1]}) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' ${FTPES_SIM[2]}) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' ${FTPES_SIM[3]}) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' ${FTPES_SIM[4]}) ] && \ [ $(docker inspect --format '{{ .State.Running }}' $CBS_SIM) ] && \ [ $(docker inspect --format '{{ .State.Running }}' $CONSUL_SIM) ] then @@ -115,11 +115,11 @@ server_check "MR sim " 2222 "/" server_check_https "DR sim https " 3907 "/" server_check_https "DR redir sim https" 3909 "/" server_check_https "MR sim https " 2223 "/" -ftps_server_check "FTPS server 0" 1032 -ftps_server_check "FTPS server 1" 1033 -ftps_server_check "FTPS server 2" 1034 -ftps_server_check "FTPS server 3" 1035 -ftps_server_check "FTPS server 4" 1036 +ftpes_server_check "FTPES server 0" 1032 +ftpes_server_check "FTPES server 1" 1033 +ftpes_server_check "FTPES server 2" 1034 +ftpes_server_check "FTPES server 3" 1035 +ftpes_server_check "FTPES server 4" 1036 sftp_server_check "SFTP server 0" 1022 sftp_server_check "SFTP server 1" 1023 sftp_server_check "SFTP server 2" 1024 @@ -166,13 +166,13 @@ if [ $FTP_TYPE = "ALL" ] || [ $FTP_TYPE = "SFTP" ]; then let p=p+1 done fi -if [ $FTP_TYPE = "ALL" ] || [ $FTP_TYPE = "FTPS" ]; then - echo "Creating files for FTPS server, may take time...." +if [ $FTP_TYPE = "ALL" ] || [ $FTP_TYPE = "FTPES" ]; then + echo "Creating files for FTPES server, may take time...." p=0 while [ $p -lt $NUM_FTP_SERVERS ]; do - docker cp setup-ftp-files-for-image.sh ${FTPS_SIM[$p]}:/tmp/setup-ftp-files-for-image.sh + docker cp setup-ftp-files-for-image.sh ${FTPES_SIM[$p]}:/tmp/setup-ftp-files-for-image.sh #Double slash needed for docker on win... - docker exec -w //srv ${FTPS_SIM[$p]} //tmp/setup-ftp-files-for-image.sh $NUM_FTPFILES $NUM_PNFS $FILE_SIZE $FTP_FILE_PREFIXES $NUM_FTP_SERVERS $p #>/dev/null 2>&1 + docker exec -w //srv ${FTPES_SIM[$p]} //tmp/setup-ftp-files-for-image.sh $NUM_FTPFILES $NUM_PNFS $FILE_SIZE $FTP_FILE_PREFIXES $NUM_FTP_SERVERS $p #>/dev/null 2>&1 let p=p+1 done fi |