Update DFC tests to use file based conifg
[integration/csit.git] / tests / dcaegen2-collectors-datafile / testsuites / Strict-Host-Checking-suite / StrictHostChecking.robot
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 ${DFC_CONFIG_FILE}                         ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_MEAS.yaml
12 ${DFC_CONFIG_FILE_INSECURE_SFTP}           ${SIMGROUP_ROOT}/dfc_configs/c12_feed2_PM_MEAS_no_strict_host_key_checking.yaml
13
14 *** Test Cases ***
15
16 ######### Single file, SFTP, various SFTP Strict host key checking settings
17
18 Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file
19     [TAGS]                          DFC_STRICT_HOST_KEY_CHECKING_1
20     [Documentation]                 Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file.
21     [Setup]  Setup Strict Host Key Checking Test  ${DFC_CONFIG_FILE}  all_hosts_keys
22
23     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
24     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
25     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Published Files Equal        1                       #Verify 1 file published to DR sim
26     DR Redir Sim Downloaded Volume Equal          1 000 000                                                             #Verify 1 000 000 bytes published file data in DR redir sim
27
28     [Teardown]                      Test Teardown
29
30 Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file
31     [TAGS]                          DFC_STRICT_HOST_KEY_CHECKING_2
32     [Documentation]                 Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file.
33     [Setup]  Setup Strict Host Key Checking Test  ${DFC_CONFIG_FILE_INSECURE_SFTP}  known_hosts_empty
34
35     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
36     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
37     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Published Files Equal        1                       #Verify 1 file published to DR sim
38     DR Redir Sim Downloaded Volume Equal          1 000 000                                                             #Verify 1 000 000 bytes published file data in DR redir sim
39
40     [Teardown]                      Test Teardown
41
42 Verify single event with SFTP file, when no known hosts file and strict host key checking enabled. From event poll to published file
43     [TAGS]                          DFC_STRICT_HOST_KEY_CHECKING_3
44     [Documentation]                 Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published.
45     [Setup]  Setup Strict Host Key Checking Test  ${DFC_CONFIG_FILE}  no_known_hosts_file
46
47     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
48     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
49     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Published Files Equal        1                       #Verify 1 file published to DR sim
50     DR Redir Sim Downloaded Volume Equal          1 000 000                                                             #Verify 1 000 000 bytes published file data in DR redir sim
51
52     [Teardown]                      Test Teardown
53
54
55
56 Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published
57     [TAGS]                          DFC_STRICT_HOST_KEY_CHECKING_4
58     [Documentation]                 Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published.
59     [Setup]  Setup Strict Host Key Checking Test  ${DFC_CONFIG_FILE}  known_hosts_empty
60     Wait Until Keyword Succeeds     1 minute      10 sec    MR Sim Emitted Files Equal          1                       #Verify 1 file emitted from MR sim
61     Wait Until Keyword Succeeds     1 minute      10 sec    DR Sim Query Not Published Equal    1                       #Verify 1 query response for not published files
62     Sleep                           60
63     DR Sim Published Files Equal    0                                                                                   #Verify no file was published to DR sim
64     [Teardown]                      Test Teardown
65
66 *** Keywords ***
67
68 Setup Strict Host Key Checking Test
69     [Documentation]                 Sets up strict host key checking test with single 1MB file
70     [Arguments]                     ${dfc_config_path}  ${known_hosts_file}
71     Set Environment Variable        MR_TC                   --tc100
72     Set Environment Variable        DR_TC                   --tc normal
73     Set Environment Variable        DR_REDIR_TC             --tc normal
74     Set Environment Variable        MR_GROUPS               OpenDcae-c12:PM_MEAS_FILES
75     Set Environment Variable        MR_FILE_PREFIX_MAPPING  PM_MEAS_FILES:A
76     Set Environment Variable        DR_REDIR_FEEDS          2:A
77     Set Environment Variable        FTP_FILE_PREFIXES       A
78     Set Environment Variable        HTTP_FILE_PREFIXES      A
79     Set Environment Variable        NUM_FTPFILES            1
80     Set Environment Variable        NUM_HTTPFILES           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        HTTP_TYPE               HTTP
85     Set Environment Variable        NUM_FTP_SERVERS         1
86     Set Environment Variable        NUM_HTTP_SERVERS        1
87     Set Environment Variable        DR_FEEDS                2:A
88     Set Environment Variable        DR_REDIR_SIM            drsim_redir
89     Set Environment Variable        SFTP_SIMS               sftp-server0:22
90     Set Environment Variable        FTPES_SIMS              ftpes-server-vsftpd0:21
91     Set Environment Variable        HTTP_SIMS               http-https-server0:80
92     Set Environment Variable        HTTPS_SIMS              http-https-server0:443
93     Set Environment Variable        HTTPS_SIMS_NO_AUTH      http-https-server0:8080
94     Set Environment Variable        HTTP_JWT_SIMS           http-https-server0:32000
95     Set Environment Variable        HTTPS_JWT_SIMS          http-https-server0:32100
96
97     ${cli_cmd_output}=              Run Process     ./simulators-start.sh    cwd=${SIMGROUP_ROOT}
98     Log To Console                  Simulator-start:
99     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
100     MR Sim Emitted Files Equal      0                                                                                   #Verify 0 file emitted from MR sim
101     DR Sim Published Files Equal    0                                                                                   #Verify 0 file published to DR sim
102
103     Set DFC config                  ${dfc_config_path}
104
105     ${cli_cmd_output}=              Run Process                    ${DFC_ROOT}/dfc-start.sh    cwd=${DFC_ROOT}    env:KNOWN_HOSTS=${known_hosts_file}    env:SIMGROUP_ROOT=${SIMGROUP_ROOT}
106     Log To Console                  Dfc-start:
107     Log To Console                  ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}