diff options
Diffstat (limited to 'robot/resources')
30 files changed, 524 insertions, 193 deletions
diff --git a/robot/resources/aaf_interface.robot b/robot/resources/aaf_interface.robot index 57d4aabc..c9245913 100644 --- a/robot/resources/aaf_interface.robot +++ b/robot/resources/aaf_interface.robot @@ -21,6 +21,7 @@ Run AAF Get Request [Arguments] ${data_path} ${auth}= Create List ${GLOBAL_AAF_USERNAME} ${GLOBAL_AAF_PASSWORD} ${session}= Create Session aaf ${GLOBAL_AAF_SERVER} auth=${auth} + ${session_client}= Add Client Cert ${session} cert ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Get Request aaf ${data_path} headers=${headers} diff --git a/robot/resources/aai/aai_interface.robot b/robot/resources/aai/aai_interface.robot index 790fa66f..b72103d0 100644 --- a/robot/resources/aai/aai_interface.robot +++ b/robot/resources/aai/aai_interface.robot @@ -7,7 +7,7 @@ Resource ../global_properties.robot *** Variables *** ${AAI_HEALTH_PATH} /aai/util/echo?action=long -${VERSIONED_INDEX_PATH} /aai/v8 +${VERSIONED_INDEX_PATH} /aai/v11 ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI1_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT} diff --git a/robot/resources/aai/create_complex.robot b/robot/resources/aai/create_complex.robot new file mode 100644 index 00000000..e1cc2271 --- /dev/null +++ b/robot/resources/aai/create_complex.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Create A&AI Customer API. +... +... Create A&AI Customer API + +Resource ../json_templater.robot +Resource aai_interface.robot +Library OperatingSystem +Library Collections + + + +*** Variables *** +${COMPLEX_INDEX_PATH} /aai/v11 +${ROOT_COMPLEXES_PATH} /cloud-infrastructure/complexes +${ROOT_COMPLEX_PATH} /cloud-infrastructure/complexes/complex + +${SYSTEM USER} robot-ete +${AAI_ADD_COMPLEX_BODY}= robot/assets/templates/aai/add_complex_body.template + +*** Keywords *** +Inventory Complex If Not Exists + [Documentation] Creates a service in A&AI if it doesn't exist + [Arguments] ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Return From Keyword If '${get_resp.status_code}' == '200' + Inventory Complex ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + +Inventory Complex + [Documentation] Inventorys a COmplex in A&AI + [Arguments] ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + ${arguments}= Create Dictionary complex_name=${complex_name} + Set To Dictionary ${arguments} physical_location_id=${physical_location_id} + Set To Dictionary ${arguments} cloud_owner=${cloud_owner} + Set To Dictionary ${arguments} region=${region} + Set To Dictionary ${arguments} owner_defined_type=${owner_defined_type} + ${data}= Fill JSON Template File ${AAI_ADD_COMPLEX_BODY} ${arguments} + ${put_resp}= Run A&AI Put Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${data} + ${status_string}= Convert To String ${put_resp.status_code} + Should Match Regexp ${status_string} ^(201|200)$ + +Delete Complex If Exists + [Documentation] Removes a complex + [Arguments] ${physical_location_id} + ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Run Keyword If '${get_resp.status_code}' == '200' Delete Zone Exists ${physical_location_id} ${get_resp.json()} + +Delete Complex + [Arguments] ${physical_location_id} ${json} + ${resource_version}= Catenate ${json['resource-version']} + ${put_resp}= Run A&AI Delete Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${resource_version} + Should Be Equal As Strings ${put_resp.status_code} 204 + +Get Complex + [Documentation] Return a complex + [Arguments] ${physical_location_id} + ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${resp.json()} + +Get Complexes + [Documentation] Return all complexes + [Arguments] + ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEXES_PATH} + Should Be Equal As Strings ${resp.status_code} 200 + Log ${resp.json()} + [Return] ${resp.json()} + + + + diff --git a/robot/resources/aai/create_customer.robot b/robot/resources/aai/create_customer.robot index 7ebda39d..fec58843 100644 --- a/robot/resources/aai/create_customer.robot +++ b/robot/resources/aai/create_customer.robot @@ -10,32 +10,32 @@ Library OperatingSystem *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_CUSTOMER_PATH} /business/customers/customer/ ${SYSTEM USER} robot-ete ${A&AI ADD CUSTOMER BODY} robot/assets/templates/aai/add_customer.template -*** Keywords *** +*** Keywords *** Create Customer - [Documentation] Creates a customer in A&AI - [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} - ${data_template}= OperatingSystem.Get File ${A&AI ADD CUSTOMER BODY} - ${arguments}= Create Dictionary subscriber_name=${customer_name} global_customer_id=${customer_id} subscriber_type=${customer_type} cloud_owner1=${clouder_owner} cloud_region_id1=${cloud_region_id} tenant_id1=${tenant_id} service1=${service_type} - ${data}= Fill JSON Template ${data_template} ${arguments} + [Documentation] Creates a customer in A&AI + [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} + ${data_template}= OperatingSystem.Get File ${A&AI ADD CUSTOMER BODY} + ${arguments}= Create Dictionary subscriber_name=${customer_name} global_customer_id=${customer_id} subscriber_type=${customer_type} cloud_owner1=${clouder_owner} cloud_region_id1=${cloud_region_id} tenant_id1=${tenant_id} service1=${service_type} + ${data}= Fill JSON Template ${data_template} ${arguments} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} -*** Keywords *** +*** Keywords *** Delete Customer - [Documentation] Deletes a customer in A&AI + [Documentation] Deletes a customer in A&AI [Arguments] ${customer_id} - ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} + ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} Run Keyword If '${get_resp.status_code}' == '200' Delete Customer Exists ${customer_id} ${get_resp.json()['resource-version']} - -*** Keywords *** + +*** Keywords *** Delete Customer Exists - [Documentation] Deletes a customer in A&AI - [Arguments] ${customer_id} ${resource_version_id} + [Documentation] Deletes a customer in A&AI + [Arguments] ${customer_id} ${resource_version_id} ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} - Should Be Equal As Strings ${put_resp.status_code} 204 + Should Be Equal As Strings ${put_resp.status_code} 204 diff --git a/robot/resources/aai/create_service.robot b/robot/resources/aai/create_service.robot index 38aef3f6..bcf14e3d 100644 --- a/robot/resources/aai/create_service.robot +++ b/robot/resources/aai/create_service.robot @@ -12,56 +12,56 @@ Library UUID *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_SERVICE_PATH} /service-design-and-creation/services ${SYSTEM USER} robot-ete ${AAI_ADD_SERVICE_BODY}= robot/assets/templates/aai/add_service_body.template -*** Keywords *** +*** Keywords *** Create Service If Not Exists - [Documentation] Creates a service in A&AI if it doesn't exist + [Documentation] Creates a service in A&AI if it doesn't exist [Arguments] ${service_type} ${dict}= Get Services - ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} + ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} Run Keyword If '${status}' == 'FAIL' Create Service ${service_type} - + Create Service - [Documentation] Creates a service in A&AI + [Documentation] Creates a service in A&AI [Arguments] ${service_type} - ${uuid}= Generate UUID - ${data_template}= OperatingSystem.Get File ${AAI_ADD_SERVICE_BODY} - ${arguments}= Create Dictionary service_type=${service_type} UUID=${uuid} + ${uuid}= Generate UUID + ${data_template}= OperatingSystem.Get File ${AAI_ADD_SERVICE_BODY} + ${arguments}= Create Dictionary service_type=${service_type} UUID=${uuid} ${data}= Fill JSON Template ${data_template} ${arguments} ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} ${put_resp}= Run A&AI Put Request ${fullpath} ${data} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} - + Delete Service If Exists - [Documentation] Deletes a service in A&AI if it exists + [Documentation] Deletes a service in A&AI if it exists [Arguments] ${service_type} ${dict}= Get Services - ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} + ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} Run Keyword If '${status}' == 'PASS' Delete Service ${dict['${service_type}']} Delete Service - [Documentation] Delete passed service in A&AI + [Documentation] Delete passed service in A&AI [Arguments] ${dict} - ${uuid}= Get From Dictionary ${dict} service-id + ${uuid}= Get From Dictionary ${dict} service-id ${resource_version}= Get From Dictionary ${dict} resource-version ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} - ${resp}= Run A&AI Delete Request ${fullpath} ${resource_version} + ${resp}= Run A&AI Delete Request ${fullpath} ${resource_version} Should Be Equal As Strings ${resp.status_code} 204 - + Get Services - [Documentation] Creates a service in A&AI + [Documentation] Creates a service in A&AI ${resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_SERVICE_PATH} - ${dict}= Create Dictionary + ${dict}= Create Dictionary ${status} ${value}= Run Keyword And Ignore Error Should Be Equal As Strings ${resp.status_code} 200 - Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} + Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} [Return] ${dict} Update Service Dictionary @@ -69,7 +69,7 @@ Update Service Dictionary ${list}= Evaluate ${json}['service'] :for ${map} in @{list} \ ${status} ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description - \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} + \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} Log ${dict} diff --git a/robot/resources/aai/create_tenant.robot b/robot/resources/aai/create_tenant.robot index 756882e7..95f1c25a 100644 --- a/robot/resources/aai/create_tenant.robot +++ b/robot/resources/aai/create_tenant.robot @@ -11,7 +11,7 @@ Library Collections *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_TENANT_PATH} /cloud-infrastructure/cloud-regions/cloud-region/ ${SYSTEM USER} robot-ete diff --git a/robot/resources/aai/create_zone.robot b/robot/resources/aai/create_zone.robot new file mode 100644 index 00000000..09d6ea6e --- /dev/null +++ b/robot/resources/aai/create_zone.robot @@ -0,0 +1,59 @@ +*** Settings *** +Documentation Create A&AI Customer API. +... +... Create A&AI Customer API + +Resource ../json_templater.robot +Resource aai_interface.robot +Library OperatingSystem +Library Collections + + + +*** Variables *** +${ZONE_INDEX_PATH} /aai/v11 +${ROOT_ZONE_PATH} /network/zones/zone + +${SYSTEM USER} robot-ete +${AAI_ADD_ZONE_BODY}= robot/assets/templates/aai/add_zone_body.template + +*** Keywords *** +Inventory Zone If Not Exists + [Documentation] Creates a service in A&AI if it doesn't exist + [Arguments] ${zone_id}=${GLOBAL_AAI_ZONE_ID} ${zone_name}=${GLOBAL_AAI_ZONE_NAME} ${design_type}=${GLOBAL_AAI_DESIGN_TYPE} ${zone_context}=${GLOBAL_AAI_ZONE_CONTEXT} + ${get_resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + Return From Keyword If '${get_resp.status_code}' == '200' + Inventory Zone ${zone_id} ${zone_name} ${design_type} ${zone_context} + +Inventory Zone + [Documentation] Inventorys a Tenant in A&AI + [Arguments] ${zone_id} ${zone_name} ${design_type} ${zone_context} + ${arguments}= Create Dictionary zone_id=${zone_id} zone_name=${zone_name} design_type=${design_type} zone_context=${zone_context} + ${data}= Fill JSON Template File ${AAI_ADD_ZONE_BODY} ${arguments} + ${put_resp}= Run A&AI Put Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${data} + ${status_string}= Convert To String ${put_resp.status_code} + Should Match Regexp ${status_string} ^(201|200)$ + +Delete Zone + [Documentation] Removes both Tenant + [Arguments] ${zone_id}=${GLOBAL_AAI_ZONE_ID} + ${get_resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + Run Keyword If '${get_resp.status_code}' == '200' Delete Zone Exists ${zone_id} ${get_resp.json()} + +Delete Zone Exists + [Arguments] ${zone_id} ${json} + ${resource_version}= Catenate ${json['resource-version']} + ${put_resp}= Run A&AI Delete Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${resource_version} + Should Be Equal As Strings ${put_resp.status_code} 204 + +Get Zone + [Documentation] Return zone + [Arguments] ${zone_id} + ${resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${resp.json()} + + + + + diff --git a/robot/resources/aai/network.robot b/robot/resources/aai/network.robot index a42461e2..6bda4e27 100644 --- a/robot/resources/aai/network.robot +++ b/robot/resources/aai/network.robot @@ -13,30 +13,29 @@ Library HttpLibrary.HTTP Resource ../json_templater.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ ${SERVICE SUBSCRIPTIONS} /service-subscriptions/service-subscription/ ${SERVICE INSTANCE} /service-instances?service-instance-name= -${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template +${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template -*** Keywords *** +*** Keywords *** Validate Network - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${service_instance_name} ${service_type} ${customer_id} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${service_instance_name} ${service_type} ${customer_id} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} - - -*** Keywords *** + + +*** Keywords *** Create Network - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${CUSTOMER ID} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${CUSTOMER ID} ${json_string}= Catenate { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}/VDNS ${json_string} Should Be Equal As Strings ${put_resp.status_code} 201 - [Return] ${put_resp.status_code} - -
\ No newline at end of file + [Return] ${put_resp.status_code} + diff --git a/robot/resources/aai/service_instance.robot b/robot/resources/aai/service_instance.robot index f2cf7d80..31a4a610 100644 --- a/robot/resources/aai/service_instance.robot +++ b/robot/resources/aai/service_instance.robot @@ -17,7 +17,7 @@ Resource ../stack_validation/validate_vvg.robot Resource ../aai/aai_interface.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ @@ -50,6 +50,8 @@ Validate Generic VNF Dictionary Should Contain Value ${generic_vnf.json()} ${vnf_name} ${returned_vnf_type}= Get From Dictionary ${generic_vnf.json()} vnf-type Should Contain ${returned_vnf_type} ${vnf_type} + ${vnf_id}= Get From Dictionary ${generic_vnf.json()} vnf-id + ${generic_vnf}= Run A&AI Get Request ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}?depth=all [Return] ${generic_vnf.json()} VLB Closed Loop Hack diff --git a/robot/resources/aai/volume_group.robot b/robot/resources/aai/volume_group.robot index 95822011..40674a5e 100644 --- a/robot/resources/aai/volume_group.robot +++ b/robot/resources/aai/volume_group.robot @@ -13,19 +13,18 @@ Library HttpLibrary.HTTP Resource ../json_templater.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ ${SERVICE SUBSCRIPTIONS} /service-subscriptions/service-subscription/ ${SERVICE INSTANCE} /service-instances?service-instance-name= -${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template +${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template -*** Keywords *** -Validate Volume Group - [Arguments] ${service_instance_name} ${service_type} ${customer_id} +*** Keywords *** +Validate Volume Group + [Arguments] ${service_instance_name} ${service_type} ${customer_id} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} - -
\ No newline at end of file + diff --git a/robot/resources/appc_interface.robot b/robot/resources/appc_interface.robot index 289d1d7c..5cebd9ab 100644 --- a/robot/resources/appc_interface.robot +++ b/robot/resources/appc_interface.robot @@ -1,7 +1,7 @@ *** Settings *** Documentation The main interface for interacting with APP-C. It handles low level stuff like managing the http request library and APP-C required fields Library RequestsLibrary -Library UUID +Library UUID Library OperatingSystem Library StringTemplater Resource global_properties.robot @@ -19,7 +19,7 @@ Run APPC Health Check [Documentation] Runs an APPC healthcheck ${resp}= Run APPC Post Request ${APPC_INDEX PATH}${APPC_HEALTHCHECK_OPERATION_PATH} ${None} Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 + Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 Run APPC Post Request [Documentation] Runs an APPC post request @@ -44,13 +44,13 @@ Run APPC Put Request ${resp}= Put Request appc ${data_path} data=${data} headers=${headers} Log Received response from appc ${resp.text} [Return] ${resp} - + Create Mount Point In APPC [Documentation] Go tell APPC about the PGN we just spun up... [Arguments] ${nodeid} ${host} ${port}=${GLOBAL_PGN_PORT} ${username}=admin ${password}=admin ${dict}= Create Dictionary nodeid=${nodeid} host=${host} port=${port} username=${username} password=${password} ${template}= OperatingSystem.Get File ${APPC_MOUNT_XML} - ${data}= Template String ${template} ${dict} + ${data}= Template String ${template} ${dict} ${resp}= Run APPC Put Request ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid} ${data} - Should Be Equal As Strings ${resp.status_code} 200 - [Return] ${resp}
\ No newline at end of file + Should Be Equal As Strings ${resp.status_code} 201 + [Return] ${resp}
\ No newline at end of file diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot index 5ba0e48d..76496cc6 100644 --- a/robot/resources/asdc_interface.robot +++ b/robot/resources/asdc_interface.robot @@ -53,11 +53,13 @@ Distribute Model From ASDC [Arguments] ${model_zip_path} ${catalog_service_name}= ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} ${catalog_resource_ids}= Create List + ${catalog_resources}= Create Dictionary : FOR ${zip} IN @{model_zip_path} \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} + \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} Checkin ASDC Catalog Service ${catalog_service_id} Request Certify ASDC Catalog Service ${catalog_service_id} @@ -68,8 +70,9 @@ Distribute Model From ASDC Distribute ASDC Catalog Service ${catalog_service_id} ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule - [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} Check Catalog Service Distributed ${catalog_service_resp['uuid']} + [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} + Setup ASDC Catalog Resource [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id [Arguments] ${model_zip_path} @@ -289,13 +292,15 @@ Certify ASDC Catalog Resource ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uniqueId']} + Upload ASDC Heat Package - [Documentation] Creates an asdc Software Product and returns its id - [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1 - ${file}= Get Binary File ${file_path} - ${files}= Create Dictionary upload=${file} - ${resp}= Run ASDC Post Files Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id}${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} ${files} ${ASDC_DESIGNER_USER_ID} - Should Be Equal As Strings ${resp.status_code} 200 + [Documentation] Creates an asdc Software Product and returns its id + [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1 + ${files}= Create Dictionary + Create Multi Part ${files} upload ${file_path} contentType=application/zip + ${resp}= Run ASDC Post Files Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id}${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} ${files} ${ASDC_DESIGNER_USER_ID} + Should Be Equal As Strings ${resp.status_code} 200 + Add ASDC Catalog Service [Documentation] Creates an asdc Catalog Service and returns its id [Arguments] ${catalog_service_name} @@ -431,6 +436,7 @@ Run ASDC Put Request ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} + Run ASDC Post Files Request [Documentation] Runs an ASDC post request [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} @@ -442,6 +448,7 @@ Run ASDC Post Files Request ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} + Run ASDC Post Request [Documentation] Runs an ASDC post request [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} @@ -471,9 +478,17 @@ Open ASDC GUI ##Setup Browser Go To ${ASDC_FE_ENDPOINT}${PATH} Maximize Browser Window - Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} + Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} Log Logging in to ${ASDC_FE_ENDPOINT}${PATH} Title Should Be ASDC Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} Log Logged in to ${ASDC_FE_ENDPOINT}${PATH} + + +Create Multi Part + [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None} + ${fileData}= Get Binary File ${filePath} + ${fileDir} ${fileName}= Split Path ${filePath} + ${partData}= Create List ${fileName} ${fileData} ${contentType} + Set To Dictionary ${addTo} ${partName}=${partData} diff --git a/robot/resources/clamp_interface.robot b/robot/resources/clamp_interface.robot new file mode 100644 index 00000000..85a8c9e9 --- /dev/null +++ b/robot/resources/clamp_interface.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation The main interface for interacting with Microservice Bus. +Library RequestsLibrary + +Resource global_properties.robot + +*** Variables *** +${CLAMP_HEALTH_CHECK_PATH} /restservices/clds/v1/clds/healthcheck +${CLAMP_ENDPOINT} ${GLOBAL_CLAMP_SERVER_PROTOCOL}://${GLOBAL_INJECTED_CLAMP_IP_ADDR}:${GLOBAL_CLAMP_SERVER_PORT} + + +*** Keywords *** +Run CLAMP Health Check + [Documentation] Runs CLAMP Health check + ${resp}= Run CLAMP Get Request ${CLAMP_HEALTH_CHECK_PATH} + Should Be Equal As Integers ${resp.status_code} 200 + +Run CLAMP Get Request + [Documentation] Runs CLAMP Get request + [Arguments] ${data_path} + ${session}= Create Session session ${CLAMP_ENDPOINT} + ${resp}= Get Request session ${data_path} + Should Be Equal As Integers ${resp.status_code} 200 + Log Received response from CLAMP ${resp.text} + [Return] ${resp} diff --git a/robot/resources/dcae_interface.robot b/robot/resources/dcae_interface.robot index 392a2b04..fafa57ab 100644 --- a/robot/resources/dcae_interface.robot +++ b/robot/resources/dcae_interface.robot @@ -7,8 +7,7 @@ Library Collections Resource global_properties.robot *** Variables *** -${DCAE_HEALTH_CHECK_BODY} robot/assets/dcae/dcae_healthcheck.json -${DCAE_HEALTH_CHECK_PATH} /gui +${DCAE_HEALTH_CHECK_PATH} /healthcheck ${DCAE_ENDPOINT} ${GLOBAL_DCAE_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DCAE_IP_ADDR}:${GLOBAL_DCAE_SERVER_PORT} *** Keywords *** @@ -18,9 +17,8 @@ Run DCAE Health Check Log Creating session ${DCAE_ENDPOINT} ${session}= Create Session dcae ${DCAE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID - ${data}= OperatingSystem.Get File ${DCAE_HEALTH_CHECK_BODY} ${headers}= Create Dictionary X-ECOMP-Client-Version=ONAP-R2 action=getTable Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Put Request dcae ${DCAE_HEALTH_CHECK_PATH} data=${data} headers=${headers} + ${resp}= Get Request dcae ${DCAE_HEALTH_CHECK_PATH} headers=${headers} Log Received response from dcae ${resp.json()} Should Be Equal As Strings ${resp.status_code} 200 Check DCAE Results ${resp.json()} @@ -28,53 +26,21 @@ Run DCAE Health Check Check DCAE Results [Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN (except for the exceptions ;-) [Arguments] ${json} - @{rows}= Get From Dictionary ${json['returns']} rows - @{headers}= Get From Dictionary ${json['returns']} columns + # ${service_names} to contain only the names of services that are passing + ${service_names}= Evaluate map( lambda s: s['ServiceName'], filter(lambda s: s['Status'] == 'passing', ${json} )) + Should Contain Match ${service_names} cdap + Should Contain Match ${service_names} cdap_broker + Should Contain Match ${service_names} config_binding_service + Should Contain Match ${service_names} deployment_handler + Should Contain Match ${service_names} inventory + Should Contain Match ${service_names} service-change-handler + # Should Contain Match ${service_names} policy_handler + Should Contain Match ${service_names} platform_dockerhost + Should Contain Match ${service_names} component_dockerhost + Should Contain Match ${service_names} cloudify_manager + Should Contain Match ${service_names} regexp=.*dcaegen2-collectors-ves + Should Contain Match ${service_names} regexp=.*cdap_app_cdap_app_tca + Should Contain Match ${service_names} regexp=.*dcae-analytics-holmes-rule-management + Should Contain Match ${service_names} regexp=.*dcae-analytics-holmes-engine-management + [Return] ${service_names} - # Retrieve column names from headers - ${columns}= Create List - :for ${header} in @{headers} - \ ${colName}= Get From Dictionary ${header} colName - \ Append To List ${columns} ${colName} - - # Process each row making sure status=GREEN - :for ${row} in @{rows} - \ ${cells}= Get From Dictionary ${row} cells - \ ${dict}= Make A Dictionary ${cells} ${columns} - \ Is DCAE Status Valid ${dict} - -Is DCAE Status Valid - [Arguments] ${dict} - # If it is GREEN we are done. - ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Item ${dict} healthTestStatus GREEN - Return From Keyword If '${status}' == 'PASS' - - # Check for Exceptions - # Only 1 so far - ${status} ${value}= Run Keyword And Ignore Error Check For Exception ${dict} vm-controller UNDEPLOYED YELLOW - Return From Keyword If '${status}' == 'PASS' - - # Status not GREEN or is not an exception - Fail Health check failed ${dict} - -Check for Exception - [Arguments] ${dict} ${service} ${status} ${healthTestStatus} - # Test the significant attributes to see if this is a legit exception - ${exception}= Copy Dictionary ${dict} - Set To Dictionary ${exception} service=${service} status=${status} healthTestStatus=${healthTestStatus} - Dictionaries Should Be Equal ${dict} ${exception} - - - -Make A Dictionary - [Documentation] Given a list of column names and a list of dictionaries, map columname=value - [Arguments] ${columns} ${names} ${valuename}=value - ${dict}= Create Dictionary - ${collength}= Get Length ${columns} - ${namelength}= Get Length ${names} - :for ${index} in range 0 ${collength} - \ ${name}= Evaluate ${names}[${index}] - \ ${valued}= Evaluate ${columns}[${index}] - \ ${value}= Get From Dictionary ${valued} ${valueName} - \ Set To Dictionary ${dict} ${name} ${value} - [Return] ${dict}
\ No newline at end of file diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot index cb41c573..406f8f0e 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -19,6 +19,8 @@ ${ADD_DEMO_CUSTOMER_BODY} robot/assets/templates/aai/add_demo_customer.templat ${AAI_INDEX_PATH} /aai/v8 ${VF_MODULES_NAME} _Demo_VFModules.json ${FILE_CACHE} /share/ +${DEMO_PREFIX} demo + *** Keywords *** Load Customer And Models @@ -39,8 +41,10 @@ Load Models [Documentation] Use openECOMP to Orchestrate a service. [Arguments] ${customer_name} Set Test Variable ${CUSTOMER_NAME} ${customer_name} - ${status} ${value}= Run Keyword And Ignore Error Distribute Model vFW demoVFW - ${status} ${value}= Run Keyword And Ignore Error Distribute Model vLB demoVLB + ${status} ${value}= Run Keyword And Ignore Error Distribute Model vFWCL ${DEMO_PREFIX}VFWCL + ${status} ${value}= Run Keyword And Ignore Error Distribute Model vLB ${DEMO_PREFIX}VLB + ${status} ${value}= Run Keyword And Ignore Error Distribute Model vCPE ${DEMO_PREFIX}VCPE + ##${status} ${value}= Run Keyword And Ignore Error Distribute Model vIMS ${DEMO_PREFIX}VIMS Distribute Model [Arguments] ${service} ${modelName} @@ -49,15 +53,17 @@ Distribute Model Create Customer For VNF Demo [Documentation] Create demo customer for the demo [Arguments] ${customer_name} ${customer_id} ${customer_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} + Create Service If Not Exists vFWCL + Create Service If Not Exists vLB + Create Service If Not Exists vCPE + Create Service If Not Exists vIMS ${data_template}= OperatingSystem.Get File ${ADD_DEMO_CUSTOMER_BODY} ${arguments}= Create Dictionary subscriber_name=${customer_name} global_customer_id=${customer_id} subscriber_type=${customer_type} cloud_owner=${clouder_owner} cloud_region_id=${cloud_region_id} tenant_id=${tenant_id} - Set To Dictionary ${arguments} service1=vFW service2=vLB + Set To Dictionary ${arguments} service1=vFWCL service2=vLB service3=vCPE service4=vIMS ${data}= Fill JSON Template ${data_template} ${arguments} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} ${status_string}= Convert To String ${put_resp.status_code} - Should Match Regexp ${status_string} ^(201|412)$ - Create Service If Not Exists vFW - Create Service If Not Exists vLB + Should Match Regexp ${status_string} ^(200|201|412)$ Preload User Model [Documentation] Preload the demo data for the passed VNF with the passed module name @@ -102,7 +108,7 @@ Get Persona Model Id [Documentation] Query and Validates A&AI Service Instance [Arguments] ${service_instance_id} ${service_type} ${customer_id} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${customer_id}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_id} - ${persona_model_id}= Get From DIctionary ${resp.json()['service-instance'][0]} persona-model-id + ${persona_model_id}= Get From DIctionary ${resp.json()['service-instance'][0]} model-invariant-id [Return] ${persona_model_id} APPC Mount Point diff --git a/robot/resources/global_properties.robot b/robot/resources/global_properties.robot index 871f9929..ac91d24b 100644 --- a/robot/resources/global_properties.robot +++ b/robot/resources/global_properties.robot @@ -19,9 +19,16 @@ ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} network ${GLOBAL_OPENSTACK_GLANCE_SERVICE_TYPE} image ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} identity ${GLOBAL_OPENSTACK_STACK_DEPLOYMENT_TIMEOUT} 600s -${GLOBAL_AAI_CLOUD_OWNER} Rackspace +${GLOBAL_AAI_CLOUD_OWNER} CloudOwner +${GLOBAL_AAI_CLOUD_OWNER_DEFINED_TYPE} OwnerType +${GLOBAL_AAI_COMPLEX_NAME} clli1 +${GLOBAL_AAI_PHYSICAL_LOCATION_ID} clli1 ${GLOBAL_BUILD_NUMBER} 0 ${GLOBAL_VID_UI_TIMEOUT_SHORT} 20s ${GLOBAL_VID_UI_TIMEOUT_MEDIUM} 60s ${GLOBAL_VID_UI_TIMEOUT_LONG} 120s -${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
\ No newline at end of file +${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt +${GLOBAL_AAI_ZONE_ID} nova1 +${GLOBAL_AAI_ZONE_NAME} nova +${GLOBAL_AAI_DESIGN_TYPE} integration +${GLOBAL_AAI_ZONE_CONTEXT} labs
\ No newline at end of file diff --git a/robot/resources/heatbridge.robot b/robot/resources/heatbridge.robot index c96ee410..515ae391 100644 --- a/robot/resources/heatbridge.robot +++ b/robot/resources/heatbridge.robot @@ -38,7 +38,8 @@ Execute Heatbridge ${stack_id}= Get From Dictionary ${stack_info} id ${tenant_id}= Get From Dictionary ${stack_info} OS::project_id ${vnf_id}= Get From Dictionary ${stack_info} vnf_id - ${openstack_identity_url}= Catenate ${GLOBAL_INJECTED_KEYSTONE}/v2.0 + ${url} ${path}= Get Keystone Url And Path + ${openstack_identity_url}= Catenate ${url}${path} ${region}= Get Openstack Region ${user} ${pass}= Get Openstack Credentials Init Bridge ${openstack_identity_url} ${user} ${pass} ${tenant_id} ${region} ${GLOBAL_AAI_CLOUD_OWNER} diff --git a/robot/resources/msb_interface.robot b/robot/resources/msb_interface.robot new file mode 100644 index 00000000..53b67da6 --- /dev/null +++ b/robot/resources/msb_interface.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation The main interface for interacting with Microservice Bus. +Library RequestsLibrary + +Resource global_properties.robot + +*** Variables *** +${MSB_HEALTH_CHECK_PATH} /iui/microservices/default.html +${MSB_ENDPOINT} ${GLOBAL_MSB_SERVER_PROTOCOL}://${GLOBAL_INJECTED_OPENO_IP_ADDR}:${GLOBAL_MSB_SERVER_PORT} + + +*** Keywords *** +Run MSB Health Check + [Documentation] Runs MSB Health check + ${resp}= Run MSB Get Request ${MSB_HEALTH_CHECK_PATH} + Should Be Equal As Integers ${resp.status_code} 200 + +Run MSB Get Request + [Documentation] Runs MSB Get request + [Arguments] ${data_path} + ${session}= Create Session msb ${MSB_ENDPOINT} + ${resp}= Get Request msb ${data_path} + Should Be Equal As Integers ${resp.status_code} 200 + Log Received response from MSB ${resp.text} + [Return] ${resp} diff --git a/robot/resources/openstack/keystone_interface.robot b/robot/resources/openstack/keystone_interface.robot index 3c3de90c..e51e3db8 100644 --- a/robot/resources/openstack/keystone_interface.robot +++ b/robot/resources/openstack/keystone_interface.robot @@ -2,6 +2,7 @@ Documentation The main interface for interacting with Openstack Keystone API. It handles low level stuff like managing the authtoken and Openstack required fields Library OpenstackLibrary Library RequestsLibrary +Library HTTPUtils Library UUID Library Collections Library OperatingSystem @@ -20,12 +21,13 @@ Run Openstack Auth Request [Documentation] Runs an Openstack Auth Request and returns the token and service catalog. you need to include the token in future request's x-auth-token headers. Service catalog describes what can be called [Arguments] ${alias} ${username}= ${password}= ${username} ${password}= Set Openstack Credentials ${username} ${password} - ${session}= Create Session keystone ${GLOBAL_INJECTED_KEYSTONE} verify=True + ${url} ${path}= Get Keystone Url And Path + ${session}= Create Session keystone ${url} verify=True ${uuid}= Generate UUID ${data_template}= OperatingSystem.Get File ${OPENSTACK_KEYSTONE_AUTH_BODY_FILE} ${arguments}= Create Dictionary username=${username} password=${password} tenantId=${GLOBAL_INJECTED_OPENSTACK_TENANT_ID} ${data}= Fill JSON Template ${data_template} ${arguments} - ${data_path}= Catenate ${OPENSTACK_KEYSTONE_API_VERSION}${OPENSTACK_KEYSTONE_AUTH_PATH} + ${data_path}= Catenate ${path}${OPENSTACK_KEYSTONE_AUTH_PATH} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Log Sending authenticate post request ${data_path} with headers ${headers} and data ${data} ${resp}= Post Request keystone ${data_path} data=${data} headers=${headers} @@ -53,3 +55,12 @@ Set Openstack Credentials Get Openstack Credentials [Return] ${GLOBAL_INJECTED_OPENSTACK_USERNAME} ${GLOBAL_INJECTED_OPENSTACK_PASSWORD} + +Get Keystone Url And Path + [Documentation] Handle arbitrary keystone identiit url. Add v2.0 if not present. + ${pieces}= URL Parse ${GLOBAL_INJECTED_KEYSTONE} + ${url}= Catenate ${pieces.scheme}://${pieces.netloc} + ${version}= Evaluate '' + ${version}= Set Variable If '${OPENSTACK_KEYSTONE_API_VERSION}' not in '${pieces.path}' ${OPENSTACK_KEYSTONE_API_VERSION} ${version} + ${path}= Catenate ${pieces.path}${version} + [Return] ${url} ${path}
\ No newline at end of file diff --git a/robot/resources/openstack/nova_interface.robot b/robot/resources/openstack/nova_interface.robot index b36d09f1..2c9ec4c5 100644 --- a/robot/resources/openstack/nova_interface.robot +++ b/robot/resources/openstack/nova_interface.robot @@ -92,14 +92,14 @@ Add Server Add Server For Image Name [Documentation] Adds a server for the passed if - [Arguments] ${alias} ${name} ${imageName} ${flavorName} + [Arguments] ${alias} ${name} ${imageName} ${flavorName} ${public_net_id} ${images}= Get Openstack Images ${alias} ${flavors}= Get Openstack Flavors ${alias} ${images}= Get From Dictionary ${images} images ${flavors}= Get From Dictionary ${flavors} flavors ${imageRef}= Get Id For Name ${images} ${imageName} ${flavorRef}= Get Id For Name ${flavors} ${flavorName} - ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} + ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} public_net_id=${public_net_id} ${data}= Fill JSON Template File ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} data_path= data=${data} ${status_string}= Convert To String ${resp.status_code} diff --git a/robot/resources/portal_interface.robot b/robot/resources/portal_interface.robot index 29205292..e0049345 100644 --- a/robot/resources/portal_interface.robot +++ b/robot/resources/portal_interface.robot @@ -7,7 +7,7 @@ Library UUID Resource global_properties.robot *** Variables *** -${PORTAL_HEALTH_CHECK_PATH} /ECOMPPORTAL/portalApi/healthCheck +${PORTAL_HEALTH_CHECK_PATH} /ONAPPORTAL/portalApi/healthCheck ${PORTAL_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT} *** Keywords *** diff --git a/robot/resources/sdngc_interface.robot b/robot/resources/sdngc_interface.robot index d3606c17..50286444 100644 --- a/robot/resources/sdngc_interface.robot +++ b/robot/resources/sdngc_interface.robot @@ -83,7 +83,7 @@ Run SDNGC Delete Request Preload Vnf [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${service} ${uuid} - ${base_vf_module_type}= Catenate '' + ${base_vf_module_type}= Catenate ${closedloop_vf_module}= Create Dictionary ${templates}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${service} :for ${vf_module} in @{vf_modules} @@ -118,7 +118,7 @@ Preload One Vnf Topology Return From Keyword If '${filename}' == '' ${data_template}= OperatingSystem.Get File ${PRELOAD_VNF_TOPOLOGY_OPERATION_BODY}/preload.template ${parameters}= Get Template Parameters ${filename} ${uuid} - Set To Dictionary ${parameters} generic_vnf_name=${generic_vnf_name} generic_vnf_type=${generic_vnf_type} service_type=${service_type_uuid} vf_module_name=${vf_module_name} vf_module_type=${vf_module_type} uuid=${uuid} + Set To Dictionary ${parameters} generic_vnf_name=${generic_vnf_name} generic_vnf_type=${generic_vnf_type} service_type=${service_type_uuid} vf_module_name=${vf_module_name} vf_module_type=${vf_module_type} ${data}= Fill JSON Template ${data_template} ${parameters} ${put_resp}= Run SDNGC Post Request ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} ${data} Should Be Equal As Strings ${put_resp.json()['output']['response-code']} 200 @@ -130,21 +130,44 @@ Get Template Parameters ${rest} ${suite}= Split String From Right ${SUITE NAME} . 1 ${uuid}= Catenate ${uuid} ${hostid}= Get Substring ${uuid} -4 - ${ecompnet}= Evaluate ${GLOBAL_BUILD_NUMBER}%255 + ${ecompnet}= Evaluate (${GLOBAL_BUILD_NUMBER}%128)+128 + + # Initialize the value map with the properties generated from the Robot VM /opt/config folder - ${valuemap}= Create Dictionary + ${valuemap}= Copy Dictionary ${GLOBAL_INJECTED_PROPERTIES} + + # These should be deprecated by the above.... Set To Dictionary ${valuemap} artifacts_version=${GLOBAL_INJECTED_ARTIFACTS_VERSION} Set To Dictionary ${valuemap} network=${GLOBAL_INJECTED_NETWORK} + Set To Dictionary ${valuemap} public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID} + Set To Dictionary ${valuemap} cloud_env=${GLOBAL_INJECTED_CLOUD_ENV} + Set To Dictionary ${valuemap} install_script_version=${GLOBAL_INJECTED_SCRIPT_VERSION} + Set To Dictionary ${valuemap} vm_image_name=${GLOBAL_INJECTED_VM_IMAGE_NAME} + Set To Dictionary ${valuemap} vm_flavor_name=${GLOBAL_INJECTED_VM_FLAVOR} + + # update the value map with unique values. Set To Dictionary ${valuemap} uuid=${uuid} hostid=${hostid} ecompnet=${ecompnet} - ${parameters}= Create Dictionary - ${defaults}= Get From Dictionary ${GLOBAL_PRELOAD_PARAMETERS} defaults - Resolve Values Into Dictionary ${valuemap} ${defaults} ${parameters} + + # + # Mash together the defaults dict with the test case dict to create the set of + # preload parameters + # ${suite_templates}= Get From Dictionary ${GLOBAL_PRELOAD_PARAMETERS} ${suite} ${template}= Get From Dictionary ${suite_templates} ${template} - ${vnf_parameters}= Resolve VNF Parameters Into Array ${valuemap} ${template} ${parameters} + ${defaults}= Get From Dictionary ${GLOBAL_PRELOAD_PARAMETERS} defaults + # add all of the defaults to template... + @{keys}= Get Dictionary Keys ${defaults} + :for ${key} in @{keys} + \ ${value}= Get From Dictionary ${defaults} ${key} + \ Set To Dictionary ${template} ${key} ${value} + + # + # Get the vnf_parameters to preload + # + ${vnf_parameters}= Resolve VNF Parameters Into Array ${valuemap} ${template} ${vnf_parameters_json}= Evaluate json.dumps(${vnf_parameters}) json - Set To Dictionary ${parameters} vnf_parameters=${vnf_parameters_json} + ${parameters}= Create Dictionary vnf_parameters=${vnf_parameters_json} [Return] ${parameters} Resolve Values Into Dictionary @@ -156,7 +179,7 @@ Resolve Values Into Dictionary \ Set To Dictionary ${to} ${key} ${value} Resolve VNF Parameters Into Array - [Arguments] ${valuemap} ${from} ${to} + [Arguments] ${valuemap} ${from} ${vnf_parameters}= Create List ${keys}= Get Dictionary Keys ${from} :for ${key} in @{keys} @@ -196,7 +219,7 @@ Login To SDNGC Admin GUI ## Setup Browser is now being managed by the test case ## Setup Browser Go To ${SDNGC_ADMIN_SIGNUP_URL} - Maximize Browser Window + ##Maximize Browser Window Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} Log Logging in to ${SDNGC_ADMIN_LOGIN_URL} diff --git a/robot/resources/stack_validation/validate_common.robot b/robot/resources/stack_validation/validate_common.robot index 24f9fe33..6c97fac1 100644 --- a/robot/resources/stack_validation/validate_common.robot +++ b/robot/resources/stack_validation/validate_common.robot @@ -32,7 +32,7 @@ Get Server Ip ${server_name}= Get From Dictionary ${stack_info} ${key_name} ${server}= Get From Dictionary ${server_list} ${server_name} Log Entering Get Openstack Server Ip - ${ip}= Get Openstack Server Ip ${server} network_name=${network_name} + ${ip}= Search Addresses ${server} ${network_name} Log Returned Get Openstack Server Ip [Return] ${ip} @@ -45,3 +45,58 @@ Find And Reboot The Server Reboot Server auth ${vfw_server_id} +Search Addresses + [Arguments] ${server} ${network_name} + ${addresses} Get From Dictionary ${server} addresses + ${status} ${server_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${network_name} + Return From Keyword If '${status}'=='PASS' ${server_ip} + ${status} ${server_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${network_name} + Return From Keyword If '${status}'=='PASS' ${server_ip} + ${status} ${server_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${network_name} + Return From Keyword If '${status}'=='PASS' ${server_ip} + Fail ${server}/${network_name} Not Found + +Find Rackspace + [Arguments] ${addresses} ${network_name} + ${ips} Get From Dictionary ${addresses} ${network_name} + ${ip}= Get V4 IP ${ips} + [Return] ${ip} + +Find Openstack + [Arguments] ${addresses} ${network_name} + ${network_name}= Set Variable If '${network_name}' == 'public' external ${network_name} + ${ip}= Get V4 IP Openstack ${addresses} ${network_name} + [Return] ${ip} + +Find Openstack 2 + [Arguments] ${addresses} ${network_name} + ${network_name}= Set Variable If '${network_name}' == 'public' floating ${network_name} + ${ipmaps}= Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK} + ${ip}= Get V4 IP Openstack 2 ${ipmaps} ${network_name} + [Return] ${ip} + +Get V4 IP + [Arguments] ${ipmaps} + :for ${ipmap} in @{ipmaps} + \ ${ip} Get From Dictionary ${ipmap} addr + \ ${version} Get From Dictionary ${ipmap} version + \ Return from Keyword if '${version}' == '4' ${ip} + Fail No Version 4 IP + +Get V4 IP Openstack + [Arguments] ${addresses} ${testtype} + ${ipmaps}= Get From Dictionary ${addresses} ${testtype} + :for ${ipmap} in @{ipmaps} + \ ${ip} Get From Dictionary ${ipmap} addr + \ ${version} Get From Dictionary ${ipmap} version + \ Return from Keyword if '${version}'=='4' ${ip} + Fail No Version 4 IP + +Get V4 IP Openstack 2 + [Arguments] ${ipmaps} ${testtype} + :for ${ipmap} in @{ipmaps} + \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type + \ ${ip} Get From Dictionary ${ipmap} addr + \ ${version} Get From Dictionary ${ipmap} version + \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} + Fail No Version 4 IP diff --git a/robot/resources/stack_validation/validate_vfw.robot b/robot/resources/stack_validation/validate_vfw.robot index b0d591fb..e1627202 100644 --- a/robot/resources/stack_validation/validate_vfw.robot +++ b/robot/resources/stack_validation/validate_vfw.robot @@ -60,18 +60,18 @@ Wait For Packets Wait For Firewall [Documentation] Wait for the defined firewall processes to come up [Arguments] ${ip} - Wait for Process on Host ./vpp_measurement_reporter ${ip} + ##Wait for Process on Host ./vpp_measurement_reporter ${ip} Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} Wait For Packet Generator [Documentation] Wait for the defined packet generator processes to come up [Arguments] ${ip} Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} - Wait Until Keyword Succeeds 180s 5s Tail File on Host Until ${ip} Honeycomb /var/log/honeycomb/honeycomb.log - Honeycomb initialized options=-c +0 timeout=120s + ##Wait Until Keyword Succeeds 180s 5s Tail File on Host Until ${ip} Honeycomb /var/log/honeycomb/honeycomb.log - Honeycomb initialized options=-c +0 timeout=120s Run Keyword And Ignore Error Wait for Process on Host run_traffic_fw_demo.sh ${ip} timeout=60s Pkill Process On Host "/bin/bash ./run_traffic_fw_demo.sh" ${ip} Wait For Packet Sink [Documentation] Wait for the defined packet sink processes to come up [Arguments] ${ip} - Log noting to check on ${ip} + Wait for Process on Host /usr/sbin/darkstat ${ip} diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index 6930e56d..1a136130 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -192,7 +192,7 @@ Orchestrate VNF vFW closedloop [Documentation] VNF Orchestration for vFW Log VNF Orchestration flow TEST NAME=${TEST NAME} Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone - ${stack_name} ${service}= Orchestrate VNF ETE_CLP vFW vFW ${TENANT_NAME} + ${stack_name} ${service}= Orchestrate VNF ETE_CLP vFWCL vFWCL ${TENANT_NAME} [Return] ${stack_name} Orchestrate VNF vDNS closedloop diff --git a/robot/resources/test_templates/model_test_template.robot b/robot/resources/test_templates/model_test_template.robot index c27b3014..98b3b1cf 100644 --- a/robot/resources/test_templates/model_test_template.robot +++ b/robot/resources/test_templates/model_test_template.robot @@ -3,6 +3,7 @@ Documentation The main interface for interacting with ASDC. It handles low l Library OperatingSystem Library ArchiveLibrary Library Collections +Library String Resource ../asdc_interface.robot Variables ../../assets/service_mappings.py @@ -10,7 +11,7 @@ Variables ../../assets/service_mappings.py *** Variables *** ${ASDC_BASE_PATH} /sdc1 ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard -${ASDC_ASSETS_DIRECTORY} robot/assets/asdc +${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER} ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp #***************** Test Case Variables ********************* @@ -24,15 +25,17 @@ Model Distribution For Directory ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} ${ziplist}= Create List :for ${directory} in @{directory_list} - \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${directory}.zip + \ ${zipname}= Replace String ${directory} / _ + \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp \ Create Zip From Files In Directory ${folder} ${zip} \ Append To List ${ziplist} ${zip} - ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} Distribute Model From ASDC ${ziplist} ${catalog_service_name} + ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute Model From ASDC ${ziplist} ${catalog_service_name} Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids} Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id} - [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} + Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources} + [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources} diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index ed847c21..807647db 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -9,7 +9,9 @@ Resource ../vid/teardown_vid.robot Resource ../sdngc_interface.robot Resource model_test_template.robot +Resource ../aai/create_zone.robot Resource ../aai/create_customer.robot +Resource ../aai/create_complex.robot Resource ../aai/create_tenant.robot Resource ../aai/create_service.robot Resource ../openstack/neutron_interface.robot @@ -31,6 +33,7 @@ ${TENANT_ID} ${REGIONS} ${CUSTOMER_NAME} ${STACK_NAME} +${STACK_NAMES} ${SERVICE} ${VVG_SERVER_ID} ${SERVICE_INSTANCE_ID} @@ -49,37 +52,82 @@ Orchestrate VNF ${uuid}= Generate UUID Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid} Set Test Variable ${SERVICE} ${service} - ${vnf_name}= Catenate Vnf_Ete_Name${uuid} + ${list}= Create List + Set Test Variable ${STACK_NAMES} ${list} ${service_name}= Catenate Service_Ete_Name${uuid} ${service_type}= Set Variable ${service} - ${vf_module_name}= Catenate Vfmodule_Ete_Name${uuid} - ${service_model_type} ${vnf_type} ${vf_modules} = Model Distribution For Directory ${service} + ${service_model_type} ${vnf_type} ${vf_modules} ${catalog_resources}= Model Distribution For Directory ${service} Run Keyword If '${service}' == 'vVG' Create VVG Server ${uuid} Create Customer For VNF ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${service_type} ${GLOBAL_AAI_CLOUD_OWNER} Setup Browser Login To VID GUI - ${service_instance_id}= Create VID Service Instance ${customer_name} ${service_model_type} ${service} ${service_name} + ${service_instance_id}= Wait Until Keyword Succeeds 300s 5s Create VID Service Instance ${customer_name} ${service_model_type} ${service} ${service_name} Set Test Variable ${SERVICE_INSTANCE_ID} ${service_instance_id} Validate Service Instance ${service_instance_id} ${service} ${customer_name} - Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} - ${vf_module_type} ${closedloop_vf_module}= Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${service} ${uuid} - ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant} ${vf_module_type} - ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} - VLB Closed Loop Hack ${service} ${generic_vnf} ${closedloop_vf_module} - Set Test Variable ${STACK_NAME} ${vf_module_name} - Execute Heatbridge ${vf_module_name} ${service_instance_id} ${service} - Validate VF Module ${vf_module_name} ${service} + ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} + :for ${vnf} in @{vnflist} + \ ${vnf_name}= Catenate Ete_${vnf}_${uuid} + \ ${vf_module_name}= Catenate Vfmodule_Ete_${vnf}_${uuid} + \ ${vnf_type}= Get VNF Type ${catalog_resources} ${vnf} + \ ${vf_module}= Get VF Module ${catalog_resources} ${vnf} + \ Append To List ${STACK_NAMES} ${vf_module_name} + \ Wait Until Keyword Succeeds 300s 5s Create VID VNF ${service_instance_id} ${vnf_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${CUSTOMER_NAME} + \ ${vf_module_type} ${closedloop_vf_module}= Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_module} ${vnf} ${uuid} + \ ${vf_module_id}= Create VID VNF module ${service_instance_id} ${vf_module_name} ${lcp_region} ${tenant} ${vf_module_type} ${CUSTOMER_NAME} ${vnf_name} + \ ${generic_vnf}= Validate Generic VNF ${vnf_name} ${vnf_type} ${service_instance_id} + \ VLB Closed Loop Hack ${service} ${generic_vnf} ${closedloop_vf_module} + \ Set Test Variable ${STACK_NAME} ${vf_module_name} + \ Append To List ${STACK_NAMES} ${STACK_NAME} + \ Execute Heatbridge ${vf_module_name} ${service_instance_id} ${vnf} + \ Validate VF Module ${vf_module_name} ${vnf} [Return] ${vf_module_name} ${service} +Get VNF Type + [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI + [Arguments] ${resources} ${vnf} + ${cr}= Get Catalog Resource ${resources} ${vnf} + ${vnf_type}= Get From Dictionary ${cr} name + [Return] ${vnf_type} + +Get VF Module + [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI + [Arguments] ${resources} ${vnf} + ${cr}= Get Catalog Resource ${resources} ${vnf} + ${vf_module}= Find Element In Array ${cr['groups']} type org.openecomp.groups.VfModule + [Return] ${vf_module} + +Get Catalog Resource + [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI + [Arguments] ${resources} ${vnf} + + ${base_name}= Get Name Pattern ${vnf} + ${keys}= Get Dictionary Keys ${resources} + + :for ${key} in @{keys} + \ ${cr}= Get From Dictionary ${resources} ${key} + \ Return From Keyword If '${base_name}' in '${cr['allArtifacts']['heat1']['artifactDisplayName']}' ${cr} + Fail Unable to find catalog resource for ${vnf} ${base_name} + +Get Name Pattern + [Documentation] To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI + [Arguments] ${vnf} + ${list}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} ${vnf} + :for ${dict} in @{list} + \ ${base_name}= Get From Dictionary ${dict} name_pattern + \ Return From Keyword If '${dict['isBase']}' == 'true' ${base_name} + Fail Unable to locate base name pattern + + + Create Customer For VNF [Documentation] VNF Orchestration Test setup.... ... Create Tenant if not exists, Create Customer, Create Service and related relationships [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${cloud_owner} ${cloud_region_id}= Get Openstack Region + Create Service If Not Exists ${service_type} ${resp}= Create Customer ${customer_name} ${customer_id} ${customer_type} ${service_type} ${cloud_owner} ${cloud_region_id} ${TENANT_ID} Should Be Equal As Strings ${resp} 201 - Create Service If Not Exists ${service_type} Setup Orchestrate VNF [Documentation] Called before each test case to ensure tenant and region data @@ -89,6 +137,8 @@ Setup Orchestrate VNF Initialize Regions From Openstack :FOR ${region} IN @{REGIONS} \ Inventory Tenant If Not Exists ${cloud_owner} ${region} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${TENANT_ID} ${TENANT_NAME} + Inventory Zone If Not Exists + Inventory Complex If Not Exists ${GLOBAL_AAI_COMPLEX_NAME} ${GLOBAL_AAI_PHYSICAL_LOCATION_ID} ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_INJECTED_REGION} ${GLOBAL_AAI_CLOUD_OWNER_DEFINED_TYPE} Log Orchestrate VNF setup complete Initialize Tenant From Openstack @@ -111,7 +161,7 @@ Create VVG Server [Arguments] ${uuid} Run Openstack Auth Request auth ${vvg_server_name}= Catenate vVG_${uuid} - ${server}= Add Server For Image Name auth ${vvg_server_name} ${GLOBAL_VVGSERVER_IMAGE} ${GLOBAL_VVGSERVER_FLAVOR} + ${server}= Add Server For Image Name auth ${vvg_server_name} ${GLOBAL_INJECTED_VM_IMAGE_NAME} ${GLOBAL_INJECTED_VM_FLAVOR} ${GLOBAL_INJECTED_PUBLIC_NET_ID} ${server}= Get From Dictionary ${server} server ${server_id}= Get From Dictionary ${server} id Set Test Variable ${VVG_SERVER_ID} ${server_id} @@ -131,7 +181,7 @@ Delete VNF ${lcp_region}= Get Openstack Region Teardown VVG Server Teardown VLB Closed Loop Hack - Teardown VID ${SERVICE_INSTANCE_ID} ${lcp_region} ${TENANT_ID} + Teardown VID ${SERVICE_INSTANCE_ID} ${lcp_region} ${TENANT_NAME} ${CUSTOMER_NAME} Log VNF Deleted Teardown VNF diff --git a/robot/resources/vid/create_service_instance.robot b/robot/resources/vid/create_service_instance.robot index 6c7f8a03..00fafeac 100644 --- a/robot/resources/vid/create_service_instance.robot +++ b/robot/resources/vid/create_service_instance.robot @@ -22,11 +22,12 @@ Create VID Service Instance Wait Until Page Contains Element xpath=//input[@parameter-name='Instance Name'] ${GLOBAL_VID_UI_TIMEOUT_LONG} Wait Until Element Is Visible xpath=//input[@parameter-name='Instance Name'] ${GLOBAL_VID_UI_TIMEOUT_LONG} Xpath Should Match X Times //input[@parameter-name='Instance Name'] 1 - Input Text When Enabled //input[@parameter-name='Instance Name'] ${service_name} - Select From List When Enabled //select[@prompt='Select Subscriber Name'] ${customer_name} + Wait Until Keyword Succeeds 120s 5s Input Text When Enabled //input[@parameter-name='Instance Name'] ${service_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} + Select From List When Enabled //select[@prompt='Select Subscriber Name'] ${customer_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} Select From List WHen Enabled //select[@prompt='Select Service Type'] ${service_type} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Confirm'] - Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} + Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} + Page Should Contain "requestState": "COMPLETE" ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Close'] ${request_id}= Parse Request Id ${response text} diff --git a/robot/resources/vid/create_vid_vnf.robot b/robot/resources/vid/create_vid_vnf.robot index 2db24219..41737627 100644 --- a/robot/resources/vid/create_vid_vnf.robot +++ b/robot/resources/vid/create_vid_vnf.robot @@ -14,22 +14,24 @@ Resource vid_interface.robot Create VID VNF [Documentation] Creates a VNF instance using VID for passed instance id with the passed service instance name - [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} + [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${customer} Go To VID HOME Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) - Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} - Select From List By Label //select[@ng-model='selectedserviceinstancetype'] Service Instance Id + #Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + #Select From List By Label //select[@ng-model='selectedserviceinstancetype'] Service Instance Id + Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} Click Button button=Submit Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Click Element xpath=//a[contains(text(), 'View/Edit')] Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Click Element button=Add VNF - + #01681d02-2304-4c91-ab2d 0 # This is where firefox breaks. Th elink never becomes visible when run with the script. - Click Element link=${vnf_type} + ${dataTestsId}= Catenate AddVNFOption-${vnf_type} + Click Element xpath=//a[contains(text(), '${vnf_type}')] Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT} Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT} @@ -41,7 +43,7 @@ Create VID VNF Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} Click Element button=Confirm - Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Status: OK (200) timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} + Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Should Not Contain ${response text} FAILED Click Element button=Close @@ -79,14 +81,15 @@ Delete VID VNF Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE Create VID VNF module - [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} + [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} ${customer} ${vnf_name} Go To VID HOME Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) - Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} + ###Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} Click Button button=Submit Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Click Element link=View/Edit @@ -95,7 +98,7 @@ Create VID VNF module #Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s #Wait Until Element Is Visible button=Add VF-Module timeout=120s - Click Element button=Add VF-Module + Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')] # This is where firefox breaks. Th elink never becomes visible when run with the script. Click Element link=${vnf_type} @@ -108,6 +111,7 @@ Create VID VNF module Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name} Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Select Checkbox xpath=//input[@parameter-id='sdncPreload'] Click Element button=Confirm Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] diff --git a/robot/resources/vid/teardown_vid.robot b/robot/resources/vid/teardown_vid.robot index df40b9ea..3a0697ec 100644 --- a/robot/resources/vid/teardown_vid.robot +++ b/robot/resources/vid/teardown_vid.robot @@ -12,24 +12,29 @@ Resource create_service_instance.robot *** Variables *** ${VID_ENV} /vid ${VID_SERVICE_MODELS_SEARCH_URL} ${GLOBAL_VID_SERVER_PROTOCOL}://${GLOBAL_INJECTED_VID_IP_ADDR}:${GLOBAL_VID_SERVER_PORT}${VID_ENV}/serviceModels.htm#/instances/services +${TEARDOWN_STATUS} FAIL + *** Keywords *** Teardown VID [Documentation] Teardown the VID This assumes that the any runnign stacks have been torn down - [Arguments] ${service_instance_id} ${lcp_region} ${tenant} + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${customer} Return From Keyword If len('${service_instance_id}') == 0 # Keep going to the VID service instance until we get the pop-up alert that there is no service instance - Wait Until Keyword Succeeds 300s 1s Delete VID ${service_instance_id} ${lcp_region} ${tenant} + Set Test Variable ${TEARDOWN_STATUS} FAIL + Wait Until Keyword Succeeds 300s 1s Delete VID ${service_instance_id} ${lcp_region} ${tenant} ${customer} + Return From Keyword If '${TEARDOWN_STATUS}' == 'PASS' + Fail ${TEARDOWN_STATUS} Delete VID [Documentation] Teardown the next VID entity that has a Remove icon. - [Arguments] ${service_instance_id} ${lcp_region} ${tenant} + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${customer} # For vLB closed loop, we may have 2 vf modules and the vDNS one needs to be removed first. ${remove_order}= Create List vDNS_Ete Vfmodule_Ete # FAIL status is returned in ${vfmodule} because FAIL are ignored during teardown - ${status} ${vfmodule}= Run Keyword and Ignore Error Delete Next VID Entity ${service_instance_id} ${lcp_region} ${tenant} ${remove_order} + ${status} ${vfmodule}= Run Keyword and Ignore Error Delete Next VID Entity ${service_instance_id} ${lcp_region} ${tenant} ${remove_order} ${customer} Return From Keyword If '${status}' == 'FAIL' Return From Keyword If '${vfmodule}' == 'FAIL' # After tearing down a VF module, execute the reverse HB for it to remove the references from A&AI @@ -38,7 +43,7 @@ Delete VID Delete Next VID Entity [Documentation] Teardown the next VID entity that has a Remove icon. - [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${remove_order} + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${remove_order} ${customer} ${vfmodule}= Catenate Go To ${VID_SERVICE_MODELS_SEARCH_URL} Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} @@ -46,14 +51,17 @@ Delete Next VID Entity Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) - Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} + Click Button button=Submit # When Handle alert detects a pop-up. it will return FAIL and we are done # Return from Keyword is required because FAIL is inored during teardown + Set Test Variable ${TEARDOWN_STATUS} PASS ${status} ${value} Run Keyword And Ignore Error Handle Alert Return From Keyword If '${status}' == 'FAIL' ${status} ${status} ${value} Run Keyword And Ignore Error Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Return From Keyword If '${status}' == 'FAIL' ${status} + Set Test Variable ${TEARDOWN_STATUS} FAIL Click Element link=View/Edit |