blob: 3a4ae506a61d7837ade063b4c93f76bb935483dc [file] [log] [blame]
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +02001*** Settings ***
2Documentation CMPv2 Usecase functionality
3Test Timeout 15m
4Library RequestsLibrary
5Library OperatingSystem
6Library Collections
7Library String
8Library JSONLibrary
9Library ONAPLibrary.JSON
10Library ONAPLibrary.Utilities
11Library ONAPLibrary.Templating WITH NAME Templating
12Resource ../resources/dcae/deployment.robot
13Resource ../resources/dcae/inventory.robot
14Resource ../resources/global_properties.robot
15Resource ../resources/test_templates/cmpv2.robot
16Resource ../resources/test_templates/pnf_registration_without_SO_template.robot
17Suite Setup Send VES integration request ${initial entry}
18Suite Teardown Usecase Teardown
19
20*** Variables ***
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020021${MONGO_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-mongo-ves-client.yaml
22${PNF_SIMULATOR_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-ves-client.yaml
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020023${VES_INPUTS} deployment/VesTlsCmpv2Inputs.jinja
24${pnf_ves_integration_request} ves/pnf_registration_request.jinja
25${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +020026&{initial entry} correlation_id=dummy PNF_IPv4_address=11.11.11.1 PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +020027
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020028
29*** Test Cases ***
30
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020031Deploying VES Client
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020032 [Documentation]
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020033 ... This test case deploys VES Client with "enable_tls": set to false and "external_cert_use_external_tls" (CMPv2) set to true as DCAE applictaion
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020034 [Tags] CMPv2
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020035 ${rand} Generate Random String 5 [NUMBERS][LOWER]
36 Set Suite Variable ${ves_client_hostname} ves-client-${rand}
37 ${serviceTypeIdMongo} Load Blueprint To Inventory ${MONGO_BLUEPRINT_PATH} mongo-${rand}
38 ${serviceTypeIdPnfSimulator} Load Blueprint To Inventory ${PNF_SIMULATOR_BLUEPRINT_PATH} ves-client-${rand}
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020039 Set Suite Variable ${serviceTypeIdMongo}
40 Set Suite Variable ${serviceTypeIdPnfSimulator}
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020041 ${deployment_data}= Set Variable {"serviceTypeId":"${serviceTypeIdMongo}", "inputs":{"service_component_name_override":"mongo-${ves_client_hostname}","service_component_type":"mongo-${ves_client_hostname}"}}
42 Set Suite Variable ${mongo-dep} mongo-dep-${rand}
43 Deploy Service ${deployment_data} ${mongo-dep} 2 minutes
44 ${resp}= Get Blueprint From Inventory ves-client-${rand}
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020045 ${json}= Set Variable ${resp.json()}
46 ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\')
47 ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3}
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020048 ${deployment_data}= Set Variable {"serviceTypeId":"${serviceTypeIdPnfSimulator}", "inputs":{"tag_version": "${image}", "service_component_name_override":"${ves_client_hostname}"}}
49 Set Suite Variable ${ves-client-dep} ves-client-dep-${rand}
50 Deploy Service ${deployment_data} ${ves-client-dep} 4 minutes
51
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020052
53Deploying VES collector with CMPv2
54 [Documentation]
55 ... This test case deploys second VES instance with "enable_tls": set to true and "external_cert_use_external_tls" (CMPv2) set to true as DCAE applictaion
56 ... Both CMPv2 and AAF certificates are present
57 [Tags] CMPv2
58 ${resp}= Get Blueprint From Inventory k8s-ves
59 ${json}= Set Variable ${resp.json()}
60 ${serviceTypeIdVes} Set Variable ${json['items'][0]['typeId']}
61 ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\")
62 ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3}
63 ${arguments}= Create Dictionary serviceTypeId=${serviceTypeIdVes}
64 Set To Dictionary ${arguments} image ${image}
65 Set To Dictionary ${arguments} external_port_tls 32226
66 Set To Dictionary ${arguments} service_component_name_override dcae-ves-collector-cmpv2-cert
Remigiusz Janeczeke2f44602020-12-01 16:48:06 +010067 Set To Dictionary ${arguments} external_cert_sans dcae-ves-collector-cmpv2-cert,ves-collector-cmpv2-cert,ves-cmpv2-cert
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020068 Templating.Create Environment deployment ${GLOBAL_TEMPLATE_FOLDER}
69 ${deployment_data}= Templating.Apply Template deployment ${VES_INPUTS} ${arguments}
70 Deploy Service ${deployment_data} ves-collector-cmpv2-dep 4 minutes
71
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +020072Deploying VES collector with CMPv2 and wrong SANs
73 [Documentation]
74 ... This test case deploys second VES instance with "enable_tls": set to true and "external_cert_use_external_tls" (CMPv2) set to true as DCAE applictaion, CMPv2 certificate has wrong SANs
75 ... Both CMPv2 and AAF certificates are present
76 [Tags] CMPv2
77 ${resp}= Get Blueprint From Inventory k8s-ves
78 ${json}= Set Variable ${resp.json()}
79 ${serviceTypeIdVes} Set Variable ${json['items'][0]['typeId']}
80 ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\")
81 ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3}
82 ${arguments}= Create Dictionary serviceTypeId=${serviceTypeIdVes}
83 Set To Dictionary ${arguments} image ${image}
84 Set To Dictionary ${arguments} external_port_tls 32227
85 Set To Dictionary ${arguments} service_component_name_override dcae-ves-collector-cmpv2-cert-wrong-sans
86 Set To Dictionary ${arguments} external_cert_sans wrong-sans
87 Templating.Create Environment deployment ${GLOBAL_TEMPLATE_FOLDER}
88 ${deployment_data}= Templating.Apply Template deployment ${VES_INPUTS} ${arguments}
89 Deploy Service ${deployment_data} ves-collector-cmpv2-wrong-sans-dep 4 minutes
90
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020091Send registration request to CMPv2 VES
92 [Documentation]
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +020093 ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +020094 ... with enabled CMPv2 (both CMPv2 and AAF certificates are present).
95 ... Test expects successful registration
96 [Tags] CMPv2
97 ${pnf_correlation_id}= Generate Random String 20 [LETTERS][NUMBERS]
98 ${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
99 Wait Until Keyword Succeeds 10x 5s Check VES_PNFREG_OUTPUT topic presence in MR
100 Create PNF initial entry in A&AI ${PNF_entry_dict}
101 Templating.Create Environment ves ${GLOBAL_TEMPLATE_FOLDER}
102 ${template}= Templating.Apply Template ves ${pnf_ves_integration_request} ${PNF_entry_dict}
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +0200103 Pnf simulator send single VES event ${template} dcae-ves-collector-cmpv2-cert 8443 ${ves_client_hostname} 5000
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +0200104 Verify PNF Integration Request in A&AI ${PNF_entry_dict}
105
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +0200106Send registration request to CMPv2 VES with wrong SAN-s
107 [Documentation]
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +0200108 ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +0200109 ... ith enabled CMPv2 (both CMPv2 and AAF certificates are present). CMPv2 certificate has wrong SANs.
Krzysztof Kuzmickiedf1f7f2020-10-23 11:08:54 +0200110 [Tags] CMPv2
111 ${pnf_correlation_id}= Generate Random String 20 [LETTERS][NUMBERS]
112 ${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
113 Templating.Create Environment ves ${GLOBAL_TEMPLATE_FOLDER}
114 ${template}= Templating.Apply Template ves ${pnf_ves_integration_request} ${PNF_entry_dict}
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +0200115 ${resp}= Pnf simulator send single VES event ${template} dcae-ves-collector-cmpv2-cert-wrong-sans 8443 ${ves_client_hostname} 5000 421
116 Should Contain ${resp.json().get('message')} wrong-sans
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +0200117
118Send registration request to VES without CMPv2 certificate
119 [Documentation]
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +0200120 ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +0200121 ... with disabled CMPv2 (only AAF certificate is present - VES collector deployed during whole ONAP deploy).
Krzysztof Kuzmicki590d66f2020-10-07 09:23:18 +0200122 [Tags] CMPv2
123 ${pnf_correlation_id}= Generate Random String 20 [LETTERS][NUMBERS]
124 ${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
125 Templating.Create Environment ves ${GLOBAL_TEMPLATE_FOLDER}
126 ${template}= Templating.Apply Template ves ${pnf_ves_integration_request} ${PNF_entry_dict}
Krzysztof Kuzmicki26a1f972021-06-15 15:46:54 +0200127 ${resp}= Pnf simulator send single VES event ${template} dcae-ves-collector 8443 ${ves_client_hostname} 5000 421
128 Should Contain ${resp.json().get('message')} certificate_unknown
129