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/dcae/deployment.robot | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 robot/resources/dcae/deployment.robot (limited to 'robot/resources/dcae/deployment.robot') diff --git a/robot/resources/dcae/deployment.robot b/robot/resources/dcae/deployment.robot new file mode 100644 index 00000000..30a5efce --- /dev/null +++ b/robot/resources/dcae/deployment.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation The main interface for interacting with 5G Bulkpm. +Library RequestsLibrary +Library OperatingSystem +Library String + +*** Variables *** +${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT} +${DEPLOYMENT_ENDPOINT} dcae-deployments + +*** Keywords *** +Deploy Service + [Arguments] ${inputs} ${deployment_name} ${wait_time}=5 minute + Disable Warnings + ${headers}= Create Dictionary content-type=application/json + ${deployment_data}= Set Variable ${inputs} + ${session}= Create Session deployment_session ${DEPLOYMENT_SERVER} + ${resp}= Put Request deployment_session /${DEPLOYMENT_ENDPOINT}/${deployment_name} data=${deployment_data} headers=${headers} + ${operationLink} Set Variable ${resp.json().get('links').get('status')} + ${operationId} Fetch From Right ${operationLink} / + Wait Until Keyword Succeeds ${wait_time} 20 sec Deployment Status ${deployment_name} ${operationId} + +Deployment Status + [Arguments] ${deployment_name} ${operationId} + Disable Warnings + ${session}= Create Session deployment_session ${DEPLOYMENT_SERVER} + ${resp}= Get Request deployment_session /${DEPLOYMENT_ENDPOINT}/${deployment_name}/operation/${operationId} + ${status} Set Variable ${resp.json().get('status')} + Should Be Equal As Strings ${status} succeeded + +Undeploy Service + [Arguments] ${deployment_name} + Disable Warnings + ${session}= Create Session deployment_session ${DEPLOYMENT_SERVER} + ${resp}= Delete Request deployment_session /${DEPLOYMENT_ENDPOINT}/${deployment_name} + [Return] ${resp} -- cgit 1.2.3-korg