9e69e5360297107467c04c1dfd93e7eb37a74c9d
[integration/csit.git] / tests / dcaegen2-collectors-datafile / testsuites / HTTP-Various-Connection-Types-suite / HttpVariousConnectionTypes.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 1MB file HTTPS connection (client certificate authentication). 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 1MB file HTTPS (no authentication). From event poll to published file
32     Verify Single Event From Event Poll To Published File   1   --tc404    HTTPS
33
34
35 Verify single event with single 1MB file with HTTP JWT. From event poll to published file
36     [TAGS]                         DFC_FUNCTIONAL_43
37     [Documentation]                Verify single event with single 1MB file with HTTP JWT. From event poll to published file
38     ${cli_cmd_output}=              Run Process             ${DFC_ROOT}/../dfc-containers-clean.sh           stderr=STDOUT
39     Verify Single Event From Event Poll To Published File   1    --tc303    HTTP
40
41
42 Verify single event with single 1MB file with HTTPS JWT. From event poll to published file
43     [TAGS]                         DFC_FUNCTIONAL_44
44     [Documentation]                Verify single event with single 1MB file with HTTPS JWT. From event poll to published file
45     ${cli_cmd_output}=              Run Process             ${DFC_ROOT}/../dfc-containers-clean.sh           stderr=STDOUT
46     Verify Single Event From Event Poll To Published File   1    --tc405    HTTPS
47
48
49 *** Keywords ***
50 Verify Single Event From Event Poll To Published File
51     [Documentation]                 Keyword to verify single event with file with given parameters.
52     [Arguments]                     ${file_size_in_mb}    ${mr_tc}    ${http_type}
53     Set Environment Variable        MR_TC                   ${mr_tc}
54     Set Environment Variable        FILE_SIZE               ${file_size_in_mb}MB
55     Set Environment Variable        HTTP_TYPE                ${http_type}
56     Set Default Environment Variables
57
58     ${cli_cmd_output}=              Run Process     ./simulators-start.sh    cwd=${SIMGROUP_ROOT}
59     Log To Console                  Simulator-start:
60     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
61     MR Sim Emitted Files Equal      0                                                                                   #Verify 0 file emitted from MR sim
62     DR Sim Published Files Equal    0                                                                                   #Verify 0 file published to DR sim
63
64     ${cli_cmd_output}=              Run Process                     ${CONSUL_UPL_APP}           shell=yes
65     Log To Console                  Consul APP write:
66     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
67
68     ${cli_cmd_output}=              Run Process                     ${CONSUL_GET_APP}           shell=yes
69     Log To Console                  Consul APP read:
70     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
71
72     ${cli_cmd_output}=              Run Process                     ${CBS_GET_MERGED_CONFIG}    shell=yes
73     Log To Console                  CBS merged configuration:
74     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
75
76     Sleep                           10
77
78     Start DFC
79
80     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
81     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
82     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Published Files Equal        1                       #Verify 1 file published to DR sim
83     DR Redir Sim Downloaded Volume Equal          ${file_size_in_mb} 000 000                                            #Verify correct number of bytes published file data in DR redir sim
84
85     [Teardown]                      Test Teardown
86
87 Set Default Environment Variables
88     [Documentation]                 Set default environment variables for simulators setup
89     Set Environment Variable        DR_TC                   --tc normal
90     Set Environment Variable        DR_REDIR_TC             --tc normal
91     Set Environment Variable        MR_GROUPS               OpenDcae-c12:PM_MEAS_FILES
92     Set Environment Variable        MR_FILE_PREFIX_MAPPING  PM_MEAS_FILES:A
93     Set Environment Variable        DR_REDIR_FEEDS          2:A
94     Set Environment Variable        FTP_FILE_PREFIXES       A
95     Set Environment Variable        FTP_TYPE                SFTP
96     Set Environment Variable        HTTP_FILE_PREFIXES      A
97     Set Environment Variable        NUM_FTPFILES            1
98     Set Environment Variable        NUM_HTTPFILES           1
99     Set Environment Variable        NUM_PNFS                1
100     Set Environment Variable        NUM_FTP_SERVERS         1
101     Set Environment Variable        NUM_HTTP_SERVERS        1
102     Set Environment Variable        DR_FEEDS                2:A
103     Set Environment Variable        DR_REDIR_SIM            drsim_redir
104     Set Environment Variable        SFTP_SIMS               sftp-server0:22
105     Set Environment Variable        FTPES_SIMS              ftpes-server-vsftpd0:21
106     Set Environment Variable        HTTP_SIMS               http-https-server0:80
107     Set Environment Variable        HTTPS_SIMS              http-https-server0:443
108     Set Environment Variable        HTTPS_SIMS_NO_AUTH      http-https-server0:8080
109     Set Environment Variable        HTTP_JWT_SIMS           http-https-server0:32000
110     Set Environment Variable        HTTPS_JWT_SIMS          http-https-server0:32100