diff options
Diffstat (limited to 'test/mocks/datafilecollector-testharness/auto-test')
34 files changed, 2524 insertions, 0 deletions
diff --git a/test/mocks/datafilecollector-testharness/auto-test/.gitignore b/test/mocks/datafilecollector-testharness/auto-test/.gitignore new file mode 100644 index 000000000..2a21cc0a3 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/.gitignore @@ -0,0 +1,2 @@ +logs +.tmp_tcsuite_* diff --git a/test/mocks/datafilecollector-testharness/auto-test/DFC_FileRetentionSuite.sh b/test/mocks/datafilecollector-testharness/auto-test/DFC_FileRetentionSuite.sh new file mode 100755 index 000000000..219e9c589 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/DFC_FileRetentionSuite.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +TS_ONELINE_DESCR="DFC file retention (avoid double publish)" + +. ../common/testsuite_common.sh + +suite_setup + +############# TEST CASES ################# + +run_tc FTC30.sh $1 $2 +run_tc FTC31.sh $1 $2 +run_tc FTC32.sh $1 $2 +run_tc FTC33.sh $1 $2 + +########################################## + +suite_complete + diff --git a/test/mocks/datafilecollector-testharness/auto-test/DFC_ManagementSuite.sh b/test/mocks/datafilecollector-testharness/auto-test/DFC_ManagementSuite.sh new file mode 100755 index 000000000..3d5ea58b4 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/DFC_ManagementSuite.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +TS_ONELINE_DESCR="DFC rest API management" + +. ../common/testsuite_common.sh + +suite_setup + +############# TEST CASES ################# + +run_tc FTC200.sh $1 $2 +run_tc FTC210.sh $1 $2 +run_tc FTC220.sh $1 $2 + +########################################## + +suite_complete + diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh new file mode 100755 index 000000000..b6685a920 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 1MB file from one PNF in one event using SFTP, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC10.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC10.sh new file mode 100755 index 000000000..65c585a20 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC10.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="3500 1MB files from 700 PNFs in 3500 events in 5 polls using SFTP, from poll to publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc510" +export BC_TC="" +export NUM_FTPFILES="5" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 3500 900 + +sleep_wait 30 + +dr_equal ctr_published_files 3500 + +mr_greater ctr_requests 5 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 3500 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 3500 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3500 +dr_equal ctr_publish_req 3500 +dr_equal ctr_publish_req_redirect 3500 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3500 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3500 +drr_equal ctr_publish_responses 3500 + +drr_equal dwl_volume 3500000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh new file mode 100755 index 000000000..0d91ec7cb --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC11.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="3500 1MB files from 700 PNFs in 3500 events in 5 polls using FTPS, from poll to publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc610" +export BC_TC="" +export NUM_FTPFILES="5" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 3500 900 + +sleep_wait 30 + +dr_equal ctr_published_files 3500 + +mr_greater ctr_requests 5 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 3500 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 3500 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3500 +dr_equal ctr_publish_req 3500 +dr_equal ctr_publish_req_redirect 3500 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3500 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3500 +drr_equal ctr_publish_responses 3500 + +drr_equal dwl_volume 3500000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC12.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC12.sh new file mode 100755 index 000000000..d721fe197 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC12.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="3500 1KB files from 700 PNFs in 3500 events in 5 polls using SFTP, from poll to publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc511" +export BC_TC="" +export NUM_FTPFILES="5" +export NUM_PNFS="700" +export FILE_SIZE="1KB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 3500 900 + +sleep_wait 30 + +dr_equal ctr_published_files 3500 + +mr_greater ctr_requests 5 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 3500 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 3500 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3500 +dr_equal ctr_publish_req 3500 +dr_equal ctr_publish_req_redirect 3500 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3500 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3500 +drr_equal ctr_publish_responses 3500 + +drr_equal dwl_volume 3500000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh new file mode 100755 index 000000000..5cf211229 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC13.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="3500 1KB files from 700 PNFs in 3500 events in 5 polls using FTPS, from poll to publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc611" +export BC_TC="" +export NUM_FTPFILES="5" +export NUM_PNFS="700" +export FILE_SIZE="1KB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 3500 900 + +sleep_wait 30 + +dr_equal ctr_published_files 3500 + +mr_greater ctr_requests 5 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 3500 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 3500 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3500 +dr_equal ctr_publish_req 3500 +dr_equal ctr_publish_req_redirect 3500 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3500 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3500 +drr_equal ctr_publish_responses 3500 + +drr_equal dwl_volume 3500000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh new file mode 100755 index 000000000..45ecb6f3f --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 5MB file from one PNF in one event using SFTP, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc101" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="5MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 5000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC20.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC20.sh new file mode 100755 index 000000000..88d9e57fd --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC20.sh @@ -0,0 +1,65 @@ +#!/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 SFTP, from poll to publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc710" +export BC_TC="" +export NUM_FTPFILES="105" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 72800 18000 + +sleep_wait 30 + +dr_equal ctr_published_files 72800 + +mr_greater ctr_requests 100 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 72800 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 72800 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 72800 +dr_equal ctr_publish_req 72800 +dr_equal ctr_publish_req_redirect 72800 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 72800 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 72800 +drr_equal ctr_publish_responses 72800 + +drr_equal dwl_volume 72800000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC200.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC200.sh new file mode 100755 index 000000000..7cb07de2c --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC200.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC start, stop and hearbeat output." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +dfc_contain_str heartbeat "I'm living!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str heartbeat "I'm living" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str start "Datafile Service is still running!" +dfc_contain_str heartbeat "I'm living" + + +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" +dfc_contain_str start "Datafile Service has been started!" + + + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh new file mode 100755 index 000000000..a3c051427 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC21.sh @@ -0,0 +1,65 @@ +#!/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." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc810" +export BC_TC="" +export NUM_FTPFILES="105" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 72800 18000 + +sleep_wait 30 + +dr_equal ctr_published_files 72800 + +mr_greater ctr_requests 100 + +mr_equal ctr_events 3500 +mr_equal ctr_unique_files 72800 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 72800 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 72800 +dr_equal ctr_publish_req 72800 +dr_equal ctr_publish_req_redirect 72800 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 72800 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 72800 +drr_equal ctr_publish_responses 72800 + +drr_equal dwl_volume 72800000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC210.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC210.sh new file mode 100755 index 000000000..f7e9bf5d8 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC210.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC start and stop during poll, download and publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc113" +export BC_TC="" +export NUM_FTPFILES="199" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +mr_greater ctr_events 0 120 +dr_print ctr_published_files + + +dfc_contain_str heartbeat "I'm living!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" + +sleep_wait 120 + +dfc_contain_str start "Datafile Service has been started!" + +dr_greater ctr_published_files 100 60 +dr_less ctr_published_files 199 +dr_print ctr_published_files + +dfc_contain_str heartbeat "I'm living!" +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" + +sleep_wait 120 + +dfc_contain_str start "Datafile Service has been started!" + +dr_equal ctr_published_files 199 60 + + +mr_equal ctr_events 100 +mr_equal ctr_unique_files 199 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 199 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 199 +dr_equal ctr_publish_req 199 +dr_equal ctr_publish_req_redirect 199 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 199 + +drr_equal ctr_publish_requests 199 +drr_equal ctr_publish_responses 199 + +drr_equal dwl_volume 199000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC220.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC220.sh new file mode 100755 index 000000000..a652f8554 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC220.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC stop before polling event (no polling during stopped), then dfc start." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 30 + +kill_mr + +start_dfc + +sleep_wait 30 + +dfc_contain_str stopDatafile "Datafile Service has already been stopped!" + +start_simulators + +sleep_wait 120 + +mr_less ctr_requests 2 + +dfc_contain_str start "Datafile Service has been started!" + +dr_equal ctr_published_files 1 60 + +mr_greater ctr_requests 0 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh new file mode 100755 index 000000000..afa1f2ac1 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 50MB file from one PNF in one event using SFTP, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc102" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="50MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 50000000 + +check_dfc_log + + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC30.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC30.sh new file mode 100755 index 000000000..0fb3b0572 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC30.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC file retention. Publish 1 file, restart MR sim. No new publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +store_logs PART1 + + +kill_mr +start_simulators + +mr_equal ctr_events 0 60 +mr_equal ctr_unique_files 0 +mr_equal ctr_unique_PNFs 0 + +mr_equal ctr_events 1 60 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC31.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC31.sh new file mode 100755 index 000000000..34cf8aecf --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC31.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC file retention using DR. Publish 1 file, retstart MR sim and dfc. No new publish." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +store_logs PART1 + +kill_mr +kill_dfc +start_simulators + +mr_equal ctr_events 0 60 +mr_equal ctr_unique_files 0 +mr_equal ctr_unique_PNFs 0 + +start_dfc + +sleep_wait 30 + +mr_equal ctr_events 1 60 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 2 +dr_equal ctr_publish_query_published 1 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC32.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC32.sh new file mode 100755 index 000000000..48257a8df --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC32.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC file retention, 100 identical file names in 100 events" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc122" +export BC_TC="" +export NUM_FTPFILES="200" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +mr_equal ctr_events 100 1800 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + + +mr_equal ctr_events 100 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh new file mode 100755 index 000000000..a45ce1098 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC33.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +TC_ONELINE_DESCR="DFC file retention (files with SFTP and then same files overSFTP). 1MB, 5MB and 50MB using first SFTP and thenSFTP with restart of MR between each file." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="ALL" +export FTP_TYPE="ALL" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + + +start_dfc + +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#100" +dr_equal ctr_published_files 1 30 + + +kill_mr +export MR_TC="--tc101" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#101" +dr_equal ctr_published_files 2 30 + +kill_mr +export MR_TC="--tc102" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#102" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc200" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#200" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc201" +start_simulators + + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#201" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc202" +start_simulators + + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#202" +dr_equal ctr_published_files 3 30 + + +dr_equal ctr_publish_query 3 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3 +dr_equal ctr_publish_req 3 +dr_equal ctr_publish_req_redirect 3 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3 +drr_equal ctr_publish_responses 3 + +drr_equal dwl_volume 56000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh new file mode 100755 index 000000000..a29b6b1e6 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC4.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 1MB file from one PNF in one event using FTPS, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc200" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 1000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC40.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC40.sh new file mode 100755 index 000000000..074f290f4 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC40.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Poll, download and publish of 1MB, 5MB and 50MB using both SFTP and SFTP with restart of MR between each file." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc100" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="ALL" +export FTP_TYPE="ALL" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + + +start_dfc + +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#100" +dr_equal ctr_published_files 1 30 + + +kill_mr +export MR_TC="--tc101" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#101" +dr_equal ctr_published_files 2 30 + +kill_mr +export MR_TC="--tc102" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#102" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc200" +log_sim_settings +start_simulators + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#200" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc201" +start_simulators + + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#201" +dr_equal ctr_published_files 3 30 + +kill_mr +export MR_TC="--tc202" +start_simulators + + +mr_print tc_info +mr_equal ctr_events 1 60 +mr_contain_str tc_info "TC#202" +dr_equal ctr_published_files 3 30 + + +dr_equal ctr_publish_query 3 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 3 +dr_equal ctr_publish_req 3 +dr_equal ctr_publish_req_redirect 3 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 3 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 3 +drr_equal ctr_publish_responses 3 + +drr_equal dwl_volume 56000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh new file mode 100755 index 000000000..f62b85a76 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC5.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 5MB file from one PNF in one event using FTPS, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc201" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="5MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 5000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC50.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC50.sh new file mode 100755 index 000000000..0eb972287 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC50.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Poll 199 new files (100 events) with 10% missing files (20 files with bad file names not existing in FTP server)" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc121" +export BC_TC="" +export NUM_FTPFILES="199" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 179 5000 + +sleep_wait 600 + + +dr_equal ctr_published_files 179 + +mr_equal ctr_events 100 +mr_equal ctr_unique_files 179 +mr_equal ctr_unique_PNFs 1 + +dr_greater ctr_publish_query 179 +dr_equal ctr_publish_query_published 0 +dr_greater ctr_publish_query_not_published 179 +dr_equal ctr_publish_req 179 +dr_equal ctr_publish_req_redirect 179 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 179 + +drr_equal ctr_publish_requests 179 +drr_equal ctr_publish_responses 179 + +drr_equal dwl_volume 179000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh new file mode 100755 index 000000000..036225cfd --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC6.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="One 50MB file from one PNF in one event using FTPS, from poll to publish" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc202" +export BC_TC="" +export NUM_FTPFILES="1" +export NUM_PNFS="1" +export FILE_SIZE="50MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 1 60 + +sleep_wait 30 + +dr_equal ctr_published_files 1 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 1 +mr_equal ctr_unique_files 1 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 1 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1 +dr_equal ctr_publish_req 1 +dr_equal ctr_publish_req_redirect 1 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1 +drr_equal ctr_publish_responses 1 + +drr_equal dwl_volume 50000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC60.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC60.sh new file mode 100755 index 000000000..f68b9b04e --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC60.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Kill SFTP sever for 10+ sec during download" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc500" +export BC_TC="" +export NUM_FTPFILES="2" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_greater ctr_published_files 100 200 + +kill_sftp +sleep_wait 10 #Server will be gone longer due to long startup time of ftp (ftp file creatation) +start_simulators + +dr_equal ctr_published_files 1400 400 + +sleep_wait 30 + +dr_equal ctr_published_files 1400 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 700 +mr_equal ctr_unique_files 1400 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 1400 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1400 +dr_equal ctr_publish_req 1400 +dr_equal ctr_publish_req_redirect 1400 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1400 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1400 +drr_equal ctr_publish_responses 1400 + +drr_equal dwl_volume 1400000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh new file mode 100755 index 000000000..ef480473d --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC61.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Kill FTPs sever for 10+ sec during download" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc600" +export BC_TC="" +export NUM_FTPFILES="2" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_greater ctr_published_files 100 200 + +kill_ftps +sleep_wait 10 #Server will be gone longer due to long startup time of ftp (ftp file creatation) +start_simulators + +dr_equal ctr_published_files 1400 400 + +sleep_wait 30 + +dr_equal ctr_published_files 1400 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 700 +mr_equal ctr_unique_files 1400 +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query 1400 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 1400 +dr_equal ctr_publish_req 1400 +dr_equal ctr_publish_req_redirect 1400 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 1400 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 1400 +drr_equal ctr_publish_responses 1400 + +drr_equal dwl_volume 1400000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC70.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC70.sh new file mode 100755 index 000000000..e464d88e9 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC70.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="199 file publish attempt where 10% of calls to DR sim and DR redir sim responds with error" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc 10p_error_response" +export DR_REDIR_TC="--tc 10p_error_response" +export MR_TC="--tc113" +export BC_TC="" +export NUM_FTPFILES="199" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 199 300 + +sleep_wait 30 + +dr_equal ctr_published_files 199 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 100 +mr_equal ctr_unique_files 199 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 199 +dr_equal ctr_publish_query_published 0 +dr_less ctr_publish_query_not_published 199 +dr_greater ctr_publish_req 199 +dr_greater ctr_publish_req_redirect 199 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 199 +dr_equal ctr_double_publish 0 + +drr_greater ctr_publish_requests 199 +drr_equal ctr_publish_responses 199 + +drr_equal dwl_volume 199000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC71.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC71.sh new file mode 100755 index 000000000..5f4238ef4 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/FTC71.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +TC_ONELINE_DESCR="199 file publish attempt where all calls to DR sim and DR redir sim responds after 10s delay" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc all_delay_10s" +export DR_REDIR_TC="--tc all_delay_10s" +export MR_TC="--tc113" +export BC_TC="" +export NUM_FTPFILES="199" +export NUM_PNFS="1" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +dr_equal ctr_published_files 199 300 + +sleep_wait 30 + +dr_equal ctr_published_files 199 + +mr_greater ctr_requests 1 + +mr_equal ctr_events 100 +mr_equal ctr_unique_files 199 +mr_equal ctr_unique_PNFs 1 + +dr_equal ctr_publish_query 199 +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published 199 +dr_equal ctr_publish_req 199 +dr_equal ctr_publish_req_redirect 199 +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files 199 +dr_equal ctr_double_publish 0 + +drr_equal ctr_publish_requests 199 +drr_equal ctr_publish_responses 199 + +drr_equal dwl_volume 199000000 + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh new file mode 100755 index 000000000..cf4dbdc71 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_FTPS_24h.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Maximum number of 1MB FTPS files during 24h, 700 PNFs. 100 new files per event." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc2200" +export BC_TC="" +export NUM_FTPFILES="3500" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +# 24h MR sim execution time since first poll, should be reached withing 24h +1h margin +mr_contain_str exe_time_first_poll 1440: $((60*60*24+3600)) +# stop event delivery +mr_print stop +# wait for MR sim values to stabilize +sleep_wait 30 + +# Requirement number of files, 100 new files in first event for each PNF, then 1 new file per PNF in the +# remaining polls up to 24h. This is the minimum number of published files for the test +TARGET_REQUIRMENT_FILES=$((70000+700*95)) + +#Calculate targets based on the number of of unique files delivered from MR sim +TARGET_FILES=$(mr_read ctr_unique_files) +TARGET_EVENTS=$((TARGET_FILES/100)) +TARGET_VOLUME=$((TARGET_FILES*1000000)) + +#Maximum number of configured FTP files, if DFC download more than this then the NUM_FTPSFILES need to be increased. +MAX_FILES=$((NUM_FTPFILE*NUM_PNFS)) + +#Wait remaining time upto 15 min for DFC to download all consumed events +sleep_wait 870 + +#At least the requiment number of file shall be published +dr_greater ctr_published_files $TARGET_REQUIRMENT_FILES + +#If greater then MAX_FILES then more FTP files need to be configured +mr_less ctr_ctr_unique_files MAX_FILES + + +#Test that all files from polled events has been downloaded etc + +dr_equal ctr_published_files $TARGET_FILES + +mr_equal ctr_events $TARGET_EVENTS + +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query $TARGET_FILES +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published $TARGET_FILES +dr_equal ctr_publish_req $TARGET_FILES +dr_equal ctr_publish_req_redirect $TARGET_FILES +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files $TARGET_FILES + +drr_equal ctr_publish_requests $TARGET_FILES +drr_equal ctr_publish_responses $TARGET_FILES + +drr_equal dwl_volume $TARGET_VOLUME + +print_all + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_SFTP_24h.sh b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_SFTP_24h.sh new file mode 100755 index 000000000..a50fc1686 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/MaxFiles1MB_SFTP_24h.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Maximum number of 1MB SFTP files during 24h, 700 PNFs. 100 new files per event." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc1200" +export BC_TC="" +export NUM_FTPFILES="1500" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +# 24h MR sim execution time since first poll, should be reached withing 24h +1h margion +mr_contain_str exe_time_first_poll 1440: $((60*60*24+3600)) +# stop event delivery +mr_print stop +# wait for MR sim values to stabilize +sleep_wait 30 + +# Requirement number of files, 100 new files in first event for each PNF, then 1 new file per PNF in the +# remaining polls up to 24h. This is the minimum number of published files for the test +TARGET_REQUIRMENT_FILES=$((70000+700*95)) + +#Calculate targets based on the number of of unique files delivered from MR sim +TARGET_FILES=$(mr_read ctr_unique_files) +TARGET_EVENTS=$((TARGET_FILES/100)) +TARGET_VOLUME=$((TARGET_FILES*1000000)) + +#Maximum number of configured FTP files, if DFC download more than this then the NUM_FTPSFILES need to be increased. +MAX_FILES=$((NUM_FTPFILE*NUM_PNFS)) + +#Wait remaining time upto 15 min for DFC to download all consumed events +sleep_wait 870 + +#At least the requiment number of file shall be published +dr_greater ctr_published_files $TARGET_REQUIRMENT_FILES + +#If greater then MAX_FILES then more FTP files need to be configured +mr_less ctr_ctr_unique_files MAX_FILES + + +#Test that all files from polled events has been downloaded etc + +dr_equal ctr_published_files $TARGET_FILES + +mr_equal ctr_events $TARGET_EVENTS + +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query $TARGET_FILES +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published $TARGET_FILES +dr_equal ctr_publish_req $TARGET_FILES +dr_equal ctr_publish_req_redirect $TARGET_FILES +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files $TARGET_FILES + +drr_equal ctr_publish_requests $TARGET_FILES +drr_equal ctr_publish_responses $TARGET_FILES + +drr_equal dwl_volume $TARGET_VOLUME + +print_all + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/README.md b/test/mocks/datafilecollector-testharness/auto-test/README.md new file mode 100644 index 000000000..09001d068 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/README.md @@ -0,0 +1,269 @@ +## Running automated test case and test suites +Test cases run a single test case and test suites run one or more test cases in a sequence. + +##Overall structure and setup +Test cases and test suites are written as bash scripts which call predefined functions in two other bash scripts +located in ../common dir. +The functions are described further below. +The integration repo is needed as well as docker. +If needed setup the ``DFC_LOCAL_IMAGE`` and ``DFC_REMOTE_IMAGE`` env var in test_env.sh to point to the dfc images (local registry image or next registry image) without the image tag. +The predefined images should be ok for current usage: +``DFC_REMOTE_IMAGE=nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server`` +``DFC_LOCAL_IMAGE=onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server`` + +If the test cases/suites in this dir are not executed in the auto-test dir in the integration repo, then the ``SIM_GROUP`` env var need to point to the ``simulator-group`` dir. +See instructions in the test_env.sh. The ../common dir is needed as well in the case. That is, it is possible to have auto-test dir (and the common dir) somewhere +than in the integration repo but the simulator group dir need to be available. + +##Test cases and test suites naming. +Each file filename should have the format ``<tc-id>.sh`` for test cases and ``<ts-id>.sh`` for test suite. The tc-id and ts-id are the +identify of the test case or test suite. Example FTC2.sh, FTC2 is the id of the test case. Just the contents of the files determines if +it is a test case or test suite so good to name the file so it is easy to see if it is a test case or a test suite. +A simple way to list all test cases/suite along with the description is to do ``grep ONELINE_DESCR *.sh`` in the shell. + +##Logs from containers and test cases +All logs from each test cases are stored under ``logs/<tc-id>/``. +The logs include the application.log and the container log from dfc, the container logs from each simulator and the test case log (same as the screen output). + +##Execution## +Test cases and test suites are executed by: ``./<tc-id or ts-id>.sh local | remote | remote-remove | manual-container | manual-app``</br> +**local** - uses the dfc image pointed out by ``DFC_LOCAL_IMAGE`` in the test_env, should be the dfc image built locally in your docker registry.</br> +**remote** - uses the dfc image pointed out by ``DFC_REMOTE_IMAGE`` in the test_env, should be the dfc nexus image in your docker registry.</br> +**remote-remove** - uses the dfc image pointed out by ``DFC_REMOTE_IMAGE`` in the test_env, should be the dfc nexus image in your docker registry. Removes the nexus image and pull from remote registry.</br> +**manual-container** - uses dfc in a manually started container. The script will prompt you for manual starting and stopping of the container.</br> +**manual-app** - uses dfc app started as an external process (from eclipse etc). The script will prompt you for manual start and stop of the process.</br> + +##Test case file## +A test case file contains a number of steps to verify a certain functionality. +A description of the test case should be given to the ``TC_ONELINE_DESCR`` var. The description will be printed in the test result. + +The empty template for a test case files looks like this: + +(Only the parts noted with < and > shall be changed.) + +----------------------------------------------------------- +``` +#!/bin/bash + +TC_ONELINE_DESCR="<test case description>" + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + + +<tests here> + + +#### TEST COMPLETE #### + +store_logs END + +print_result + +``` +----------------------------------------------------------- + +The ../common/testcase_common.sh contains all functions needed for the test case file. + +The following is a list of the available functions in a test case file. Please see some of the defined test case for examples. + +**log_sim_settings**</br> +Print the env variables needed for the simulators and their setup + +**clean_containers**</br> +Stop and remove all containers including dfc app and simulators + +**start_simulators** +Start all simulators in the simulator group + +**start_dfc**</br> +Start the dfc application + +**kill_dfc**</br> +Stop and remove the dfc app container + +**kill_dr**</br> +Stop and remove the DR simulator container + +**kill_drr**</br> +Stop and remove the DR redir simulator container + +**kill_mr**</br> +Stop and remove the MR simulator container + +**kill_sftp**</br> +Stop and remove the SFTP container + +**kill_ftps**</br> +Stop and remove the FTPS container + +**mr_print <vaiable-name>**</br> +Print a variable value from the MR simulator. + +**dr_print <vaiable-name>**</br> +Print a varialle value from the DR simulator. + +**drr_print <vaiable-name>**</br> +Print a variable value from the DR redir simulator. + +**mr_read <vaiable-name>**</br> +Read a variable value from MR sim and send to stdout + +**dr_read <vaiable-name>**</br> +Read a variable value from DR sim and send to stdout + +**drr_read <vaiable-name>**</br> +Read a variable value from DR redir sim and send to stdout + +**sleep_wait <sleep-time-in-sec>**</br> +Sleep for a number of seconds + +**sleep_heartbeat <sleep-time-in-sec>**</br> +Sleep for a number of seconds and prints dfc heartbeat output every 30 sec + +**mr_equal <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the MR simulator is equal to a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +equal to the targer or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value becomes equal to the target +value or not. + +**mr_greater <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the MR simulator is greater than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +greater the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is greater than the target +value or not. + +**mr_less <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the MR simulator is less than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +less than the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is less than the target +value or not. + +**mr_contain_str <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the MR simulator contains a substring target and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable contains +the target substring or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value contains the target +substring or not. + +**dr_equal <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR simulator is equal to a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +equal to the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value becomes equal to the target +value or not. + +**dr_greater <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR simulator is greater than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +greater the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is greater than the target +value or not. + +**dr_less <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR simulator is less than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +less than the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is less than the target +value or not. + +**drr_equal <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR Redir simulator is equal to a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +equal to the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value becomes equal to the target +value or not. + +**drr_greater <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR Redir simulator is greater than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +greater the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is greater than the target +value or not. + +**drr_less <variable-name> <target-value> [<timeout-in-sec>]**</br> +Tests if a variable value in the DR Redir simulator is less than a target value and and optional timeout. +</br>Arg: ``<variable-name> <target-value>`` - This test set pass or fail depending on if the variable is +less than the target or not. +</br>Arg: ``<variable-name> <target-value> <timeout-in-sec>`` - This test waits up to the timeout seconds +before setting pass or fail depending on if the variable value is less than the target +value or not. + +**dfc_contain_str <variable-name> <substring-in-quotes>**</br> +Test is a variable in the DFC contains a substring. + +**store_logs <log-prefix>**</br> +Store all dfc app and simulators log to the test case log dir. All logs gets a prefix to +separate logs stored at different steps in the test script. +If logs need to be stored in several locations, use different prefix to easily identify the location +when the logs where taken. + +**check_dfc_log**</br> +Check the dfc application log for WARN and ERR messages and print the count. + +**print_result**</br> +Print the test result. Only once at the very end of the script. + +**print_all**</br> +Print all variables from the simulators and the dfc heartbeat. + +In addition, comment in the file can be added using the normal comment sign in bash '#'. +Comments that shall be visible on the screen as well as in the test case log, use ``echo "<msg>"``. + +##Test suite files## +A test suite file contains one or more test cases to run in sequence. +A description of the test case should be given to the TS_ONELINE_DESCR var. The description will be printed in the test result. + +The empty template for a test suite files looks like this: + +(Only the parts noted with ``<`` and ``>`` shall be changed.) + +----------------------------------------------------------- +``` +#!/bin/bash + +TS_ONELINE_DESCR="<test-suite-description" + +. ../common/testsuite_common.sh + +suite_setup + +############# TEST CASES ################# + +run_tc <tc-id or ts-id>.sh $1 $2 +... +... + +########################################## + +suite_complete + + +``` +----------------------------------------------------------- + +The ../common/testsuite_common.sh contains all functions needed for a test suite file. + +The following is a list of the available functions in a test case file. Please see a defined test suite for examples. + +**suite_setup**</br> +Sets up the test suite and print out a heading. + +**run_tc <tc-script> <$1 from test suite script> <$2 from test suite script>**</br> +Execute a test case with arg from test suite script + +**suite_complete**</br> +Print out the overall result of the executed test cases.
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/SingleFileSuite.sh b/test/mocks/datafilecollector-testharness/auto-test/SingleFileSuite.sh new file mode 100755 index 000000000..9e3d59c84 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/SingleFileSuite.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +TS_ONELINE_DESCR="Single file tests suite" + +. ../common/testsuite_common.sh + +suite_setup + +############# TEST CASES ################# + +./FTC1.sh $1 $2 +./FTC2.sh $1 $2 +./FTC3.sh $1 $2 +./FTC4.sh $1 $2 +./FTC5.sh $1 $2 +./FTC6.sh $1 $2 + +########################################## + +suite_complete + diff --git a/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh new file mode 100755 index 000000000..2b76f16e8 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_FTPS_72h.sh @@ -0,0 +1,91 @@ +#!/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." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc2300" +export BC_TC="" +export NUM_FTPFILES="1000" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="FTPS" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +# 24h MR sim execution time since first poll, should be reached withing 72h +1h margion +mr_contain_str exe_time_first_poll 4320: $((60*60*24*3+3600)) +# stop event delivery +mr_print stop +# wait for MR sim values to stabilize +sleep_wait 30 + +# Requirement number of files, 100 new files in first event for each PNF, then 1 new file per PNF in the +# remaining polls up to 24h. This is the minimum number of published files for the test +TARGET_REQUIRMENT_FILE=$((70000+700*95+700*96+700*96)) + +#Calculate targets based on the number of of unique files delivered from MR sim +TARGET_FILES=$(mr_read ctr_unique_files) +TARGET_EVENTS=$((TARGET_FILES/100)) +TARGET_VOLUME=$((TARGET_FILES*1000000)) + +#Maximum number of configured FTP files, if DFC download more than this then the NUM_FTPSFILES need to be increased. +MAX_FILES=$((NUM_FTPFILE*NUM_PNFS)) + +#Wait remaining time upto 15 min for DFC to download all consumed events +sleep_wait 870 + +#At least the requiment number of file shall be published +dr_greater ctr_published_files $TARGET_REQUIRMENT_FILE + +#If greate then MAX_FILES then more FTP files need to be configured +mr_less ctr_ctr_unique_files MAX_FILES + + +#Test that all files from polled events has been downloaded etc + +dr_equal ctr_published_files $TARGET_FILES + +mr_equal ctr_events $TARGET_EVENTS + +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query $TARGET_FILES +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published $TARGET_FILES +dr_equal ctr_publish_req $TARGET_FILES +dr_equal ctr_publish_req_redirect $TARGET_FILES +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files $TARGET_FILES + +drr_equal ctr_publish_requests $TARGET_FILES +drr_equal ctr_publish_responses $TARGET_FILES + +drr_equal dwl_volume $TARGET_VOLUME + +print_all + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_SFTP_72h.sh b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_SFTP_72h.sh new file mode 100755 index 000000000..072135ce3 --- /dev/null +++ b/test/mocks/datafilecollector-testharness/auto-test/Stability1MB_SFTP_72h.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +TC_ONELINE_DESCR="Stabilty over 72hours, 700 PNFs over SFTP. All new files (100) in first event from PNF, then one new 1 new file per event." + +. ../common/testcase_common.sh $1 $2 + +#### TEST BEGIN #### + +clean_containers + +export DR_TC="--tc normal" +export DR_REDIR_TC="--tc normal" +export MR_TC="--tc1300" +export BC_TC="" +export NUM_FTPFILES="1000" +export NUM_PNFS="700" +export FILE_SIZE="1MB" +export FTP_TYPE="SFTP" + +log_sim_settings + +start_simulators + +mr_equal ctr_requests 0 60 +dr_equal ctr_published_files 0 60 + +mr_print tc_info +dr_print tc_info +drr_print tc_info + +start_dfc + +# 24h MR sim execution time since first poll, should be reached withing 72h +1h margion +mr_contain_str exe_time_first_poll 4320: $((60*60*24*3+3600)) +# stop event delivery +mr_print stop +# wait for MR sim values to stabilize +sleep_wait 30 + +# Requirement number of files, 100 new files in first event for each PNF, then 1 new file per PNF in the +# remaining polls up to 24h. This is the minimum number of published files for the test +TARGET_REQUIRMENT_FILE=$((70000+700*95+700*96+700*96)) + +#Calculate targets based on the number of of unique files delivered from MR sim +TARGET_FILES=$(mr_read ctr_unique_files) +TARGET_EVENTS=$((TARGET_FILES/100)) +TARGET_VOLUME=$((TARGET_FILES*1000000)) + +#Maximum number of configured FTP files, if DFC download more than this then the NUM_FTPSFILES need to be increased. +MAX_FILES=$((NUM_FTPFILE*NUM_PNFS)) + +#Wait remaining time upto 15 min for DFC to download all consumed events +sleep_wait 870 + +#At least the requiment number of file shall be published +dr_greater ctr_published_files $TARGET_REQUIRMENT_FILE + +#If greate then MAX_FILES then more FTP files need to be configured +mr_less ctr_ctr_unique_files MAX_FILES + + +#Test that all files from polled events has been downloaded etc + +dr_equal ctr_published_files $TARGET_FILES + +mr_equal ctr_events $TARGET_EVENTS + +mr_equal ctr_unique_PNFs 700 + +dr_equal ctr_publish_query $TARGET_FILES +dr_equal ctr_publish_query_published 0 +dr_equal ctr_publish_query_not_published $TARGET_FILES +dr_equal ctr_publish_req $TARGET_FILES +dr_equal ctr_publish_req_redirect $TARGET_FILES +dr_equal ctr_publish_req_published 0 +dr_equal ctr_published_files $TARGET_FILES + +drr_equal ctr_publish_requests $TARGET_FILES +drr_equal ctr_publish_responses $TARGET_FILES + +drr_equal dwl_volume $TARGET_VOLUME + +print_all + +check_dfc_log + +#### TEST COMPLETE #### + +store_logs END + +print_result
\ No newline at end of file |