Adjust relative paths for CSIT files
[integration/csit.git] / tests / dcaegen2-collectors-hv-ves / testcases / authorization.robot
1 *** Settings ***
2 Library       DcaeAppSimulatorLibrary
3
4 Resource      resources/common-keywords.robot
5
6 Suite Setup       Client Authorization Suite Setup
7 Suite Teardown    VES-HV Collector Suite Teardown
8 Test Teardown     VES-HV Collector Test Shutdown
9
10 *** Keywords ***
11 Client Authorization Suite Setup
12     Log   Started Suite: VES-HV Client Authorization
13     ${XNF_PORTS_LIST}=    Create List    7000
14     ${XNF_WITH_INVALID_CERTIFICATES}=   Configure xNF Simulators    ${XNF_PORTS_LIST}
15     ...                                               should_use_valid_certs=${false}
16     Set Suite Variable   ${XNF_WITH_INVALID_CERTIFICATES}
17     ${XNF_PORTS_LIST}=    Create List    7001
18     ${XNF_WITHOUT_SSL}=   Configure xNF Simulators    ${XNF_PORTS_LIST}
19     ...                                               should_disable_ssl=${true}
20     Set Suite Variable   ${XNF_WITHOUT_SSL}
21     ${XNF_PORTS_LIST}=    Create List    7002
22     ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES}=   Configure xNF Simulators    ${XNF_PORTS_LIST}
23     ...                                                                                should_disable_ssl=${true}
24     ...                                                                                should_connect_to_unencrypted_hv_ves=${true}
25     Set Suite Variable   ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES}
26     Log   Suite setup finished
27
28 *** Test Cases ***
29 Authorization
30     [Documentation]   VES-HV Collector should not authorize XNF with invalid certificate and not route any message
31     ...               to topics
32
33     Send Messages From xNF Simulators   ${XNF_WITH_INVALID_CERTIFICATES}   ${XNF_VALID_MESSAGES_REQUEST}
34
35     Wait until keyword succeeds   60 sec   5 sec
36     ...     Assert Dcae App Consumed   ${DCAE_APP_API_MESSAGES_COUNT_URL}   ${AMOUNT_0}
37
38 Unencrypted connection from client
39     [Documentation]   VES-HV Collector should not authorize XNF trying to connect through unencrypted connection
40
41     Send Messages From xNF Simulators   ${XNF_WITHOUT_SSL}   ${XNF_VALID_MESSAGES_REQUEST}
42
43     Wait until keyword succeeds   60 sec   5 sec
44     ...     Assert Dcae App Consumed   ${DCAE_APP_API_MESSAGES_COUNT_URL}   ${AMOUNT_0}
45
46 Unencrypted connection on both ends
47     [Documentation]   When run without SSL turned on, VES-HV Collector should route all valid messages
48     ...               from xNF trying to connect through unencrypted connection
49
50     Send Messages From xNF Simulators   ${XNF_WITHOUT_SSL_CONNECTING_TO_UNENCRYPTED_HV_VES}   ${XNF_VALID_MESSAGES_REQUEST}
51
52     Wait until keyword succeeds   60 sec   5 sec
53     ...     Assert Dcae App Consumed   ${DCAE_APP_API_MESSAGES_COUNT_URL}   ${AMOUNT_5000}
54
55
56 *** Variables ***
57 ${VES_HV_SCENARIOS}                            %{WORKSPACE}/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios
58
59 ${XNF_VALID_MESSAGES_REQUEST}                  ${VES_HV_SCENARIOS}/authorization/xnf-valid-messages-request.json
60
61 ${AMOUNT_0}                                    0
62 ${AMOUNT_5000}                                 5000