From 590d66fda7ae1fb5d59555bd9af4cf212c2e7856 Mon Sep 17 00:00:00 2001 From: Krzysztof Kuzmicki Date: Wed, 7 Oct 2020 09:23:18 +0200 Subject: Add CMPv2 E2E test case in robot test suite Issue-ID: INT-1731 Signed-off-by: Krzysztof Kuzmicki Change-Id: I79ac8cfc4755b134fa214d21cc71cc2b2067461b --- robot/resources/test_templates/cmpv2.robot | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 robot/resources/test_templates/cmpv2.robot (limited to 'robot/resources/test_templates/cmpv2.robot') diff --git a/robot/resources/test_templates/cmpv2.robot b/robot/resources/test_templates/cmpv2.robot new file mode 100644 index 00000000..685306f5 --- /dev/null +++ b/robot/resources/test_templates/cmpv2.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation CMPv2 test cases +Library OperatingSystem +Library RequestsLibrary +Library Collections +Library ONAPLibrary.JSON +Library ONAPLibrary.Utilities +Library ONAPLibrary.Templating WITH NAME Templating +Resource pnf_registration_without_SO_template.robot +Resource ../dcae/deployment.robot +Resource ../dcae/inventory.robot +Resource ../global_properties.robot + + +*** Variables *** +${pnf_simulator_single_event}= ves/pnf_simulator_single_event.jinja +${VES_ENDPOINT} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT} +${VES_data_path} eventListener/v7 +${single_event_data_path} /simulator/event +${users} ${EXECDIR}/robot/assets/cmpv2/mongo-users.json + + +*** Keywords *** +Pnf simulator send single VES event + [Arguments] ${event} ${ves_host} ${ves_port} ${pnf_sim_host} ${pnf_sim_port} + ${pnf_sim_endpoint}= Set Variable http://${pnf_sim_host}:${pnf_sim_port} + ${ves_url}= Set Variable ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${ves_host}:${ves_port}/${VES_data_path} + ${single_event}= Create Dictionary event=${event} ves_url=${ves_url} + Templating.Create Environment pnf ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template pnf ${pnf_simulator_single_event} ${single_event} + ${pnf_sim_endpoint}= Set Variable http://${pnf_sim_host}:${pnf_sim_port} + ${session}= Create Session pnf_sim ${pnf_sim_endpoint} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${post_resp}= Post Request pnf_sim ${single_event_data_path} data=${data} headers=${headers} + Log PNF registration request ${data} + Should Be Equal As Strings ${post_resp.status_code} 202 + Log VES has accepted event with status code ${post_resp.status_code} + + +Usecase Teardown + Undeploy Service mongo-dep + Undeploy Service pnf-simulator-dep + Undeploy Service ves-collector-cmpv2-dep + Delete Blueprint From Inventory ${serviceTypeIdMongo} + Delete Blueprint From Inventory ${serviceTypeIdPnfSimulator} \ No newline at end of file -- cgit 1.2.3-korg