Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 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/dcae/deployment.robot |
| 13 | Resource ../resources/dcae/inventory.robot |
| 14 | Resource ../resources/global_properties.robot |
| 15 | Resource ../resources/test_templates/cmpv2.robot |
| 16 | Resource ../resources/test_templates/pnf_registration_without_SO_template.robot |
| 17 | Suite Setup Send VES integration request ${initial entry} |
| 18 | Suite Teardown Usecase Teardown |
| 19 | |
| 20 | *** Variables *** |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 21 | ${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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 23 | ${VES_INPUTS} deployment/VesTlsCmpv2Inputs.jinja |
| 24 | ${pnf_ves_integration_request} ves/pnf_registration_request.jinja |
| 25 | ${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} |
Krzysztof Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 26 | &{initial entry} correlation_id=dummy PNF_IPv4_address=11.11.11.1 PNF_IPv6_address=2001:0db8:0:0:0:0:1428:57ab |
Krzysztof Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 27 | |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 28 | |
| 29 | *** Test Cases *** |
| 30 | |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 31 | Deploying VES Client |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 32 | [Documentation] |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 33 | ... 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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 34 | [Tags] CMPv2 |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 35 | ${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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 39 | Set Suite Variable ${serviceTypeIdMongo} |
| 40 | Set Suite Variable ${serviceTypeIdPnfSimulator} |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 41 | ${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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 45 | ${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 Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 48 | ${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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 52 | |
| 53 | Deploying 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 Janeczek | e2f4460 | 2020-12-01 16:48:06 +0100 | [diff] [blame] | 67 | Set To Dictionary ${arguments} external_cert_sans dcae-ves-collector-cmpv2-cert,ves-collector-cmpv2-cert,ves-cmpv2-cert |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 68 | 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 Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 72 | Deploying 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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 91 | Send registration request to CMPv2 VES |
| 92 | [Documentation] |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 93 | ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 94 | ... 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 Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 103 | Pnf simulator send single VES event ${template} dcae-ves-collector-cmpv2-cert 8443 ${ves_client_hostname} 5000 |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 104 | Verify PNF Integration Request in A&AI ${PNF_entry_dict} |
| 105 | |
Krzysztof Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 106 | Send registration request to CMPv2 VES with wrong SAN-s |
| 107 | [Documentation] |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 108 | ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector |
Krzysztof Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 109 | ... ith enabled CMPv2 (both CMPv2 and AAF certificates are present). CMPv2 certificate has wrong SANs. |
Krzysztof Kuzmicki | edf1f7f | 2020-10-23 11:08:54 +0200 | [diff] [blame] | 110 | [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 Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 115 | ${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 Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 117 | |
| 118 | Send registration request to VES without CMPv2 certificate |
| 119 | [Documentation] |
Krzysztof Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 120 | ... This test case triggers registration request from VES Client (where is present only CMPv2 certificate) to VES collector |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 121 | ... with disabled CMPv2 (only AAF certificate is present - VES collector deployed during whole ONAP deploy). |
Krzysztof Kuzmicki | 590d66f | 2020-10-07 09:23:18 +0200 | [diff] [blame] | 122 | [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 Kuzmicki | 26a1f97 | 2021-06-15 15:46:54 +0200 | [diff] [blame^] | 127 | ${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 | |