c8d09c2bcb1e5721bd2ebc20949e31d52c4a8eed
[integration/csit.git] / tests / dcaegen2-collectors-datafile / testsuites / HTTPS-Various-Connection-Types-suite / HttpsVariousConnectionTypes.robot
1 *** Settings ***
2 Library        OperatingSystem
3 Library        RequestsLibrary
4 Library        Process
5
6 Resource    ../../resources/common-keywords.robot
7
8 *** Variables ***
9 ${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
10 ${CONSUL_GET_APP}                   /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw
11 ${CBS_GET_MERGED_CONFIG}            /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0
12
13 *** Test Cases ***
14
15 ######## Single file, HTTPS with various connections
16 Verify single event with single 1MB file with HTTPS connection (basic authentication). From event poll to published file
17     [TAGS]                         DFC_FUNCTIONAL_40
18     [Documentation]                Verify single event with single HTTPS (basic authentication) 1MB file from event poll to published file.
19     ${cli_cmd_output}=              Run Process             ${DFC_ROOT}/../dfc-containers-clean.sh           stderr=STDOUT
20     Verify Single Event From Event Poll To Published File   1    --tc400    HTTPS
21
22
23 Verify single event with single 1MB file HTTPS connection (client certificate authentication). From event poll to published file
24     [TAGS]                         DFC_FUNCTIONAL_41
25     [Documentation]                Verify single event with single HTTPS (basic authentication) 5MB file from event poll to published file.
26     Verify Single Event From Event Poll To Published File   1    --tc403    HTTPS
27
28
29 Verify single event with single 1MB file HTTPS (no authentication). From event poll to published file
30     [TAGS]                         DFC_FUNCTIONAL_42
31     [Documentation]                Verify single event with single HTTPS (basic authentication) 50MB file from event poll to published file.
32     Verify Single Event From Event Poll To Published File   1   --tc404    HTTPS
33
34
35
36 *** Keywords ***
37 Verify Single Event From Event Poll To Published File
38     [Documentation]                 Keyword to verify single event with file with given parameters.
39     [Arguments]                     ${file_size_in_mb}    ${mr_tc}    ${http_type}
40     Set Environment Variable        MR_TC                   ${mr_tc}
41     Set Environment Variable        FILE_SIZE               ${file_size_in_mb}MB
42     Set Environment Variable        HTTP_TYPE                ${http_type}
43     Set Default Environment Variables
44
45     ${cli_cmd_output}=              Run Process     ./simulators-start.sh    cwd=${SIMGROUP_ROOT}
46     Log To Console                  Simulator-start:
47     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
48     MR Sim Emitted Files Equal      0                                                                                   #Verify 0 file emitted from MR sim
49     DR Sim Published Files Equal    0                                                                                   #Verify 0 file published to DR sim
50
51     ${cli_cmd_output}=              Run Process                     ${CONSUL_UPL_APP}           shell=yes
52     Log To Console                  Consul APP write:
53     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
54
55     ${cli_cmd_output}=              Run Process                     ${CONSUL_GET_APP}           shell=yes
56     Log To Console                  Consul APP read:
57     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
58
59     ${cli_cmd_output}=              Run Process                     ${CBS_GET_MERGED_CONFIG}    shell=yes
60     Log To Console                  CBS merged configuration:
61     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
62
63     Sleep                           10
64
65     Start DFC
66
67     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
68     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
69     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Published Files Equal        1                       #Verify 1 file published to DR sim
70     DR Redir Sim Downloaded Volume Equal          ${file_size_in_mb} 000 000                                            #Verify correct number of bytes published file data in DR redir sim
71
72     [Teardown]                      Test Teardown
73
74 Set Default Environment Variables
75     [Documentation]                 Set default environment variables for simulators setup
76     Set Environment Variable        DR_TC                   --tc normal
77     Set Environment Variable        DR_REDIR_TC             --tc normal
78     Set Environment Variable        MR_GROUPS               OpenDcae-c12:PM_MEAS_FILES
79     Set Environment Variable        MR_FILE_PREFIX_MAPPING  PM_MEAS_FILES:A
80     Set Environment Variable        DR_REDIR_FEEDS          2:A
81     Set Environment Variable        FTP_FILE_PREFIXES       A
82     Set Environment Variable        FTP_TYPE                SFTP
83     Set Environment Variable        HTTP_FILE_PREFIXES      A
84     Set Environment Variable        NUM_FTPFILES            1
85     Set Environment Variable        NUM_HTTPFILES           1
86     Set Environment Variable        NUM_PNFS                1
87     Set Environment Variable        NUM_FTP_SERVERS         1
88     Set Environment Variable        NUM_HTTP_SERVERS        1
89     Set Environment Variable        DR_FEEDS                2:A
90     Set Environment Variable        DR_REDIR_SIM            drsim_redir
91     Set Environment Variable        SFTP_SIMS               sftp-server0:22
92     Set Environment Variable        FTPES_SIMS              ftpes-server-vsftpd0:21
93     Set Environment Variable        HTTP_SIMS               http-https-server0:80
94     Set Environment Variable        HTTPS_SIMS              http-https-server0:443
95     Set Environment Variable        HTTPS_SIMS_NO_AUTH      http-https-server0:8080