aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/so
diff options
context:
space:
mode:
Diffstat (limited to 'robot/resources/so')
-rw-r--r--robot/resources/so/direct_instantiate.robot37
1 files changed, 34 insertions, 3 deletions
diff --git a/robot/resources/so/direct_instantiate.robot b/robot/resources/so/direct_instantiate.robot
index 31deab96..17e9a79a 100644
--- a/robot/resources/so/direct_instantiate.robot
+++ b/robot/resources/so/direct_instantiate.robot
@@ -6,17 +6,27 @@ Library Collections
Library String
Library DateTime
Library SoUtils
-Library ONAPLibrary.PreloadData
+Library ONAPLibrary.PreloadData WITH NAME PreloadData
Library ONAPLibrary.Utilities
+Library ONAPLibrary.JSON
+Library ONAPLibrary.ServiceMapping WITH NAME ServiceMapping
+Library ONAPLibrary.Templating WITH NAME Templating
+Library ONAPLibrary.SO WITH NAME SO
Resource ../global_properties.robot
+
+***Variables ***
+${SO_TEMPLATE_PATH} so
+${SO_CATALOGDB_PATH} /ecomp/mso/catalog/v2/serviceVnfs?serviceModelName
+${SO_APIHANDLER_PATH} /onap/so/infra/serviceInstantiation/v7/serviceInstances
+
*** Keywords ***
Instantiate Service Direct To SO
[Documentation] Creates an entire service from a CSAR
[Arguments] ${service} ${csar_file} ${vnf_template_file}
# Example: ${csar_file}= Set Variable /tmp/csar/service-Vfw20190413133734-csar.csar
# Example: ${vnf_template_file}= Set Variable /var/opt/ONAP/testsuite/vcpeutils/preload_templates/template.vfw_vfmodule.json
- Set Directory preload ./demo/preload_data
+ PreloadData.Set Directory preload ./demo/preload_data
${preload_dict}= Get Default Preload Data preload
${template}= Create Dictionary
@{keys}= Get Dictionary Keys ${preload_dict}
@@ -46,4 +56,25 @@ Instantiate Service Direct To SO
Log ${template}
${service_instance_id}= Create Entire Service ${csar_file} ${vnf_template_file} ${template} ${GLOBAL_INJECTED_REGION} ${GLOBAL_INJECTED_OPENSTACK_TENANT_ID} ${GLOBAL_INJECTED_PUBLIC_KEY}
Log ServiceInstanceId:${service_instance_id}
- Should Not Be Equal As Strings ${service_instance_id} None \ No newline at end of file
+ Should Not Be Equal As Strings ${service_instance_id} None
+
+
+CDS Service Instantiate
+ [Arguments] ${cds_service_model} ${service_uuid} ${service_invariantUUID}
+ ${auth}= Create List ${GLOBAL_SO_CATDB_USERNAME} ${GLOBAL_SO_PASSWORD}
+ ${resp}= SO.Run Get Request ${GLOBAL_SO_CATDB_ENDPOINT} ${SO_CATALOGDB_PATH}=${cds_service_model} auth=${auth}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${time_now}= Get Time
+ @{date_time}= Split String ${time_now}
+ ${time_stamp}= Catenate SEPARATOR=_ @{date_time}[0] @{date_time}[1]
+ ${customized_time_stamp}= Remove String ${time_stamp} :
+ ${cds_instance_name}= Set Variable cds_vlb_svc_${customized_time_stamp}
+ ${global_parameters}= Get Globally Injected Parameters
+ ${dict}= Set To Dictionary ${global_parameters} service_instance_name=${cds_instance_name} owning_entity=OE-Demonstration homing_solution=none owning_entity_id=67f2e84c-734d-4e90-a1e4-d2ffa2e75849 subscriber_id=Demonstration cloud_owner=${GLOBAL_AAI_CLOUD_OWNER} subscription_service_type=vLB service_model_name=${cds_service_model} service_model_uuid=${service_uuid} service_model_invariantuuid=${service_invariantUUID} resp=${resp.json()}
+ Templating.Create Environment cds ${GLOBAL_TEMPLATE_FOLDER}
+ ${data}= Templating.Apply Template cds ${SO_TEMPLATE_PATH}/cds_service_template.jinja ${dict}
+ Log ${data}
+ ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD}
+ ${resp}= SO.Run Post Request ${GLOBAL_SO_APIHAND_ENDPOINT} ${SO_APIHANDLER_PATH} ${data} auth=${auth}
+ Should Be Equal As Strings ${resp.status_code} 202
+ [Return] ${resp.json()['requestReferences']['requestId']} \ No newline at end of file