Release image version 1.12.2
[testsuite.git] / robot / testsuites / cmpv2.robot
1 *** Settings ***
2 Documentation     CMPv2 Usecase functionality
3 Test Timeout      15m
4 Library           RequestsLibrary
5 Library           OperatingSystem
6 Library           Collections
7 Library           String
8 Library           JSONLibrary
9 Library           ONAPLibrary.JSON
10 Library           ONAPLibrary.Utilities
11 Library           ONAPLibrary.Templating    WITH NAME    Templating
12 Resource          ../resources/global_properties.robot
13 Resource          ../resources/test_templates/cmpv2.robot
14 Suite Setup       Suite setup  ${initial entry}
15 Suite Teardown    Usecase Teardown
16
17 *** Variables ***
18 ${MONGO_BLUEPRINT_PATH}                  ${EXECDIR}/robot/assets/cmpv2/k8s-mongo-ves-client.yaml
19 ${PNF_SIMULATOR_BLUEPRINT_PATH}          ${EXECDIR}/robot/assets/cmpv2/k8s-ves-client.yaml
20 ${VES_INPUTS}                            deployment/VesTlsCmpv2Inputs.jinja
21 ${pnf_ves_integration_request}           ves/pnf_registration_request.jinja
22 ${NEXUS3}                                ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
23 &{initial entry}                         correlation_id=dummy    PNF_IPv4_address=11.11.11.1    PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab
24
25 *** Test Cases ***
26
27 Send registration request to CMPv2 VES
28     [Documentation]
29     ...  This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector
30     ...  with enabled CMPv2 (both CMPv2 and AAF certificates are present).
31     ...  Test expects successful registration
32      [Tags]                                      CMPv2
33      ${pnf_correlation_id}=                     Generate Random String              20                                      [LETTERS][NUMBERS]
34      ${PNF_entry_dict}=                         Create Dictionary                   correlation_id=${pnf_correlation_id}    PNF_IPv4_address=13.13.13.13    PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab
35      Wait Until Keyword Succeeds                10x                                 5s                                      Check VES_PNFREG_OUTPUT topic presence in MR
36      Create PNF initial entry in A&AI           ${PNF_entry_dict}
37      Templating.Create Environment              ves                                 ${GLOBAL_TEMPLATE_FOLDER}
38      ${template}=                               Templating.Apply Template           ves                                     ${pnf_ves_integration_request}   ${PNF_entry_dict}
39      VES Client send single VES event           ${template}                         dcae-ves-collector-cmpv2-cert           8443                             ves-client-cmpv2              5000
40      Verify PNF Integration Request in A&AI     ${PNF_entry_dict}
41
42 Send registration request to CMPv2 VES with wrong SAN-s
43     [Documentation]
44     ...  This test case triggers registration request from VES Client (where is present only CMPv2 certificate)  to VES collector
45     ...  ith enabled CMPv2 (both CMPv2 and AAF certificates are present). CMPv2 certificate has wrong SANs.
46     [Tags]                                     CMPv2
47     ${pnf_correlation_id}=                      Generate Random String              20                                      [LETTERS][NUMBERS]
48     ${PNF_entry_dict}=                         Create Dictionary                   correlation_id=${pnf_correlation_id}    PNF_IPv4_address=14.14.14.14    PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab
49     Templating.Create Environment              ves                                 ${GLOBAL_TEMPLATE_FOLDER}
50     ${template}=                               Templating.Apply Template           ves                                     ${pnf_ves_integration_request}   ${PNF_entry_dict}
51     ${resp}=                                   VES Client send single VES event        ${template}                         dcae-ves-collector-cmpv2-cert-wrong-sans      8443                             ves-client-cmpv2              5000     421
52     Should Contain                             ${resp.json().get('message')}                               wrong-sans
53
54 Send registration request to VES without CMPv2 certificate
55     [Documentation]
56     ...  This test case triggers registration request from VES Client (where is present only CMPv2 certificate)  to VES collector
57     ...  with disabled CMPv2 (only AAF certificate is present - VES collector deployed during whole ONAP deploy).
58     [Tags]                                     CMPv2
59     Uninstall helm charts                       ${ONAP_HELM_RELEASE}-ves-client
60     Install VES Client                         wrongCert
61     ${pnf_correlation_id}=                      Generate Random String              20                                      [LETTERS][NUMBERS]
62     ${PNF_entry_dict}=                         Create Dictionary                   correlation_id=${pnf_correlation_id}    PNF_IPv4_address=14.14.14.14    PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab
63     Templating.Create Environment              ves                                 ${GLOBAL_TEMPLATE_FOLDER}
64     ${template}=                               Templating.Apply Template           ves                                     ${pnf_ves_integration_request}   ${PNF_entry_dict}
65     ${resp}=                                   VES Client send single VES event        ${template}                         dcae-ves-collector           8443                             ves-client-cmpv2              5000     421
66     Should Contain                              ${resp.json().get('message')}                               certificate_unknown
67