From 37529943e361704b159d4802c04307239c87b204 Mon Sep 17 00:00:00 2001 From: DR695H Date: Mon, 1 Jul 2019 13:47:56 -0400 Subject: use latest robotframework-onap keywords Issue-ID: TEST-171 Change-Id: Ie1db142d2e44cfe10f84403754917b6ef5989caf Signed-off-by: DR695H --- red.xml | 1 + .../templates/vcpeutils/template_sniro_data.json | 37 ---------------------- .../templates/vcpeutils/template_sniro_data.sniro | 37 ++++++++++++++++++++++ .../vcpeutils/template_sniro_request.jinja | 20 ++++++++++++ .../vcpeutils/template_sniro_request.json | 20 ------------ robot/resources/asdc_interface.robot | 6 ++-- robot/resources/oof_interface.robot | 16 ++-------- 7 files changed, 63 insertions(+), 74 deletions(-) delete mode 100644 robot/assets/templates/vcpeutils/template_sniro_data.json create mode 100644 robot/assets/templates/vcpeutils/template_sniro_data.sniro create mode 100644 robot/assets/templates/vcpeutils/template_sniro_request.jinja delete mode 100644 robot/assets/templates/vcpeutils/template_sniro_request.json diff --git a/red.xml b/red.xml index 24e26a62..8124e7a8 100644 --- a/red.xml +++ b/red.xml @@ -17,6 +17,7 @@ + diff --git a/robot/assets/templates/vcpeutils/template_sniro_data.json b/robot/assets/templates/vcpeutils/template_sniro_data.json deleted file mode 100644 index c2c6421e..00000000 --- a/robot/assets/templates/vcpeutils/template_sniro_data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "solutionInfo" : { - "placementInfo" : [ - { - "cloudRegionId" : "RegionOne", - "inventoryType" : "service", - "resourceModuleName" : "${tunnelxconn_ar_name}", - "serviceInstanceId" : "${vgmux_svc_instance_uuid}", - "serviceResourceId" : "TUNNEL-RESOURCE-ID-REPLACE", - "isRehome" : "False", - "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] - }, - { - "cloudRegionId" : "RegionOne", - "inventoryType" : "cloud", - "resourceModuleName" : "${vgw_name}", - "serviceInstanceId" : "vG-service-instance-id", - "serviceResourceId" : "VGW-RESOURCE-ID-REPLACE", - "isRehome" : "False", - "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] - }, - { - "cloudRegionId" : "RegionOne", - "inventoryType" : "service", - "resourceModuleName" : "${brg_ar_name}", - "serviceInstanceId" : "${vbrg_svc_instance_uuid}", - "serviceResourceId" : "BRG-RESOURCE-ID-REPLACE", - "isRehome" : "False", - "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] - } - ] - }, - "requestId" : "111-111-1111", - "statusMessage" : "", - "transactionId" : "111-111-1111", - "requestState" : "complete" -} diff --git a/robot/assets/templates/vcpeutils/template_sniro_data.sniro b/robot/assets/templates/vcpeutils/template_sniro_data.sniro new file mode 100644 index 00000000..78db76db --- /dev/null +++ b/robot/assets/templates/vcpeutils/template_sniro_data.sniro @@ -0,0 +1,37 @@ +{ + "solutionInfo" : { + "placementInfo" : [ + { + "cloudRegionId" : "RegionOne", + "inventoryType" : "service", + "resourceModuleName" : "{{tunnelxconn_ar_name}}", + "serviceInstanceId" : "{{vgmux_svc_instance_uuid}}", + "serviceResourceId" : "TUNNEL-RESOURCE-ID-REPLACE", + "isRehome" : "False", + "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] + }, + { + "cloudRegionId" : "RegionOne", + "inventoryType" : "cloud", + "resourceModuleName" : "{{vgw_name}}", + "serviceInstanceId" : "vG-service-instance-id", + "serviceResourceId" : "VGW-RESOURCE-ID-REPLACE", + "isRehome" : "False", + "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] + }, + { + "cloudRegionId" : "RegionOne", + "inventoryType" : "service", + "resourceModuleName" : "{{brg_ar_name}}", + "serviceInstanceId" : "{{vbrg_svc_instance_uuid}}", + "serviceResourceId" : "BRG-RESOURCE-ID-REPLACE", + "isRehome" : "False", + "assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] + } + ] + }, + "requestId" : "111-111-1111", + "statusMessage" : "", + "transactionId" : "111-111-1111", + "requestState" : "complete" +} diff --git a/robot/assets/templates/vcpeutils/template_sniro_request.jinja b/robot/assets/templates/vcpeutils/template_sniro_request.jinja new file mode 100644 index 00000000..85eab530 --- /dev/null +++ b/robot/assets/templates/vcpeutils/template_sniro_request.jinja @@ -0,0 +1,20 @@ +{ + "request" : { + "urlPath" : "/sniro/api/v2/placement", + "method" : "POST" + }, + "response" : { + "status" : "202", + "body": "{\"requestId\": \"1111-111-11\"}" + }, + "postServeActions" : { + "webhook" : { + "headers" : { + "Content-Type" : "application/json" + }, + "method" : "POST", + "base64Body" : "{{base64_sniro_data}}", + "url" : " http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/SNIROResponse" + } + } +} diff --git a/robot/assets/templates/vcpeutils/template_sniro_request.json b/robot/assets/templates/vcpeutils/template_sniro_request.json deleted file mode 100644 index 6fdbb707..00000000 --- a/robot/assets/templates/vcpeutils/template_sniro_request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "request" : { - "urlPath" : "/sniro/api/v2/placement", - "method" : "POST" - }, - "response" : { - "status" : "202", - "body": "{\"requestId\": \"1111-111-11\"}" - }, - "postServeActions" : { - "webhook" : { - "headers" : { - "Content-Type" : "application/json" - }, - "method" : "POST", - "base64Body" : "${base64_sniro_data}", - "url" : " http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/SNIROResponse" - } - } -} diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot index bef19b8c..070a12a2 100644 --- a/robot/resources/asdc_interface.robot +++ b/robot/resources/asdc_interface.robot @@ -255,7 +255,7 @@ Download CSAR ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id} ${csar_file_name}= Set Variable ${resp.json()['artifactName']} ${base64Obj}= Set Variable ${resp.json()['base64Contents']} - ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64 + ${binObj}= Base64 Decode ${base64Obj} Create Binary File ${save_directory}/${csar_file_name} ${binObj} Log To Console ${\n}Downloaded:${csar_file_name} @@ -320,7 +320,7 @@ Setup SDC Catalog Resource Deployment Artifact Properties [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file} ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id} ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file} - ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64 + ${payloadData}= Base64 Encode ${blueprint_data} ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData} Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} ${data}= Apply Template sdc ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict} @@ -997,7 +997,7 @@ Run ASDC MD5 Post Request ${uuid}= Generate UUID4 ${data_string}= Evaluate json.dumps(${data}) json ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5 - ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64 + ${base64md5checksum}= Base64 Encode ${md5checksum} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Content-MD5=${base64md5checksum} ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} Log Received response from asdc ${resp.text} diff --git a/robot/resources/oof_interface.robot b/robot/resources/oof_interface.robot index eaf91b28..1e740a5a 100644 --- a/robot/resources/oof_interface.robot +++ b/robot/resources/oof_interface.robot @@ -7,6 +7,7 @@ Library String Library DateTime Library Collections Library ONAPLibrary.JSON +Library ONAPLibrary.OOF Library ONAPLibrary.Templating Resource global_properties.robot @@ -60,18 +61,7 @@ RUN OOF-Homing SendPlanWithWrongVersion Run OOF-SNIRO Health Check [Documentation] Runs OOF-SNIRO Health check - ${resp}= Run OOF-SNIRO Get Request ${OOF_SNIRO_HEALTH_CHECK_PATH} - Should Be Equal As Integers ${resp.status_code} 200 - -Run OOF-SNIRO Get Request - [Documentation] Runs OOF-SNIRO Get request - [Arguments] ${data_path} - ${session}= Create Session session ${OOF_SNIRO_ENDPOINT} - ${resp}= Get Request session ${data_path} - Should Be Equal As Integers ${resp.status_code} 200 - Log Received response from OOF-SNIRO ${resp.text} - [Return] ${resp} - + ${resp}= Run SNIRO Get Request ${OOF_SNIRO_ENDPOINT} ${OOF_SNIRO_HEALTH_CHECK_PATH} Run OOF-CMSO Health Check [Documentation] Runs OOF-CMSO Health check @@ -141,8 +131,6 @@ OOF-CMSO Create Schedule ${resp}= Run OOF-CMSO Post Scheduler cmso/v1/schedules/${uuid} data=${data} [Return] ${resp} - - OOF-CMSO Wait For Pending Approval [Documentation] Gets the schedule identified by the uuid and checks if it is in the Pending Approval state [Arguments] ${uuid} ${status}=Pending Approval -- cgit 1.2.3-korg