diff options
8 files changed, 28 insertions, 70 deletions
diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh index e85c0eea..2dc7e945 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh @@ -22,6 +22,9 @@ else echo "Using SIM_ROOT from environmental variable: " $SIM_ROOT fi +#Prepare DFC config volume +mkdir $SIM_ROOT/simulator-group/dfc_config_volume || true + #Location of the above simulators when run as a group. For start+config and stop. SIMGROUP_ROOT=$SIM_ROOT/simulator-group diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh index 81d85fe5..c05f3561 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh @@ -5,6 +5,8 @@ running_images=$(docker images -q) docker exec dfc_app0 cat /var/log/ONAP/application.log >> $WORKSPACE/archives/dfc_app0_application.log docker logs dfc_mr-sim >> $WORKSPACE/archives/dfc_mr-sim.log +rm -rf $SIM_ROOT/simulator-group/dfc_config_volume || true + if [ -z "$running_containers" ] then echo "No container requires termination" diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml index 2ea2882b..14bfad0c 100644 --- a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml +++ b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml @@ -17,6 +17,7 @@ services: dfcnet: null volumes: - $SIMGROUP_ROOT/tls/:/opt/app/datafile/etc/cert/ + - $SIMGROUP_ROOT/dfc_config_volume:/app-config environment: CONSUL_HOST: "consul-server" CONSUL_PORT: 8500 diff --git a/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot b/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot index c425fe2a..b8728068 100644 --- a/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot +++ b/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot @@ -13,6 +13,7 @@ ${CLI_DRSIM_CTR_QUERY_NOT_PUBLISHED} curl --connect-timeout 10 -X GET htt ${CLI_DRSIM_CTR_PUBLISHED_FILES} curl --connect-timeout 10 -X GET http://${SIM_IP}:3906/ctr_published_files ${CLI_DR_REDIR_SIM_DOWNLOADED_VOLUME} curl --connect-timeout 10 -X GET http://${SIM_IP}:3908/dwl_volume +${DFC_CONFIG_VOLUME_FILE} ${SIMGROUP_ROOT}/dfc_config_volume/application_config.yaml *** Keywords *** MR Sim Emitted Files Equal @@ -45,6 +46,13 @@ Start DFC Log To Console Dfc-start: Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} +Set DFC config + [Documentation] Set DFC configuration + [Arguments] ${dfc_config_file} + Copy File ${dfc_config_file} ${DFC_CONFIG_VOLUME_FILE} + ${dfc_config_file_content}= Get File ${DFC_CONFIG_VOLUME_FILE} + Log To Console APP configuration: + Log To Console ${dfc_config_file_content} Test Teardown [Documentation] Cleanup containers diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot index bb70b502..35bacd98 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot @@ -6,9 +6,7 @@ Library Process Resource ../../resources/common-keywords.robot *** Variables *** -${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS.json -${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw -${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 +${DFC_CONFIG_FILE} ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_MEAS.yaml *** Test Cases *** @@ -64,19 +62,7 @@ Verify Single Event From Event Poll To Published File MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 + Set DFC config ${DFC_CONFIG_FILE} Start DFC diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot index f96c2f96..26dcef4b 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot @@ -6,9 +6,7 @@ Library Process Resource ../../resources/common-keywords.robot *** Variables *** -${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_HTTPS.json -${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw -${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 +${DFC_CONFIG_FILE} ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_HTTPS.yaml *** Test Cases *** @@ -67,19 +65,7 @@ Verify Single Event From Event Poll To Published File MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 + Set DFC config ${DFC_CONFIG_FILE} Start DFC diff --git a/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot index 9e69e536..d30e7361 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot @@ -6,9 +6,7 @@ Library Process Resource ../../resources/common-keywords.robot *** Variables *** -${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_HTTPS.json -${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw -${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 +${DFC_CONFIG_FILE} ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_HTTPS.yaml *** Test Cases *** @@ -61,19 +59,7 @@ Verify Single Event From Event Poll To Published File MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 + Set DFC config ${DFC_CONFIG_FILE} Start DFC diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot index 61f689d1..e7a55853 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot @@ -8,10 +8,8 @@ Resource ../../resources/common-keywords.robot Test Teardown *** Variables *** -${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS.json -${CONSUL_UPL_APP_INSECURE_SFTP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS_no_strict_host_key_checking.json -${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw -${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 +${DFC_CONFIG_FILE} ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_MEAS.yaml +${DFC_CONFIG_FILE_INSECURE_SFTP} ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_MEAS_no_strict_host_key_checking.yaml *** Test Cases *** @@ -20,7 +18,7 @@ ${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/serv Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file [TAGS] DFC_STRICT_HOST_KEY_CHECKING_1 [Documentation] Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file. - [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} all_hosts_keys + [Setup] Setup Strict Host Key Checking Test ${DFC_CONFIG_FILE} all_hosts_keys Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files @@ -32,7 +30,7 @@ Verify single event with SFTP file, when host known and strict host key checking Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file [TAGS] DFC_STRICT_HOST_KEY_CHECKING_2 [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file. - [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP_INSECURE_SFTP} known_hosts_empty + [Setup] Setup Strict Host Key Checking Test ${DFC_CONFIG_FILE_INSECURE_SFTP} known_hosts_empty Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files @@ -44,7 +42,7 @@ Verify single event with SFTP file, when host unknown and strict host key checki Verify single event with SFTP file, when no known hosts file and strict host key checking enabled. From event poll to published file [TAGS] DFC_STRICT_HOST_KEY_CHECKING_3 [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. - [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} no_known_hosts_file + [Setup] Setup Strict Host Key Checking Test ${DFC_CONFIG_FILE} no_known_hosts_file Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files @@ -58,7 +56,7 @@ Verify single event with SFTP file, when no known hosts file and strict host key Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published [TAGS] DFC_STRICT_HOST_KEY_CHECKING_4 [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. - [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} known_hosts_empty + [Setup] Setup Strict Host Key Checking Test ${DFC_CONFIG_FILE} known_hosts_empty Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files Sleep 60 @@ -69,7 +67,7 @@ Verify single event with SFTP file, when host unknown and strict host key checki Setup Strict Host Key Checking Test [Documentation] Sets up strict host key checking test with single 1MB file - [Arguments] ${consul_config_request} ${known_hosts_file} + [Arguments] ${dfc_config_path} ${known_hosts_file} Set Environment Variable MR_TC --tc100 Set Environment Variable DR_TC --tc normal Set Environment Variable DR_REDIR_TC --tc normal @@ -102,19 +100,7 @@ Setup Strict Host Key Checking Test MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${consul_config_request} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 + Set DFC config ${dfc_config_path} ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:KNOWN_HOSTS=${known_hosts_file} env:SIMGROUP_ROOT=${SIMGROUP_ROOT} Log To Console Dfc-start: |