From 99c6329d9b5f5f83a38eb309181200b80d153949 Mon Sep 17 00:00:00 2001 From: jf9860 Date: Thu, 9 Mar 2017 15:28:42 -0500 Subject: TEST-4 Re-factor openstack region variable Change-Id: Iad9ef0555dbbd921e261bfa2a63806100bcf7c83 Signed-off-by: jf9860 --- robot/resources/aai/service_instance.robot | 59 +++++------ robot/resources/demo_preload.robot | 5 +- robot/resources/heatbridge.robot | 58 ++++++----- robot/resources/openstack/cinder_interface.robot | 18 ++-- robot/resources/openstack/heat_interface.robot | 57 +++++----- robot/resources/openstack/keystone_interface.robot | 22 ++-- robot/resources/openstack/neutron_interface.robot | 49 +++++---- robot/resources/openstack/nova_interface.robot | 54 +++++----- robot/resources/openstack/openstack_common.robot | 46 +++++++-- .../stack_validation/policy_check_vfw.robot | 36 +++---- .../stack_validation/validate_dns_scaling.robot | 17 ++- .../resources/stack_validation/validate_vfw.robot | 18 +--- .../resources/stack_validation/validate_vlb.robot | 43 +++----- .../resources/stack_validation/validate_vvg.robot | 6 +- .../test_templates/closedloop_test_template.robot | 115 +++++++++++---------- .../test_templates/model_test_template.robot | 24 ++--- .../vnf_orchestration_test_template.robot | 14 ++- robot/resources/vid/create_vid_vnf.robot | 88 ++++++++-------- 18 files changed, 369 insertions(+), 360 deletions(-) (limited to 'robot/resources') diff --git a/robot/resources/aai/service_instance.robot b/robot/resources/aai/service_instance.robot index adf59c2a..5bae2f74 100644 --- a/robot/resources/aai/service_instance.robot +++ b/robot/resources/aai/service_instance.robot @@ -23,35 +23,37 @@ ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ ${SERVICE SUBSCRIPTIONS} /service-subscriptions/service-subscription/ ${SERVICE INSTANCE} /service-instances?service-instance-id= -${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template +${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template ${GENERIC_VNF_PATH_TEMPLATE} /network/generic-vnfs/generic-vnf/\${vnf_id}/vf-modules/vf-module/\${vf_module_id} ${GENERIC_VNF_QUERY_TEMPLATE} /network/generic-vnfs/generic-vnf/\${vnf_id}/vf-modules/vf-module?vf-module-name=\${vf_module_name} ${VLB_CLOSED_LOOP_HACK_BODY} robot/assets/templates/aai/vlb_closed_loop_hack.template + +#*************** Test Case Variables ************* ${VLB_CLOSED_LOOP_DELETE} ${VLB_CLOSED_LOOP_VNF_ID} -*** Keywords *** +*** Keywords *** Validate Service Instance - [Documentation] Query and Validates A&AI Service Instance + [Documentation] Query and Validates A&AI Service Instance [Arguments] ${service_instance_name} ${service_type} ${customer_name} - ${cust_resp}= Run A&AI Get Request ${INDEX PATH}/business/customers?subscriber-name=${customer_name} + ${cust_resp}= Run A&AI Get Request ${INDEX PATH}/business/customers?subscriber-name=${customer_name} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${cust_resp.json()['customer'][0]['global-customer-id']}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} Dictionary Should Contain Key ${resp.json()['service-instance'][0]} persona-model-id Dictionary Should Contain Key ${resp.json()['service-instance'][0]} persona-model-version - + Validate Generic VNF - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${vnf_name} ${vnf_type} ${service_instance_id} - ${generic_vnf}= Run A&AI Get Request ${INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${vnf_name} ${vnf_type} ${service_instance_id} + ${generic_vnf}= Run A&AI Get Request ${INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name} 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} [Return] ${generic_vnf.json()} - + VLB Closed Loop Hack - [Arguments] ${service} ${generic_vnf} ${closedloop_vf_module} + [Arguments] ${service} ${generic_vnf} ${closedloop_vf_module} Return From Keyword If '${service}' != 'vLB' ${vnf_id}= Get From Dictionary ${generic_vnf} vnf-id ${vf_modules}= Get From Dictionary ${generic_vnf} vf-modules @@ -60,27 +62,27 @@ VLB Closed Loop Hack ${persona_model_id}= Get From Dictionary ${closedloop_vf_module} invariantUUID ${persona_model_version}= Get From Dictionary ${closedloop_vf_module} version ${dummy}= Catenate dummy_${vnf_id} - ${dict}= Create Dictionary vnf_id=${vnf_id} vf_module_id=${dummy} persona_model_id=${persona_model_id} persona_model_version=${persona_model_version} + ${dict}= Create Dictionary vnf_id=${vnf_id} vf_module_id=${dummy} persona_model_id=${persona_model_id} persona_model_version=${persona_model_version} ${datapath}= Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} - ${data}= Fill JSON Template File ${VLB_CLOSED_LOOP_HACK_BODY} ${dict} + ${data}= Fill JSON Template File ${VLB_CLOSED_LOOP_HACK_BODY} ${dict} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${datapath} ${data} ${status_string}= Convert To String ${put_resp.status_code} - Should Match Regexp ${status_string} ^(201|412)$ - Set Test Variable ${VLB_CLOSED_LOOP_DELETE} ${datapath} - Set Test Variable ${VLB_CLOSED_LOOP_VNF_ID} ${vnf_id} + Should Match Regexp ${status_string} ^(201|412)$ + Set Test Variable ${VLB_CLOSED_LOOP_DELETE} ${datapath} + Set Test Variable ${VLB_CLOSED_LOOP_VNF_ID} ${vnf_id} VLB Closed Loop Hack Update [Documentation] Update the A&AI vDNS scaling vf module to have persona-model-version 1 rather than 1.0 [Arguments] ${stack_name} ${dict}= Create Dictionary vnf_id=${VLB_CLOSED_LOOP_VNF_ID} vf_module_name=${stack_name} - ${query}= Template String ${GENERIC_VNF_QUERY_TEMPLATE} ${dict} + ${query}= Template String ${GENERIC_VNF_QUERY_TEMPLATE} ${dict} ${get_resp}= Run A&AI Get Request ${INDEX_PATH}${query} ${json}= Set Variable ${get_resp.json()} Set to Dictionary ${json} persona-model-version 1 ${vf_module_id}= Get From Dictionary ${json} vf-module-id Set to Dictionary ${dict} vf_module_id=${vf_module_id} - ${uri}= Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} + ${uri}= Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} ${resp}= Run A&AI Put Request ${INDEX_PATH}${uri} ${json} ${get_resp}= Run A&AI Get Request ${INDEX_PATH}${query} @@ -88,22 +90,21 @@ VLB Closed Loop Hack Update Teardown VLB Closed Loop Hack Return From Keyword If ' ${VLB_CLOSED_LOOP_DELETE}' == '' Delete A&AI Entity ${VLB_CLOSED_LOOP_DELETE} - - + + Validate VF Module - [Documentation] Query and Validates A&AI Service Instance + [Documentation] Query and Validates A&AI Service Instance [Arguments] ${vf_module_name} ${stack_type} - Run Keyword If '${stack_type}'=='vLB' Validate vLB Stack ${vf_module_name} - Run Keyword If '${stack_type}'=='vFW' Validate Firewall Stack ${vf_module_name} - Run Keyword If '${stack_type}'=='vVG' Validate vVG Stack ${vf_module_name} + Run Keyword If '${stack_type}'=='vLB' Validate vLB Stack ${vf_module_name} + Run Keyword If '${stack_type}'=='vFW' Validate Firewall Stack ${vf_module_name} + Run Keyword If '${stack_type}'=='vVG' Validate vVG Stack ${vf_module_name} -*** Keywords *** +*** Keywords *** Create AAI Service Instance - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${customer_id} ${service_type} ${service_instance_id} ${service_instance_name} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${customer_id} ${service_type} ${service_instance_id} ${service_instance_name} ${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}/{service_type} ${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/demo_preload.robot b/robot/resources/demo_preload.robot index eba91f91..02e4ce69 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -22,13 +22,14 @@ ${FILE_CACHE} /share/ Load Customer And Models [Documentation] Use openECOMP to Orchestrate a service. [Arguments] ${customer_name} - Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_OPENSTACK_SERVICE_REGION} SharedNode OwnerType v1 CloudZone + Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} SharedNode OwnerType v1 CloudZone 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 ## MSO polling is 60 second intervals Sleep 60s - Create Customer For VNF Demo ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${TENANT_ID} + ${region}= Get Openstack Region + Create Customer For VNF Demo ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${GLOBAL_AAI_CLOUD_OWNER} ${region} ${TENANT_ID} Distribute Model [Arguments] ${service} ${modelName} diff --git a/robot/resources/heatbridge.robot b/robot/resources/heatbridge.robot index fa4b26a0..3ddeff11 100644 --- a/robot/resources/heatbridge.robot +++ b/robot/resources/heatbridge.robot @@ -14,8 +14,7 @@ Resource aai/aai_interface.robot *** Variables *** ${MULTIPART_PATH} /bulkadd ${NAMED_QUERY_PATH} /aai/search/named-query -${NAMED_QUERY_TEMPLATE} robot/assets/templates/aai/named_query.template -${REVERSE_HEATBRIDGE} +${NAMED_QUERY_TEMPLATE} robot/assets/templates/aai/named_query.template ${BASE_URI} /cloud-infrastructure/cloud-regions/cloud-region/\${cloud}/\${region} ${IMAGE_URI} ${BASE_URI}/images/image/\${image_id} @@ -23,22 +22,26 @@ ${FLAVOR_URI} ${BASE_URI}/flavors/flavor/\${flavor} ${VSERVER_URI} ${BASE_URI}/tenants/tenant/\${tenant}/vservers/vserver/\${vserver_id} ${L_INTERFACE_URI} ${VSERVER_URI}/l-interfaces/l-interface/\${linterface_id} - +#******************** Test Case Variables **************** +${REVERSE_HEATBRIDGE} + *** Keywords *** Execute Heatbridge [Documentation] Run the Heatbridge against the stack to generate the bulkadd message ... Execute the build add - ... Validate the add results by running the named query - [Arguments] ${stack_name} ${service_instance_id} ${service} - Return From Keyword If '${service}' == 'vVG' + ... Validate the add results by running the named query + [Arguments] ${stack_name} ${service_instance_id} ${service} + Return From Keyword If '${service}' == 'vVG' Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} ${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_OPENSTACK_KEYSTONE_SERVER}/v2.0 - Init Bridge ${openstack_identity_url} ${GLOBAL_VM_PROPERTIES['openstack_username']} ${GLOBAL_VM_PROPERTIES['openstack_password']} ${tenant_id} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${GLOBAL_AAI_CLOUD_OWNER} + ${openstack_identity_url}= Catenate ${GLOBAL_OPENSTACK_KEYSTONE_SERVER}/v2.0 + ${region}= Get Openstack Region + ${user} ${pass}= Get Openstack Credentials + Init Bridge ${openstack_identity_url} ${user} ${pass} ${tenant_id} ${region} ${GLOBAL_AAI_CLOUD_OWNER} ${request}= Bridge Data ${stack_id} Log ${request} ${resp}= Run A&AI Put Request ${VERSIONED_INDEX_PATH}${MULTIPART_PATH} ${request} @@ -50,43 +53,44 @@ Execute Heatbridge Run Validation Query - [Documentation] Run A&AI query to validate the bulk add + [Documentation] Run A&AI query to validate the bulk add [Arguments] ${stack_info} ${service} - Return from Keyword If '${service}' == '' + Return from Keyword If '${service}' == '' ${server_name_parameter}= Get From Dictionary ${GLOBAL_VALIDATE_NAME_MAPPING} ${service} ${vserver_name}= Get From Dictionary ${stack_info} ${server_name_parameter} - Run Vserver Query ${vserver_name} + Run Vserver Query ${vserver_name} Run Vserver Query - [Documentation] Run A&AI query to validate the bulk add + [Documentation] Run A&AI query to validate the bulk add [Arguments] ${vserver_name} ${dict}= Create Dictionary vserver_name=${vserver_name} ${request}= OperatingSystem.Get File ${NAMED_QUERY_TEMPLATE} - ${request}= Template String ${request} ${dict} + ${request}= Template String ${request} ${dict} ${resp}= Run A&AI Post Request ${NAMED_QUERY_PATH} ${request} - Should Be Equal As Strings ${resp.status_code} 200 - - + Should Be Equal As Strings ${resp.status_code} 200 + + Execute Reverse Heatbridge [Documentation] VID has already torn down the stack, reverse HB Return From Keyword If len(${REVERSE_HEATBRIDGE}) == 0 :for ${uri} in @{REVERSE_HEATBRIDGE} \ Run Keyword And Ignore Error Delete A&AI Entity ${uri} -Generate Reverse Heatbridge From Stack Name +Generate Reverse Heatbridge From Stack Name [Arguments] ${stack_name} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} timeout=10s ${reverse_heatbridge}= Generate Reverse Heatbridge From Stack Info ${stack_info} [Return] ${reverse_heatbridge} - -Generate Reverse Heatbridge From Stack Info + +Generate Reverse Heatbridge From Stack Info [Arguments] ${stack_info} ${reverse_heatbridge}= Create List ${stack_name}= Get From Dictionary ${stack_info} name ${stack_id}= Get From Dictionary ${stack_info} id ${tenant_id}= Get From Dictionary ${stack_info} OS::project_id - ${keys}= Create Dictionary region=${GLOBAL_OPENSTACK_SERVICE_REGION} cloud=${GLOBAL_AAI_CLOUD_OWNER} tenant=${tenant_id} + ${region}= Get Openstack Region + ${keys}= Create Dictionary region=${region} cloud=${GLOBAL_AAI_CLOUD_OWNER} tenant=${tenant_id} ${stack_resources}= Get Stack Resources auth ${stack_name} ${stack_id} ${resource_list}= Get From Dictionary ${stack_resources} resources :FOR ${resource} in @{resource_list} @@ -96,16 +100,16 @@ Generate Reverse Heatbridge From Stack Info \ Log ${resource} \ Run Keyword If '${resource['resource_type']}' == 'OS::Nova::Server' Generate Vserver Uri auth ${resource['physical_resource_id']} ${reverse_heatbridge} ${keys} ${resource_list} [Return] ${reverse_heatbridge} - + Generate Vserver Uri [Documentation] Run teardown against the server to generate a message that removes it [Arguments] ${alias} ${port_id} ${reverse_heatbridge} ${keys} ${resource_list} ${resp}= Get Openstack Server By Id ${alias} ${port_id} Return From Keyword If '${resp.status_code}' != '200' - ${info}= Set Variable ${resp.json()} - Set To Dictionary ${keys} vserver_id=${info['server']['id']} - Set To Dictionary ${keys} flavor=${info['server']['flavor']['id']} - Set To Dictionary ${keys} image_id=${info['server']['image']['id']} + ${info}= Set Variable ${resp.json()} + Set To Dictionary ${keys} vserver_id=${info['server']['id']} + Set To Dictionary ${keys} flavor=${info['server']['flavor']['id']} + Set To Dictionary ${keys} image_id=${info['server']['image']['id']} ${uri}= Template String ${VSERVER_URI} ${keys} Append To List ${reverse_heatbridge} ${uri} ${uri}= Template String ${FLAVOR_URI} ${keys} @@ -118,9 +122,9 @@ Generate Linterface Uri [Arguments] ${alias} ${server_id} ${reverse_heatbridge} ${keys} ${resp}= Get Openstack Port By Id ${alias} ${server_id} Return From Keyword If '${resp.status_code}' != '200' - ${info}= Set Variable ${resp.json()} + ${info}= Set Variable ${resp.json()} Set To Dictionary ${keys} vserver_id=${info['port']['device_id']} Set To Dictionary ${keys} linterface_id=${info['port']['name']} ${uri}= Template String ${L_INTERFACE_URI} ${keys} Append To List ${reverse_heatbridge} ${uri} - + diff --git a/robot/resources/openstack/cinder_interface.robot b/robot/resources/openstack/cinder_interface.robot index ee1a253b..1b720359 100644 --- a/robot/resources/openstack/cinder_interface.robot +++ b/robot/resources/openstack/cinder_interface.robot @@ -2,7 +2,7 @@ Documentation The main interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields Library OpenstackLibrary Library RequestsLibrary -Library UUID +Library UUID Library OperatingSystem Resource ../global_properties.robot Resource ../json_templater.robot @@ -20,14 +20,14 @@ ${OPENSTACK_CINDER_AVAILABILITY_ZONE} nova *** Keywords *** Get Openstack Volume Types [Documentation] Returns the openstack volume types information - [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_CINDER_TYPES_PATH} + [Arguments] ${alias} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${OPENSTACK_CINDER_TYPES_PATH} [Return] ${resp.json()} - + Get Openstack Volume [Documentation] Returns the openstack volume information for the passed in volume id [Arguments] ${alias} ${volume_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_CINDER_VOLUMES_PATH} /${volume_id} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${OPENSTACK_CINDER_VOLUMES_PATH} /${volume_id} [Return] ${resp.json()} Add Openstack Volume @@ -37,14 +37,14 @@ Add Openstack Volume ${uuid}= Generate UUID ${arguments}= Create Dictionary name=${name} description=${GLOBAL_APPLICATION_ID}${uuid} size=${size} type=${OPENSTACK_CINDER_VOLUMES_TYPE} availability_zone=${OPENSTACK_CINDER_AVAILABILITY_ZONE} ${data}= Fill JSON Template ${data_template} ${arguments} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_CINDER_VOLUMES_PATH} data_path= data=${data} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${OPENSTACK_CINDER_VOLUMES_PATH} data_path= data=${data} Should Be Equal As Strings 200 ${resp.status_code} [Return] ${resp.json()['volume']['id']} - + Delete Openstack Volume [Documentation] Runs an Openstack Request to delete a volume [Arguments] ${alias} ${volume_id} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_CINDER_VOLUMES_PATH} /${volume_id} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} ${OPENSTACK_CINDER_VOLUMES_PATH} /${volume_id} ${status_string}= Convert To String ${resp.status_code} - Should Match Regexp ${status_string} ^(204|200|404)$ + Should Match Regexp ${status_string} ^(204|200|404)$ [Return] ${resp.text} \ No newline at end of file diff --git a/robot/resources/openstack/heat_interface.robot b/robot/resources/openstack/heat_interface.robot index 74c7aac8..32f3fdee 100644 --- a/robot/resources/openstack/heat_interface.robot +++ b/robot/resources/openstack/heat_interface.robot @@ -1,8 +1,8 @@ *** Settings *** -Documentation The interface for interacting with Openstack Heat API. +Documentation The interface for interacting with Openstack Heat API. Library OpenstackLibrary Library RequestsLibrary -Library UUID +Library UUID Library OperatingSystem Library HEATUtils Library StringTemplater @@ -12,7 +12,7 @@ Resource ../json_templater.robot Resource openstack_common.robot *** Variables *** -${OPENSTACK_HEAT_API_VERSION} /v1 +${OPENSTACK_HEAT_API_VERSION} /v1 ${OPENSTACK_HEAT_STACK_PATH} /stacks ${OPENSTACK_HEAT_ADD_STACK_TEMPLATE} robot/assets/templates/heat_add_stack.template @@ -21,19 +21,19 @@ ${OPENSTACK_HEAT_ADD_STACK_TEMPLATE} robot/assets/templates/heat_add_stack.te Get Openstack Stacks [Documentation] Returns the openstack stacks info [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} [Return] ${resp.json()} - + Get Openstack Stack [Documentation] Returns the openstack stacks info for the given stack name - [Arguments] ${alias} ${stack_name} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} /${stack_name} + [Arguments] ${alias} ${stack_name} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} /${stack_name} [Return] ${resp.json()} - + Create Openstack Stack [Documentation] Takes an openstack heat yaml and returns the created stack [Arguments] ${alias} ${request} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} data_path= data=${request} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} data_path= data=${request} [Return] ${resp.json()} Make Add Stack Request @@ -44,50 +44,49 @@ Make Add Stack Request ${dict}= Create Dictionary template=${templatedata} parameters=${envdata} stack_name=${name} ${resp}= OperatingSystem.Get File ${OPENSTACK_HEAT_ADD_STACK_TEMPLATE} ${request}= Template String ${resp} ${dict} - Log $request + Log $request [Return] ${request} Delete Openstack Stack [Documentation] Deletes and Openstack Stack for the passed name and id - [Arguments] ${alias} ${stack_name} ${stack_id} + [Arguments] ${alias} ${stack_name} ${stack_id} ${data_path}= Catenate /${stack_name}/${stack_id} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} data_path=${data_path} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} data_path=${data_path} Should Be Equal As Strings 204 ${resp.status_code} [Return] ${resp} Get Stack Details - [Documentation] Gets all of the information necessary for tearing down an existing Openstack Stack - [Arguments] ${alias} ${stack_name} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} /${stack_name} - ${result}= Stack Info Parse ${resp.json()} + [Documentation] Gets all of the information necessary for tearing down an existing Openstack Stack + [Arguments] ${alias} ${stack_name} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} /${stack_name} + ${result}= Stack Info Parse ${resp.json()} [Return] ${result} Get Stack Template - [Documentation] Gets all of the template information of an existing Openstack Stack - [Arguments] ${alias} ${stack_name} ${stack_id} + [Documentation] Gets all of the template information of an existing Openstack Stack + [Arguments] ${alias} ${stack_name} ${stack_id} ${data_path}= Catenate /${stack_name}/${stack_id}/template - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} ${data_path} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} ${data_path} ${template}= Catenate ${resp.json()} [Return] ${template} - + Get Stack Resources - [Documentation] Gets all of the resources of an existing Openstack Stack - [Arguments] ${alias} ${stack_name} ${stack_id} + [Documentation] Gets all of the resources of an existing Openstack Stack + [Arguments] ${alias} ${stack_name} ${stack_id} ${data_path}= Catenate /${stack_name}/${stack_id}/resources - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_HEAT_STACK_PATH} ${data_path} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} ${OPENSTACK_HEAT_STACK_PATH} ${data_path} [Return] ${resp.json()} - + Wait for Stack to Be Deployed [Arguments] ${alias} ${stack_name} ${timeout}=600s - ${stack_info}= Wait Until Keyword Succeeds ${timeout} 30 sec Get Deployed Stack ${alias} ${stack_name} + ${stack_info}= Wait Until Keyword Succeeds ${timeout} 30 sec Get Deployed Stack ${alias} ${stack_name} ${status}= Get From Dictionary ${stack_info} stack_status Should Be Equal ${status} CREATE_COMPLETE [Return] ${stack_info} - + Get Deployed Stack - [Arguments] ${alias} ${stack_name} + [Arguments] ${alias} ${stack_name} ${stack_info}= Get Stack Details ${alias} ${stack_name} ${status}= Get From Dictionary ${stack_info} stack_status Should Not Be Equal ${status} CREATE_IN_PROGRESS - [Return] ${stack_info} - \ No newline at end of file + [Return] ${stack_info} diff --git a/robot/resources/openstack/keystone_interface.robot b/robot/resources/openstack/keystone_interface.robot index 928efbdd..6c48e120 100644 --- a/robot/resources/openstack/keystone_interface.robot +++ b/robot/resources/openstack/keystone_interface.robot @@ -2,7 +2,8 @@ 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 UUID +Library UUID +Library Collections Library OperatingSystem Resource ../global_properties.robot Resource ../json_templater.robot @@ -28,22 +29,27 @@ Run Openstack Auth Request ${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} - Save Openstack Auth ${alias} ${resp.text} + Save Openstack Auth ${alias} ${resp.text} Log Received response from keystone ${resp.text} - + Get Openstack Tenants [Documentation] Returns all the openstack tenant info [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path= + ${resp}= Internal Get Openstack With Region ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path= [Return] ${resp.json()} - + Get Openstack Tenant [Documentation] Returns the openstack tenant info for the specified tenantid [Arguments] ${alias} ${tenant_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path=/${tenant_id} + ${resp}= Internal Get Openstack With Region ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path=/${tenant_id} [Return] ${resp.json()} - + Set Openstack Credentials [Arguments] ${username} ${password} - Return From Keyword If '${username}' != '' ${username} ${password} + Return From Keyword If '${username}' != '' ${username} ${password} + ${user} ${pass}= Get Openstack Credentials + [Return] ${user} ${pass} + +Get Openstack Credentials + Dictionary Should Contain Key ${GLOBAL_VM_PROPERTIES} openstack_username [Return] ${GLOBAL_VM_PROPERTIES['openstack_username']} ${GLOBAL_VM_PROPERTIES['openstack_password']} \ No newline at end of file diff --git a/robot/resources/openstack/neutron_interface.robot b/robot/resources/openstack/neutron_interface.robot index a88a9436..bdb64b98 100644 --- a/robot/resources/openstack/neutron_interface.robot +++ b/robot/resources/openstack/neutron_interface.robot @@ -2,7 +2,7 @@ Documentation The main interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields Library OpenstackLibrary Library RequestsLibrary -Library UUID +Library UUID Library OperatingSystem Library Collections Resource ../global_properties.robot @@ -21,25 +21,25 @@ ${OPENSTACK_NEUTRON_PORT_PATH} /ports Get Openstack Network [Documentation] Runs an Openstack Request and returns the network info [Arguments] ${alias} ${network_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_NETWORK_PATH} /${network_id} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_NETWORK_PATH} /${network_id} [Return] ${resp.json()} Get Openstack Networks [Documentation] Runs an Openstack Request and returns the network info - [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_NETWORK_PATH} + [Arguments] ${alias} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_NETWORK_PATH} [Return] ${resp.json()} Get Openstack Subnets [Documentation] Runs an Openstack Request and returns the network info - [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_SUBNET_PATH} + [Arguments] ${alias} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_SUBNET_PATH} [Return] ${resp.json()} Get Openstack Ports [Documentation] Runs an Openstack Request and returns the network info - [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_PORT_PATH} + [Arguments] ${alias} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_PORT_PATH} [Return] ${resp.json()} Add Openstack Network @@ -48,28 +48,28 @@ Add Openstack Network ${data_template}= OperatingSystem.Get File ${OPENSTACK_NEUTRON_NETWORK_ADD_BODY_FILE} ${arguments}= Create Dictionary name=${name} ${data}= Fill JSON Template ${data_template} ${arguments} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_NETWORK_PATH} data_path= data=${data} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_NETWORK_PATH} data_path= data=${data} Should Be Equal As Strings 201 ${resp.status_code} [Return] ${resp.json()['network']['id']} Delete Openstack Network [Documentation] Runs an Openstack Request to delete a network [Arguments] ${alias} ${network_id} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_NETWORK_PATH} /${network_id} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_NETWORK_PATH} /${network_id} ${status_string}= Convert To String ${resp.status_code} - Should Match Regexp ${status_string} ^(204|200)$ + Should Match Regexp ${status_string} ^(204|200)$ [Return] ${resp.text} Add Openstack Network With Subnet If Not Exists [Documentation] Runs an Openstack Request to add a network and returns that network id of the created network [Arguments] ${alias} ${name} ${cidr} ${network}= Get Openstack Subnet By Name ${alias} ${name} ${cidr} - ${pass} ${v}= Run Keyword and Ignore Error Dictionary Should Contain Key ${network} id + ${pass} ${v}= Run Keyword and Ignore Error Dictionary Should Contain Key ${network} id Run Keyword If '${pass}' == 'FAIL' Add Openstack Network With Subnet ${alias} ${name} ${cidr} ${network}= Get Openstack Subnet By Name ${alias} ${name} ${cidr} ${network_id}= Get From Dictionary ${network} id [Return] ${network_id} - + Add Openstack Network With Subnet [Documentation] Runs an Openstack Request to add a network and returns that network id of the created network @@ -78,25 +78,25 @@ Add Openstack Network With Subnet ${data_template}= OperatingSystem.Get File ${OPENSTACK_NEUTRON_SUBNET_ADD_BODY_FILE} ${arguments}= Create Dictionary network_id=${network_id} cidr=${cidr} subnet_name=${name} ${data}= Fill JSON Template ${data_template} ${arguments} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_SUBNET_PATH} data_path= data=${data} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_SUBNET_PATH} data_path= data=${data} Should Be Equal As Strings 201 ${resp.status_code} [Return] ${network_id} - + Get Openstack Subnet By Name [Documentation] Retrieve the subnet from openstack by it's name. [Arguments] ${alias} ${network_name} ${network_cidr} ${resp}= Get Openstack Subnets ${alias} @{list}= Get From Dictionary ${resp} subnets - ${returnnet}= Set Variable + ${returnnet}= Set Variable :for ${net} in @{list} \ ${name}= Get From Dictionary ${net} name \ ${cidr}= Get From Dictionary ${net} cidr \ ${returnnet}= Set Variable ${net} - \ Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}' + \ Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}' \ ${returnnet}= Create DIctionary [Return] ${returnnet} -Get Openstack IP By Name +Get Openstack IP By Name [Arguments] ${alias} ${network_name} ${cidr} ${ip} ${ports}= Get Openstack Ports For Subnet ${alias} ${network_name} ${cidr} Log ${ports} @@ -115,15 +115,14 @@ Get Openstack Ports For Subnet Get Openstack Port By Id [Arguments] ${alias} ${port_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_PORT_PATH}/${port_id} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_PORT_PATH}/${port_id} [Return] ${resp} - + Delete Openstack Port - [Arguments] ${alias} ${port_id} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NEUTRON_PORT_PATH} /${port_id} + [Arguments] ${alias} ${port_id} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} ${OPENSTACK_NEUTRON_PORT_PATH} /${port_id} ${status_string}= Convert To String ${resp.status_code} - Should Match Regexp ${status_string} ^(204|200)$ + Should Match Regexp ${status_string} ^(204|200)$ [Return] ${resp.text} - - \ No newline at end of file + diff --git a/robot/resources/openstack/nova_interface.robot b/robot/resources/openstack/nova_interface.robot index efee279a..b36d09f1 100644 --- a/robot/resources/openstack/nova_interface.robot +++ b/robot/resources/openstack/nova_interface.robot @@ -3,7 +3,7 @@ Documentation The main interface for interacting with Openstack. It handles Library OpenstackLibrary Library RequestsLibrary Library JSONUtils -Library UUID +Library UUID Library OperatingSystem Library Collections Resource ../global_properties.robot @@ -26,7 +26,7 @@ ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} robot/assets/templates/nova_add_server Get Openstack Keypair [Documentation] Runs an Openstack Request and returns the keypair info [Arguments] ${alias} ${keypair_name} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_KEYPAIR_PATH} /${keypair_name} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_KEYPAIR_PATH} /${keypair_name} [Return] ${resp.json()} Add Openstack Keypair @@ -36,58 +36,58 @@ Add Openstack Keypair ${ssh_key}= OperatingSystem.Get File ${OPENSTACK_NOVA_KEYPAIR_SSH_KEY} ${arguments}= Create Dictionary name=${name} publickey=${ssh_key} ${data}= Fill JSON Template ${data_template} ${arguments} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_KEYPAIR_PATH} data_path= data=${data} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_KEYPAIR_PATH} data_path= data=${data} Should Be Equal As Strings 200 ${resp.status_code} [Return] ${resp.json()['keypair']['name']} Delete Openstack Keypair [Documentation] Runs an Openstack Request to delete a keypair [Arguments] ${alias} ${keypair_name} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_KEYPAIR_PATH} /${keypair_name} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_KEYPAIR_PATH} /${keypair_name} ${status_string}= Convert To String ${resp.status_code} - Should Match Regexp ${status_string} ^(204|202|200)$ + Should Match Regexp ${status_string} ^(204|202|200)$ [Return] ${resp.text} Get Openstack Servers [Documentation] Returns the list of servers as a dictionary by name [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} /detail + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} /detail Log Returned from Internal Get Openstack ${by_name}= Make List Into Dict ${resp.json()['servers']} name Log got it [Return] ${by_name} - + Get Openstack Server By Id [Documentation] Returns the openstack stacks info for the given stack name - [Arguments] ${alias} ${server_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id} + [Arguments] ${alias} ${server_id} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id} [Return] ${resp} - + Get Openstack Flavors [Documentation] Runs an Openstack Request and returns the flavor list [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_FLAVORS_PATH} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_FLAVORS_PATH} [Return] ${resp.json()} Get Openstack Images [Documentation] Runs an Openstack Request and returns the flavor list [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_IMAGES_PATH} + ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_IMAGES_PATH} [Return] ${resp.json()} Reboot Server [Documentation] Requests a reboot of the passed server id - [Arguments] ${alias} ${server_id} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id}/action ${OPENSTACK_NOVA_SERVERS_REBOOT_BODY} + [Arguments] ${alias} ${server_id} + ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id}/action ${OPENSTACK_NOVA_SERVERS_REBOOT_BODY} [Return] ${resp} Add Server [Documentation] Adds a server for the passed if [Arguments] ${alias} ${name} ${imageRef} ${flavorRef} ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} - ${data}= Fill JSON Template File ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} data_path= data=${data} + ${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} [Return] ${resp} Add Server For Image Name @@ -100,28 +100,28 @@ Add Server For Image Name ${imageRef}= Get Id For Name ${images} ${imageName} ${flavorRef}= Get Id For Name ${flavors} ${flavorName} ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} - ${data}= Fill JSON Template File ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} - ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} data_path= data=${data} + ${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} Should Match Regexp ${status_string} ^(202)$ [Return] ${resp.json()} Wait for Server to Be Active [Arguments] ${alias} ${server_id} ${timeout}=300s - ${server_info}= Wait Until Keyword Succeeds ${timeout} 10 sec Get Active Server ${alias} ${server_id} + ${server_info}= Wait Until Keyword Succeeds ${timeout} 10 sec Get Active Server ${alias} ${server_id} ${status}= Get From Dictionary ${server_info} status Should Be Equal ${status} ACTIVE [Return] ${server_info} Get Active Server - [Arguments] ${alias} ${server_id} + [Arguments] ${alias} ${server_id} ${resp}= Get Openstack Server By Id ${alias} ${server_id} Should Be Equal As Strings ${resp.status_code} 200 - ${server_info}= Set Variable ${resp.json()} + ${server_info}= Set Variable ${resp.json()} ${server_info}= Get From Dictionary ${server_info} server ${status}= Get From Dictionary ${server_info} status Should Not Be Equal ${status} BUILD - [Return] ${server_info} + [Return] ${server_info} Wait for Server to Be Deleted [Arguments] ${alias} ${server_id} @@ -135,15 +135,15 @@ Get Deleted Server Delete Server [Documentation] Runs an Openstack Request to delete a keypair [Arguments] ${alias} ${server_id} - ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id} + ${resp}= Internal Delete Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} /${server_id} ${status_string}= Convert To String ${resp.status_code} - Should Match Regexp ${status_string} ^(204)$ + Should Match Regexp ${status_string} ^(204)$ [Return] ${resp.text} Get Id For Name [Arguments] ${list} ${name} :for ${item} in @{list} - \ ${id}= Get From Dictionary ${item} id + \ ${id}= Get From Dictionary ${item} id \ ${n}= Get From Dictionary ${item} name - \ Return from Keyword If '${n}' == '${name}' ${id} - [Return] None + \ Return from Keyword If '${n}' == '${name}' ${id} + [Return] None diff --git a/robot/resources/openstack/openstack_common.robot b/robot/resources/openstack/openstack_common.robot index 6a53ab63..ef370c66 100644 --- a/robot/resources/openstack/openstack_common.robot +++ b/robot/resources/openstack/openstack_common.robot @@ -1,34 +1,47 @@ *** Settings *** Documentation The private interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields +Library Collections Library OpenstackLibrary Library RequestsLibrary -Library UUID +Library UUID Resource ../global_properties.robot +*** Variables *** +#**************** Test Case Variables ****************** +${OPENSTACK_SERVICE_REGION} + *** Keywords *** Internal Get Openstack [Documentation] Runs an Openstack Get Request and returns the response - [Arguments] ${alias} ${service_type} ${region} ${url_ext} ${data_path}= + [Arguments] ${alias} ${service_type} ${url_ext} ${data_path}= + ${region}= Get Openstack Region + ${resp}= Internal Get Openstack With Region ${alias} ${service_type} ${region} ${url_ext} ${data_path} + [Return] ${resp} + +Internal Get Openstack With Region + [Documentation] Runs an Openstack Get Request and returns the response + [Arguments] ${alias} ${service_type} ${region} ${url_ext} ${data_path}= Log Internal Get Openstack values alias=${alias} service_type=${service_type} region=${region} url_ext=${url_ext} data_path=${data_path} ${url}= Get Openstack Service Url ${alias} ${service_type} ${region} ${uuid}= Generate UUID ${session_alias}= Catenate openstack-${uuid} - ${session}= Create Session ${session_alias} ${url}${url_ext} verify=True + ${session}= Create Session ${session_alias} ${url}${url_ext} verify=True ${token}= Get Openstack Token ${alias} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} X-Auth-Token=${token} ${resp}= Get Request ${session_alias} ${data_path} headers=${headers} - Log Received response from openstack ${resp.text} + Log Received response from openstack ${resp.text} [Return] ${resp} Internal Post Openstack [Documentation] Runs an Openstack Post Response and returns the response - [Arguments] ${alias} ${service_type} ${region} ${url_ext} ${data_path}= ${data}= + [Arguments] ${alias} ${service_type} ${url_ext} ${data_path}= ${data}= + ${region}= Get Openstack Region Log Internal Post Openstack values alias=${alias} service_type=${service_type} region=${region} url_ext=${url_ext} data_path=${data_path} ${url}= Get Openstack Service Url ${alias} ${service_type} ${region} ${uuid}= Generate UUID ${session_alias}= Catenate openstack-${uuid} - ${session}= Create Session ${session_alias} ${url}${url_ext} verify=True + ${session}= Create Session ${session_alias} ${url}${url_ext} verify=True ${token}= Get Openstack Token ${alias} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} X-Auth-Token=${token} ${resp}= Post Request ${session_alias} ${data_path} data=${data} headers=${headers} @@ -37,7 +50,8 @@ Internal Post Openstack Internal Delete Openstack [Documentation] Runs an Openstack Delete Request and returns the response - [Arguments] ${alias} ${service_type} ${region} ${url_ext} ${data_path}= + [Arguments] ${alias} ${service_type} ${url_ext} ${data_path}= + ${region}= Get Openstack Region Log Internal Post Openstack values alias=${alias} service_type=${service_type} region=${region} url_ext=${url_ext} data_path=${data_path} ${url}= Get Openstack Service Url ${alias} ${service_type} ${region} ${uuid}= Generate UUID @@ -47,4 +61,20 @@ Internal Delete Openstack ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} X-Auth-Token=${token} ${resp}= Delete Request ${session_alias} ${data_path} headers=${headers} Log Received response from openstack ${resp.text} - [Return] ${resp} \ No newline at end of file + [Return] ${resp} + +Get Openstack Region + [Documentation] Returns the current openstack region test variable + ... Defaults to the openstack region of the Robot VM + Return From Keyword If len('${OPENSTACK_SERVICE_REGION}') > 0 ${OPENSTACK_SERVICE_REGION} + Dictionary Should Contain Key ${GLOBAL_VM_PROPERTIES} region + Set Test Variable ${OPENSTACK_SERVICE_REGION} ${GLOBAL_VM_PROPERTIES['region']} + Log Setting OPENSTACK_SERVICE_REGION=${OPENSTACK_SERVICE_REGION} + [Return] ${OPENSTACK_SERVICE_REGION} + +Set Openstack Region Test Variable + [Documentation] Sets the openstack service region of the current test case + ... To be used to override the service region of the Robot VM (default) + [Arguments] ${openstack_service_region} + Set Test Variable ${OPENSTACK_SERVICE_REGION} ${openstack_service_region} + diff --git a/robot/resources/stack_validation/policy_check_vfw.robot b/robot/resources/stack_validation/policy_check_vfw.robot index 10b25843..126f437e 100644 --- a/robot/resources/stack_validation/policy_check_vfw.robot +++ b/robot/resources/stack_validation/policy_check_vfw.robot @@ -25,73 +25,73 @@ ${ASSETS} ${EXECDIR}/robot/assets/ *** Keywords *** Policy Check Firewall Stack - [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION - [Arguments] ${stack_name} ${policy_rate} + [Documentation] Executes the vFW policy closed loop test. + [Arguments] ${stack_name} ${policy_rate} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} ${stack_id}= Get From Dictionary ${stack_info} id - ${server_list}= Get Openstack Servers auth + ${server_list}= Get Openstack Servers auth Log ${server_list} ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 - ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public + ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public ${upper_bound}= Evaluate ${policy_rate}*2 Wait Until Keyword Succeeds 300s 1s Run VFW Policy Check ${vpg_public_ip} ${policy_rate} ${upper_bound} 1 Run VFW Policy Check - [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, + [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, [Arguments] ${vpg_public_ip} ${policy_rate} ${upper_bound} ${lower_bound} # Force traffic above threshold Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${upper_bound} # Force traffic below threshold Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${lower_bound} - + Check For Policy Enforcement - [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, + [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, [Arguments] ${vpg_public_ip} ${policy_rate} ${forced_rate} Enable Streams ${vpg_public_ip} ${forced_rate} Wait Until Keyword Succeeds 20s 5s Test For Expected Rate ${vpg_public_ip} ${forced_rate} Wait Until Keyword Succeeds 280s 5s Test For Expected Rate ${vpg_public_ip} ${policy_rate} Test For Expected Rate - [Documentation] Ge the number of pg-streams from the PGN, and test to see if it is what we expect. + [Documentation] Ge the number of pg-streams from the PGN, and test to see if it is what we expect. [Arguments] ${vpg_public_ip} ${number_of_streams} ${list}= Get List Of Enabled Streams ${vpg_public_ip} ${list}= Evaluate ${list['sample-plugin']}['pg-streams']['pg-stream'] - Length Should Be ${list} ${number_of_streams} + Length Should Be ${list} ${number_of_streams} Policy Check vLB Stack - [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION - [Arguments] ${stack_name} ${policy_rate} + [Documentation] Executes the vLB policy closed loop test + [Arguments] ${stack_name} ${policy_rate} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} ${stack_id}= Get From Dictionary ${stack_info} id - ${server_list}= Get Openstack Servers auth - ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public + ${server_list}= Get Openstack Servers auth + ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public ${upper_bound}= Evaluate ${policy_rate}*2 - Start DNS Traffic ${vlb_public_ip} ${upper_bound} + Start DNS Traffic ${vlb_public_ip} ${upper_bound} # Now wiat for the dnsscaling stack to be deployed ${prefix}= Get DNSScaling Prefix - ${dnsscaling}= Replace String Using Regexp ${stack_name} ^Vfmodule_ ${prefix} + ${dnsscaling}= Replace String Using Regexp ${stack_name} ^Vfmodule_ ${prefix} ${dnsscaling_info}= Wait for Stack to Be Deployed auth ${dnsscaling} VLB Closed Loop Hack Update ${dnsscaling} # TO DO: Log into vLB and cehck that traffic is flowing to the new DNS - [Return] ${dnsscaling} + [Return] ${dnsscaling} Get DNSScaling Prefix ${mapping}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} vLB :for ${dict} in @{mapping} \ Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']} [Return] None - + Start DNS Traffic [Documentation] Run nslookups at rate per second. Run for 10 minutes or until it is called by the terminate process [Arguments] ${vlb_public_ip} ${rate} ${pid}= Start Process ./dnstraffic.sh ${vlb_public_ip} ${rate} ${GLOBAL_DNS_TRAFFIC_DURATION} - [Return] ${pid} \ No newline at end of file + [Return] ${pid} \ No newline at end of file diff --git a/robot/resources/stack_validation/validate_dns_scaling.robot b/robot/resources/stack_validation/validate_dns_scaling.robot index f63479ea..41c04633 100644 --- a/robot/resources/stack_validation/validate_dns_scaling.robot +++ b/robot/resources/stack_validation/validate_dns_scaling.robot @@ -21,23 +21,22 @@ ${ASSETS} ${EXECDIR}/robot/assets/ *** Keywords *** Validate Dns Scaling Stack - [Documentation] Identifies the servers in the STACK_NAME in the GLOBAL_OPENSTACK_SERVICE_REGION - [Arguments] ${STACK_NAME} + [Documentation] Wait for the DNS scaling stack to be instantiated + [Arguments] ${STACK_NAME} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME} ${stack_id}= Get From Dictionary ${stack_info} id - ${server_list}= Get Openstack Servers auth + ${server_list}= Get Openstack Servers auth Log ${server_list} - #${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 - #${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 - ${vdns_public_ip}= Get Server Ip ${server_list} ${stack_info} vdns_name_0 network_name=public + ${vdns_public_ip}= Get Server Ip ${server_list} ${stack_info} vdns_name_0 network_name=public Wait For Server ${vdns_public_ip} Log Accessed all servers #Wait for vDNS ${vdns_public_ip} Log All server processes up Wait For vDNS - [Documentation] Wait for the defined firewall processes to come up - [Arguments] ${ip} - Wait for Process on Host java DNSServer ${ip} + [Documentation] Wait for the DNSServer to be running on the scaling DNS. + ... Disabled. Potential for robot to hang due to network reconfigurations at startup. + [Arguments] ${ip} + Wait for Process on Host java DNSServer ${ip} diff --git a/robot/resources/stack_validation/validate_vfw.robot b/robot/resources/stack_validation/validate_vfw.robot index 383fbc7b..a5322efb 100644 --- a/robot/resources/stack_validation/validate_vfw.robot +++ b/robot/resources/stack_validation/validate_vfw.robot @@ -22,7 +22,7 @@ ${ASSETS} ${EXECDIR}/robot/assets/ *** Keywords *** Validate Firewall Stack - [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION + [Documentation] Identifies and validates the firewall servers in the VFW Stack [Arguments] ${STACK_NAME} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME} @@ -46,22 +46,6 @@ Validate Firewall Stack Log All server processes up ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1 ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_oam_ip} - - # Following hack was implemented because the stack doesn't always come up clean - # It was found that rebooting the servers at this point did not improve the - # chances of the packets flowing to the SNK - #${status} ${data}= Run Keyword And Ignore Error Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} - #Return From Keyword if '${status}' == 'PASS' - #Close All Connections - #Find And Reboot The Server ${stack_info} ${server_list} vfw_name_0 - #Find And Reboot The Server ${stack_info} ${server_list} vpg_name_0 - #Find And Reboot The Server ${stack_info} ${server_list} vsn_name_0 - ## Gives some time for servers to shutdown - #Sleep 10s - #Wait For Server ${vfw_public_ip} - #Wait For Server ${vpg_public_ip} - #Wait For Server ${vsn_public_ip} - Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} Wait For Packets diff --git a/robot/resources/stack_validation/validate_vlb.robot b/robot/resources/stack_validation/validate_vlb.robot index 9af768fa..eef578ab 100644 --- a/robot/resources/stack_validation/validate_vlb.robot +++ b/robot/resources/stack_validation/validate_vlb.robot @@ -12,49 +12,30 @@ ${ASSETS} ${EXECDIR}/robot/assets/ *** Keywords *** Validate vLB Stack - [Documentation] Identifies the LB and DNS servers in the vLB stack in the GLOBAL_OPENSTACK_SERVICE_REGION - [Arguments] ${stack_name} + [Documentation] Identifies the LB and DNS servers in the vLB stack + [Arguments] ${stack_name} Run Openstack Auth Request auth ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} ${stack_id}= Get From Dictionary ${stack_info} id - ${server_list}= Get Openstack Servers auth + ${server_list}= Get Openstack Servers auth Log Returned from Get Openstack Servers - - #${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 - #${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 - ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public - ##${vdns_public_ip}= Get Server Ip ${server_list} ${stack_info} vdns_name_0 network_name=public - -# SCript hands right here. Trying to figure out what it is.... - #Wait For Server ${vlb_public_ip} - #Wait For Server ${vdns_public_ip} - #Log Accessed all servers - - - # Following is a hack because the stack doesn't always come up clean - # Give some time for VLB server to reconfigure the network so our script doesn't hang + ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public Log Waiting for ${vlb_public_ip} to reconfigure Sleep 180s - #${status} ${data}= Run Keyword And Ignore Error Wait For vLB ${vlb_public_ip} - #Return From Keyword if '${status}' == 'PASS' - #Close All Connections - #Find And Reboot The Server ${stack_info} ${server_list} vlb_name_0 - - # Give some time for VLB server to reconfigure the network so our script doesn't hang - #Log Waiting for ${vlb_public_ip} to reconfigure - #Sleep 180s - Wait For vLB ${vlb_public_ip} + # Server validations diabled due to issues with load balancer network reconfiguration + # at startup hanging the robot scripts + Wait For vLB ${vlb_public_ip} Log All server processes up Wait For vLB - [Documentation] Wait for the VLB to be functioning as a DNS - [Arguments] ${ip} - Wait Until Keyword Succeeds 300s 10s DNSTest ${ip} + [Documentation] Wait for the VLB to be functioning as a DNS + [Arguments] ${ip} + Wait Until Keyword Succeeds 300s 10s DNSTest ${ip} Log Succeeded - + DNSTest [Documentation] Wait for the defined VLoadBalancer to process nslookup [Arguments] ${ip} - Log Looking up ${ip} + Log Looking up ${ip} #${returned_ip}= Dns Request host1.dnsdemo.openecomp.org ${ip} #Should Contain '${returned_ip}' . diff --git a/robot/resources/stack_validation/validate_vvg.robot b/robot/resources/stack_validation/validate_vvg.robot index 75340a47..47d9600a 100644 --- a/robot/resources/stack_validation/validate_vvg.robot +++ b/robot/resources/stack_validation/validate_vvg.robot @@ -10,8 +10,8 @@ Resource validate_common.robot ${ASSETS} ${EXECDIR}/robot/assets/ *** Keywords *** -Validate vVG Stack - [Documentation] Identifies the LB and DNS servers in the vLB stack in the GLOBAL_OPENSTACK_SERVICE_REGION - [Arguments] ${stack_name} +Validate vVG Stack + [Documentation] Validation of vVG stack (TBD) + [Arguments] ${stack_name} Log All server processes up diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot index e3f73270..e5a5ca92 100644 --- a/robot/resources/test_templates/closedloop_test_template.robot +++ b/robot/resources/test_templates/closedloop_test_template.robot @@ -25,9 +25,9 @@ ${VFWPOLICYRATE} 5 # Max nslookup requests per second before triggering event. ${VLBPOLICYRATE} 20 -${CONFIG_POLICY_NAME} vFirewall -${CONFIG_POLICY_TYPE} Unknown -${OPS_POLICY_NAME} +${CONFIG_POLICY_NAME} vFirewall +${CONFIG_POLICY_TYPE} Unknown +${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} BRMS_PARAM # VFW low threshold @@ -45,32 +45,33 @@ ${Expected_Severity_3} MAJOR ${Expected_Threshold_3} 200 ${Expected_Direction_3} GREATER_OR_EQUAL -${DNSSCALINGSTACK} +#********** Test Case Variables ************ +${DNSSCALINGSTACK} *** Keywords *** VFW Policy Log Suite name ${SUITE NAME} ${TEST NAME} ${PREV TEST NAME} Initialize VFW Policy - ${stackname}= Orchestrate VNF vFW closedloop + ${stackname}= Orchestrate VNF vFW closedloop Policy Check Firewall Stack ${stackname} ${VFWPOLICYRATE} - + VDNS Policy Initialize VDNS Policy ${stackname}= Orchestrate VNF vDNS closedloop ${dnsscaling}= Policy Check vLB Stack ${stackname} ${VLBPOLICYRATE} Set Test Variable ${DNSSCALINGSTACK} ${dnsscaling} - + Initialize VFW Policy # Create Config Policy # Push Config Policy ${CONFIG_POLICY_NAME} ${CONFIG_POLICY_TYPE} # Create Ops Policy -# Push Ops Policy ${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} +# Push Ops Policy ${OPS_POLICY_NAME} ${OPS_POLICY_TYPE} Get Configs VFW Policy - + Initialize VDNS Policy Get Configs VDNS Policy - + Get Configs VFW Policy [Documentation] Get Config Policy for VFW ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_NAME}* @@ -78,26 +79,26 @@ Get Configs VFW Policy ${output} = Fill JSON Template File ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name} ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} Should Be Equal As Strings ${get_resp.status_code} 200 - + ${json}= Parse Json ${get_resp.content} ${config}= Parse Json ${json[0]["config"]} - - # Extract object1 from Array + + # Extract object1 from Array ${severity}= Get Variable Value ${config["content"]["thresholds"][0]["severity"]} - Should Be Equal ${severity} ${Expected_Severity_1} + Should Be Equal ${severity} ${Expected_Severity_1} ${Thresold_Value}= Get Variable Value ${config["content"]["thresholds"][0]["thresholdValue"]} - Should Be Equal ${Thresold_Value} ${Expected_Threshold_1} + Should Be Equal ${Thresold_Value} ${Expected_Threshold_1} ${direction}= Get Variable Value ${config["content"]["thresholds"][0]["direction"]} - Should Be Equal ${direction} ${Expected_Direction_1} - + Should Be Equal ${direction} ${Expected_Direction_1} + # Extract object2 from Array ${severity_1}= Get Variable Value ${config["content"]["thresholds"][1]["severity"]} - Should Be Equal ${severity_1} ${Expected_Severity_2} + Should Be Equal ${severity_1} ${Expected_Severity_2} ${Thresold_Value_1}= Get Variable Value ${config["content"]["thresholds"][1]["thresholdValue"]} - Should Be Equal ${Thresold_Value_1} ${Expected_Threshold_2} + Should Be Equal ${Thresold_Value_1} ${Expected_Threshold_2} ${direction_1}= Get Variable Value ${config["content"]["thresholds"][1]["direction"]} - Should Be Equal ${direction_1} ${Expected_Direction_2} - + Should Be Equal ${direction_1} ${Expected_Direction_2} + Get Configs VDNS Policy [Documentation] Get Config Policy for VDNS ${getconfigpolicy}= Catenate .*vLoadBalancer* @@ -107,26 +108,26 @@ Get Configs VDNS Policy Should Be Equal As Strings ${get_resp.status_code} 200 ${json}= Parse Json ${get_resp.content} ${config}= Parse Json ${json[0]["config"]} - - # Extract object1 from Array + + # Extract object1 from Array ${severity}= Get Variable Value ${config["content"]["thresholds"][0]["severity"]} - Should Be Equal ${severity} ${Expected_Severity_3} + Should Be Equal ${severity} ${Expected_Severity_3} ${Thresold_Value}= Get Variable Value ${config["content"]["thresholds"][0]["thresholdValue"]} - Should Be Equal ${Thresold_Value} ${Expected_Threshold_3} + Should Be Equal ${Thresold_Value} ${Expected_Threshold_3} ${direction}= Get Variable Value ${config["content"]["thresholds"][0]["direction"]} - Should Be Equal ${direction} ${Expected_Direction_3} + Should Be Equal ${direction} ${Expected_Direction_3} Teardown Closed Loop [Documentation] Tear down a closed loop test case - Terminate All Processes - Teardown VNF - Log Teardown complete + Terminate All Processes + Teardown VNF + Log Teardown complete Create Config Policy - [Documentation] Create Config Policy - ${randompolicyname} = Create Policy Name + [Documentation] Create Config Policy + ${randompolicyname} = Create Policy Name ${policyname1}= Catenate com.${randompolicyname} - ${CONFIG_POLICY_NAME}= Set Test Variable ${policyname1} + ${CONFIG_POLICY_NAME}= Set Test Variable ${policyname1} ${configpolicy}= Create Dictionary policy_name=${CONFIG_POLICY_NAME} ${output} = Fill JSON Template File ${CREATE_CONFIG_TEMPLATE} ${configpolicy} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} @@ -134,27 +135,27 @@ Create Config Policy Create Policy Name [Documentation] Generate Policy Name - [Arguments] ${prefix}=ETE_ + [Arguments] ${prefix}=ETE_ ${random}= Generate Random String 15 [LOWER][NUMBERS] ${policyname}= Catenate ${prefix}${random} [Return] ${policyname} - + Create Ops Policy - [Documentation] Create Opertional Policy - ${randompolicyname} = Create Policy Name + [Documentation] Create Opertional Policy + ${randompolicyname} = Create Policy Name ${policyname1}= Catenate com.${randompolicyname} - ${OPS_POLICY_NAME}= Set Test Variable ${policyname1} + ${OPS_POLICY_NAME}= Set Test Variable ${policyname1} ${dict}= Create Dictionary policy_name=${OPS_POLICY_NAME} #${NEWPOLICY1}= Create Dictionary policy_name=com.${OPS_POLICY_NAME} ${output} = Fill JSON Template File ${CREATE_OPS_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} Log ${put_resp} Should Be Equal As Strings ${put_resp.status_code} 200 - + Push Ops Policy [Documentation] Push Ops Policy [Arguments] ${policyname} ${policytype} - ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} + ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} ${output} = Fill JSON Template ${PUSH_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 @@ -162,40 +163,40 @@ Push Ops Policy Push Config Policy [Documentation] Push Config Policy [Arguments] ${policyname} ${policytype} - ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} + ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} ${output} = Fill JSON Template ${PUSH_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} Should Be Equal As Strings ${put_resp.status_code} 200 - - + + Delete Config Policy [Documentation] Delete Config Policy [Arguments] ${policy_name} ${policyname3}= Catenate com.Config_BRMS_Param_${policyname}.1.xml - ${dict}= Create Dictionary policy_name=${policyname3} + ${dict}= Create Dictionary policy_name=${policyname3} ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - + Should Be Equal As Strings ${put_resp.status_code} 200 + Delete Ops Policy [Documentation] Delete Ops Policy [Arguments] ${policy_name} ${policyname3}= Catenate com.Config_MS_com.vFirewall.1.xml - ${dict}= Create Dictionary policy_name=${policyname3} + ${dict}= Create Dictionary policy_name=${policyname3} ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict} ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - + Should Be Equal As Strings ${put_resp.status_code} 200 + Orchestrate VNF vFW closedloop [Documentation] VNF Orchestration for vFW - Log VNF Orchestration flow TEST NAME=${TEST NAME} - Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_OPENSTACK_SERVICE_REGION} SharedNode OwnerType v1 CloudZone - ${stack_name} ${service}= Orchestrate VNF ETE_CLP vFW vFW ${GLOBAL_OPENSTACK_SERVICE_REGION} ${TENANT_NAME} - [Return] ${stack_name} - + 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} + [Return] ${stack_name} + Orchestrate VNF vDNS closedloop [Documentation] VNF Orchestration for vLB - Log VNF Orchestration flow TEST NAME=${TEST NAME} - Setup Orchestrate VNF ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_OPENSTACK_SERVICE_REGION} SharedNode OwnerType v1 CloudZone - ${stack_name} ${service}= Orchestrate VNF ETE_CLP vLB vLB ${GLOBAL_OPENSTACK_SERVICE_REGION} ${TENANT_NAME} - [Return] ${stack_name} + 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 vLB vLB ${TENANT_NAME} + [Return] ${stack_name} diff --git a/robot/resources/test_templates/model_test_template.robot b/robot/resources/test_templates/model_test_template.robot index e97984d5..add942db 100644 --- a/robot/resources/test_templates/model_test_template.robot +++ b/robot/resources/test_templates/model_test_template.robot @@ -2,7 +2,7 @@ Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields Library OperatingSystem Library ArchiveLibrary -Library Collections +Library Collections Resource ../asdc_interface.robot Variables ../../assets/service_mappings.py @@ -17,8 +17,9 @@ ${VVG_DIRECTORY} base_vvg ${SCALING_DIRECTORY} dns_scaling ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp -${CATALOG_RESOURCE_IDS} -${CATALOG_SERVICE_ID} +#***************** Test Case Variables ********************* +${CATALOG_RESOURCE_IDS} +${CATALOG_SERVICE_ID} *** Keywords *** @@ -28,30 +29,29 @@ Model Distribution For Directory ${ziplist}= Create List :for ${directory} in @{directory_list} \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${directory}.zip - \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} + \ ${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} + \ 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} 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} - + [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} + Teardown Model Distribution [Documentation] Clean up at the end of the test - Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} - Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} - + Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} + Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} + Teardown Models [Documentation] Clean up at the end of the test [Arguments] ${catalog_service_id} ${catalog_resource_ids} Return From Keyword If '${catalog_service_id}' == '' :for ${catalog_resource_id} in @{catalog_resource_ids} - \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} + \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id} ${services_json}= Delete Inactive ASDC Catalog Services ${resources_json}= Delete Inactive ASDC Catalog Resources - \ No newline at end of file diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index 8c648951..9de590b9 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -25,6 +25,7 @@ Library Collections *** Variables *** +#**************** TEST CASE VARIABLES ************************** ${TENANT_NAME} ${TENANT_ID} ${REGIONS} @@ -38,7 +39,8 @@ ${SERVICE_INSTANCE_ID} Orchestrate VNF [Documentation] Use openECOMP to Orchestrate a service. - [Arguments] ${customer_name} ${service} ${product_family} ${lcp_region} ${tenant} + [Arguments] ${customer_name} ${service} ${product_family} ${tenant} + ${lcp_region}= Get Openstack Region ${uuid}= Generate UUID Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid} Set Test Variable ${SERVICE} ${service} @@ -48,7 +50,7 @@ Orchestrate VNF ${vf_module_name}= Catenate Vfmodule_Ete_Name${uuid} ${service_model_type} ${vnf_type} ${vf_modules} = 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} ${GLOBAL_OPENSTACK_SERVICE_REGION} + 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} @@ -68,7 +70,8 @@ Orchestrate VNF 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} + [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${cloud_owner} + ${cloud_region_id}= Get Openstack Region ${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} @@ -76,7 +79,7 @@ Create Customer For VNF Setup Orchestrate VNF [Documentation] Called before each test case to ensure tenant and region data ... required by the Orchstrate VNF exists in A&AI - [Arguments] ${cloud_owner} ${cloud_region_id} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} + [Arguments] ${cloud_owner} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} Initialize Tenant From Openstack Initialize Regions From Openstack :FOR ${region} IN @{REGIONS} @@ -120,9 +123,10 @@ Get VVG Preload Parameters Teardown VNF [Documentation] Called at the end of a test case to tear down the VNF created by Orchestrate VNF + ${lcp_region}= Get Openstack Region Teardown VVG Server Run Keyword If '${TEST STATUS}' == 'PASS' Teardown VLB Closed Loop Hack - Run Keyword If '${TEST STATUS}' == 'PASS' Teardown VID ${SERVICE_INSTANCE_ID} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${TENANT_ID} + Run Keyword If '${TEST STATUS}' == 'PASS' Teardown VID ${SERVICE_INSTANCE_ID} ${lcp_region} ${TENANT_ID} Run Keyword If '${TEST STATUS}' == 'PASS' Teardown Model Distribution Run Keyword If '${TEST STATUS}' == 'PASS' Clean A&AI Inventory Close All Browsers diff --git a/robot/resources/vid/create_vid_vnf.robot b/robot/resources/vid/create_vid_vnf.robot index a306637e..7417772f 100644 --- a/robot/resources/vid/create_vid_vnf.robot +++ b/robot/resources/vid/create_vid_vnf.robot @@ -9,114 +9,114 @@ Library RequestsLibrary Resource ../mso_interface.robot Resource vid_interface.robot - -*** Keywords *** - + +*** Keywords *** + 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} + [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} Go To VID HOME Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a Wait Until Page Contains Please search by timeout=60s #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s - - # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + + # 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} Click Button button=Submit Wait Until Page Contains Element link=View/Edit timeout=60s - Click Element xpath=//a[contains(text(), 'View/Edit')] + Click Element xpath=//a[contains(text(), 'View/Edit')] Wait Until Page Contains View/Edit Service Instance timeout=60s #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiVisible'] timeout=120s #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiVisible'] timeout=60s Click Element button=Add VNF - + # This is where firefox breaks. Th elink never becomes visible when run with the script. Click Element link=${vnf_type} Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s - - ## Without this sleep, the input text below gets immediately wiped out. + + ## Without this sleep, the input text below gets immediately wiped out. ## Wait Until Angular Ready just sleeps for its timeout value Sleep 10s Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name} - Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family} - Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} - Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family} + 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=120 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] - Should Not Contain ${response text} FAILED + Should Not Contain ${response text} FAILED Click Element button=Close ${instance_id}= Parse Instance Id ${response text} Wait Until Page Contains ${service_instance_name} 60s - [Return] ${instance_id} + [Return] ${instance_id} -Delete VID VNF - [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} +Delete VID VNF + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} Go To VID HOME Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a Wait Until Page Contains Please search by timeout=60s Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s - - # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + + # 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} Click Button button=Submit Wait Until Page Contains Element link=View/Edit timeout=60s - Click Element link=View/Edit + Click Element link=View/Edit Wait Until Page Contains View/Edit Service Instance timeout=60s Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s - - - Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s - Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} - Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + + + Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s + 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 xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1] - + ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] ${request_id}= Parse Request Id ${response text} 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} + +Create VID VNF module + [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} Go To VID HOME Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a Wait Until Page Contains Please search by timeout=60s Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s - - # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + + # 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} Click Button button=Submit Wait Until Page Contains Element link=View/Edit timeout=60s - Click Element link=View/Edit + Click Element link=View/Edit Wait Until Page Contains View/Edit Service Instance timeout=60s 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 + Wait Until Element Is Visible button=Add VF-Module timeout=120s Click Element button=Add VF-Module - + # This is where firefox breaks. Th elink never becomes visible when run with the script. Click Element link=${vnf_type} Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s - - ## Without this sleep, the input text below gets immediately wiped out. + + ## Without this sleep, the input text below gets immediately wiped out. ## Wait Until Angular Ready just sleeps for its timeout value Sleep 10s - 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} + 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} Click Element button=Confirm Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=120 - ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Click Element button=Close ${instance_id}= Parse Instance Id ${response text} - + ${request_id}= Parse Request Id ${response text} Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE - - [Return] ${instance_id} \ No newline at end of file + + [Return] ${instance_id} \ No newline at end of file -- cgit 1.2.3-korg