From 532cd635c7ad5561657b2a64d423aad611969b66 Mon Sep 17 00:00:00 2001 From: Piotr Marcinkiewicz Date: Fri, 3 Sep 2021 15:07:42 +0200 Subject: Update DFC tests to use file based conifg To remove Consul/CBS dependency in DCAE DFC was updated to use file based configuration CSIT updates: - file based config use in DFC - removal of Consul/CBS from DFC tests Issue-ID: DCAEGEN2-2692 Signed-off-by: Piotr Marcinkiewicz Change-Id: I9d84559f3650fc8554c317ae8eab09c76662de09 --- .../resources/common-keywords.robot | 8 ++++++ .../FuncSingleFileFtp.robot | 18 ++----------- .../FuncSingleFileHttp.robot | 18 ++----------- .../HttpVariousConnectionTypes.robot | 18 ++----------- .../StrictHostChecking.robot | 30 ++++++---------------- 5 files changed, 22 insertions(+), 70 deletions(-) (limited to 'tests/dcaegen2-collectors-datafile') 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: -- cgit 1.2.3-korg