Remigiusz Janeczek | 9055367 | 2020-07-14 10:08:01 +0200 | [diff] [blame^] | 1 | *** Settings *** |
| 2 | Library OperatingSystem |
| 3 | Library RequestsLibrary |
| 4 | Library Process |
| 5 | |
| 6 | Resource ../../resources/common-keywords.robot |
| 7 | |
| 8 | Test Teardown |
| 9 | |
| 10 | *** Variables *** |
| 11 | ${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 |
| 12 | ${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 |
| 13 | ${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw |
| 14 | ${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | |
| 18 | ######### Single file, SFTP, various SFTP Strict host key checking settings |
| 19 | |
| 20 | Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file |
| 21 | [TAGS] DFC_STRICT_HOST_KEY_CHECKING_1 |
| 22 | [Documentation] Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file. |
| 23 | [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} all_hosts_keys |
| 24 | |
| 25 | Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim |
| 26 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files |
| 27 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim |
| 28 | DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim |
| 29 | |
| 30 | [Teardown] Test Teardown |
| 31 | |
| 32 | Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file |
| 33 | [TAGS] DFC_STRICT_HOST_KEY_CHECKING_2 |
| 34 | [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file. |
| 35 | [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP_INSECURE_SFTP} known_hosts_empty |
| 36 | |
| 37 | Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim |
| 38 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files |
| 39 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim |
| 40 | DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim |
| 41 | |
| 42 | [Teardown] Test Teardown |
| 43 | |
| 44 | Verify single event with SFTP file, when no known hosts file and strict host key checking enabled. From event poll to published file |
| 45 | [TAGS] DFC_STRICT_HOST_KEY_CHECKING_3 |
| 46 | [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. |
| 47 | [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} no_known_hosts_file |
| 48 | |
| 49 | Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim |
| 50 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files |
| 51 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim |
| 52 | DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim |
| 53 | |
| 54 | [Teardown] Test Teardown |
| 55 | |
| 56 | |
| 57 | |
| 58 | Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published |
| 59 | [TAGS] DFC_STRICT_HOST_KEY_CHECKING_4 |
| 60 | [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. |
| 61 | [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} known_hosts_empty |
| 62 | Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim |
| 63 | Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files |
| 64 | Sleep 60 |
| 65 | DR Sim Published Files Equal 0 #Verify no file was published to DR sim |
| 66 | [Teardown] Test Teardown |
| 67 | |
| 68 | *** Keywords *** |
| 69 | |
| 70 | Setup Strict Host Key Checking Test |
| 71 | [Documentation] Sets up strict host key checking test with single 1MB file |
| 72 | [Arguments] ${consul_config_request} ${known_hosts_file} |
| 73 | Set Environment Variable MR_TC --tc100 |
| 74 | Set Environment Variable DR_TC --tc normal |
| 75 | Set Environment Variable DR_REDIR_TC --tc normal |
| 76 | Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES |
| 77 | Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A |
| 78 | Set Environment Variable DR_REDIR_FEEDS 2:A |
| 79 | Set Environment Variable FTP_FILE_PREFIXES A |
| 80 | Set Environment Variable NUM_FTPFILES 1 |
| 81 | Set Environment Variable NUM_PNFS 1 |
| 82 | Set Environment Variable FILE_SIZE 1MB |
| 83 | Set Environment Variable FTP_TYPE SFTP |
| 84 | Set Environment Variable NUM_FTP_SERVERS 1 |
| 85 | Set Environment Variable DR_FEEDS 2:A |
| 86 | Set Environment Variable DR_REDIR_SIM drsim_redir |
| 87 | Set Environment Variable SFTP_SIMS sftp-server0:22 |
| 88 | Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 |
| 89 | |
| 90 | ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} |
| 91 | Log To Console Simulator-start: |
| 92 | Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} |
| 93 | MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim |
| 94 | DR Sim Published Files Equal 0 #Verify 0 file published to DR sim |
| 95 | |
| 96 | ${cli_cmd_output}= Run Process ${consul_config_request} shell=yes |
| 97 | Log To Console Consul APP write: |
| 98 | Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} |
| 99 | |
| 100 | ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes |
| 101 | Log To Console Consul APP read: |
| 102 | Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} |
| 103 | |
| 104 | ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes |
| 105 | Log To Console CBS merged configuration: |
| 106 | Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} |
| 107 | |
| 108 | Sleep 10 |
| 109 | |
| 110 | ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:KNOWN_HOSTS=${known_hosts_file} |
| 111 | Log To Console Dfc-start: |
| 112 | Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} |