From e3024beed447e25c419c9725ee7b8f925705b961 Mon Sep 17 00:00:00 2001 From: mprzybys Date: Tue, 13 Oct 2020 13:50:13 +0200 Subject: Add E2E integration tests to cover new stndDefined VES events Issue-ID: INT-1258 Signed-off-by: Marcin Przybysz Change-Id: I1d20d7bcf40bec1c498e8cee743cedeb7f25acea --- robot/resources/dcae/ves_interface.robot | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 robot/resources/dcae/ves_interface.robot (limited to 'robot/resources') diff --git a/robot/resources/dcae/ves_interface.robot b/robot/resources/dcae/ves_interface.robot new file mode 100644 index 00000000..4201a4d2 --- /dev/null +++ b/robot/resources/dcae/ves_interface.robot @@ -0,0 +1,41 @@ +Documentation The main interface for interacting with VES Collector +Library RequestsLibrary +Library OperatingSystem +Library String + +*** Variables *** +${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT} +${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT} +${DR_ENDPOINT} ${GLOBAL_DMAAP_DR_PROV_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DMAAP_DR_PROV_IP_ADDR}:${GLOBAL_DMAAP_DR_PROV_SERVER_PORT} +${DMAAP_BC_SERVER} ${GLOBAL_BC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT} +${VES_HEALTH_CHECK_PATH} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT} +${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja + +*** Keywords *** + + +Send Event to VES Collector + [Documentation] keyword wich is used to send events through VES Collector Event Listener path + [Arguments] ${event} + ${headers}= Create Dictionary content-type=application/json + ${event_from_file}= OperatingSystem.Get File ${event} + ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} + ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} + ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${event_from_file} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 202 + +Topic Validate + [Documentation] Keyword checks content of DMAAP topic and evaluate it's content with desired value + [Arguments] ${topic_name} ${expected_text} + ${timestamp}= Get Current Date + ${dict}= Create Dictionary timestamp=${timestamp} + Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict} + ${resp}= Run MR Auth Get Request ${topic_name} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} + Should Contain ${resp.text} ${expected_text} + +Send Event to VES & Validate Topic + [Documentation] Keyword is a test template which alows to send event through VES Collector and check if ivent is routed to proper DMAAP topic + [Arguments] ${event} ${topic_name} ${expected_text} + Send Event to VES Collector ${event} + Wait Until Keyword Succeeds 10x 5s Topic Validate ${topic_name} ${expected_text} -- cgit 1.2.3-korg