aboutsummaryrefslogtreecommitdiffstats
path: root/robot
diff options
context:
space:
mode:
authorDaniel Rose <DR695H@list.att.com>2017-03-02 23:00:02 +0000
committerGerrit Code Review <gerrit@openecomp.org>2017-03-02 23:00:02 +0000
commit29867df64dcff7f94a358de5350d471af47e0fcf (patch)
treeccb166d64a0fdb484db25950327daba2cf29f2a4 /robot
parentb85b164d00146a8a9207773c4cfb32029880b6d4 (diff)
parent1aa4c9d67e0cda753f02ab70f523018ca95e84fd (diff)
Merge "Make teardown of dummy vf_module conditional"
Diffstat (limited to 'robot')
-rw-r--r--robot/resources/demo_preload.robot63
-rw-r--r--robot/resources/test_templates/vnf_orchestration_test_template.robot84
2 files changed, 74 insertions, 73 deletions
diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot
index 92fcafbb..eba91f91 100644
--- a/robot/resources/demo_preload.robot
+++ b/robot/resources/demo_preload.robot
@@ -1,9 +1,9 @@
*** Settings ***
-Documentation This test template encapsulates the VNF Orchestration use case.
+Documentation This test template encapsulates the VNF Orchestration use case.
-Resource test_templates/model_test_template.robot
-Resource test_templates/vnf_orchestration_test_template.robot
-Resource asdc_interface.robot
+Resource test_templates/model_test_template.robot
+Resource test_templates/vnf_orchestration_test_template.robot
+Resource asdc_interface.robot
Library UUID
Library Collections
@@ -16,9 +16,9 @@ Library ExtendedSelenium2Library
${ADD_DEMO_CUSTOMER_BODY} robot/assets/templates/aai/add_demo_customer.template
${AAI_INDEX_PATH} /aai/v8
${VF_MODULES_NAME} _Demo_VFModules.json
-${FILE_CACHE} /share/
+${FILE_CACHE} /share/
-*** Keywords ***
+*** Keywords ***
Load Customer And Models
[Documentation] Use openECOMP to Orchestrate a service.
[Arguments] ${customer_name}
@@ -27,25 +27,25 @@ Load Customer And Models
${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}
+ Sleep 60s
+ Create Customer For VNF Demo ${CUSTOMER_NAME} ${CUSTOMER_NAME} INFRA ${GLOBAL_AAI_CLOUD_OWNER} ${GLOBAL_OPENSTACK_SERVICE_REGION} ${TENANT_ID}
Distribute Model
[Arguments] ${service} ${modelName}
${service_model_type} ${vnf_type} ${vf_modules}= Model Distribution For Directory ${service} ${modelName}
${jsonString}= Evaluate json.dumps(${vf_modules}) json
OperatingSystem.Create File ${FILE_CACHE}${service}${VF_MODULES_NAME} ${jsonString}
-
+
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}
- ${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
- ${data}= Fill JSON Template ${data_template} ${arguments}
+ [Arguments] ${customer_name} ${customer_id} ${customer_type} ${clouder_owner} ${cloud_region_id} ${tenant_id}
+ ${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
+ ${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)$
+ Should Match Regexp ${status_string} ^(201|412)$
Create Service If Not Exists vFW
Create Service If Not Exists vLB
@@ -53,14 +53,14 @@ Create Customer For VNF Demo
Preload Demo
[Arguments] ${vnf_name} ${vf_module_name}
${vf_modules}= Create List
- ${status} ${generic_vnf}= Run Keyword And Ignore Error Get Service Instance ${vnf_name}
+ ${status} ${generic_vnf}= Run Keyword And Ignore Error Get Service Instance ${vnf_name}
Run Keyword If '${status}' == 'FAIL' FAIL VNF Name: ${vnf_name} is not found.
${vnf_type}= Set Variable ${generic_vnf['vnf-type']}
${relationships}= Set Variable ${generic_vnf['relationship-list']['relationship']}
${relationship_data}= Get Relationship Data ${relationships}
- :for ${r} in @{relationship_data}
- \ ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service}
- \ ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id}
+ :for ${r} in @{relationship_data}
+ \ ${service}= Set Variable If '${r['relationship-key']}' == 'service-subscription.service-type' ${r['relationship-value']} ${service}
+ \ ${service_instance_id}= Set Variable If '${r['relationship-key']}' == 'service-instance.service-instance-id' ${r['relationship-value']} ${service_instance_id}
${data}= OperatingSystem.Get File ${FILE_CACHE}${service}${VF_MODULES_NAME}
${vf_modules}= Evaluate json.loads('''${data}''') json
Log ${generic_vnf}
@@ -68,27 +68,28 @@ Preload Demo
Setup Browser
Preload Vnf ${service_instance_id} ${vnf_name} ${vnf_type} ${vf_module_name} ${vf_modules} ${service} demo
[Teardown] Close All Browsers
-
+
Get Relationship Data
[Arguments] ${relationships}
:for ${r} in @{relationships}
- \ ${status} ${relationship_data} Run Keyword And Ignore Error Set Variable ${r['relationship-data']}
- \ Return From Keyword If '${status}' == 'PASS' ${relationship_data}
-
-
+ \ ${status} ${relationship_data} Run Keyword And Ignore Error Set Variable ${r['relationship-data']}
+ \ Return From Keyword If '${status}' == 'PASS' ${relationship_data}
+
+
Get Service Instance
[Arguments] ${vnf_name}
- ${resp}= Run A&AI Get Request ${AAI_INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name}
+ ${resp}= Run A&AI Get Request ${AAI_INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name}
Should Be Equal As Strings ${resp.status_code} 200
- [Return] ${resp.json()}
-
-APPC Mount Point
+ [Return] ${resp.json()}
+
+APPC Mount Point
[Arguments] ${vf_module_name}
Run Openstack Auth Request auth
${status} ${stack_info}= Run Keyword and Ignore Error Wait for Stack to Be Deployed auth ${vf_module_name} timeout=120s
Run Keyword if '${status}' == 'FAIL' FAIL ${vf_module_name} Stack is not found
${stack_id}= Get From Dictionary ${stack_info} id
- ${server_list}= Get Openstack Servers auth
+ ${server_list}= Get Openstack Servers auth
${vpg_name_0}= Get From Dictionary ${stack_info} vpg_name_0
- ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public
- ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_public_ip}
+ ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public
+ ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1
+ ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_oam_ip}
diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot
index a149745a..910b06b2 100644
--- a/robot/resources/test_templates/vnf_orchestration_test_template.robot
+++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Documentation This test template encapsulates the VNF Orchestration use case.
+Documentation This test template encapsulates the VNF Orchestration use case.
Resource ../vid/create_service_instance.robot
Resource ../vid/vid_interface.robot
@@ -25,43 +25,43 @@ Library Collections
*** Variables ***
-${TENANT_NAME}
+${TENANT_NAME}
${TENANT_ID}
${REGIONS}
${CUSTOMER_NAME}
${STACK_NAME}
-${SERVICE}
+${SERVICE}
${VVG_SERVER_ID}
${SERVICE_INSTANCE_ID}
-*** Keywords ***
-
+*** Keywords ***
+
Orchestrate VNF
[Documentation] Use openECOMP to Orchestrate a service.
[Arguments] ${customer_name} ${service} ${product_family} ${lcp_region} ${tenant}
- ${uuid}= Generate UUID
+ ${uuid}= Generate UUID
Set Test Variable ${CUSTOMER_NAME} ${customer_name}_${uuid}
Set Test Variable ${SERVICE} ${service}
- ${vnf_name}= Catenate Vnf_Ete_Name${uuid}
+ ${vnf_name}= Catenate Vnf_Ete_Name${uuid}
${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}
## MSO polling is 60 second intervals
- Sleep 70s
- 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}
- Setup Browser
+ Sleep 70s
+ 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}
+ Setup Browser
Login To VID GUI
${service_instance_id}= 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}
+ 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}
+ 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}
[Return] ${vf_module_name} ${service}
@@ -70,75 +70,75 @@ 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}
- ${resp}= Create Customer ${customer_name} ${customer_id} ${customer_type} ${service_type} ${cloud_owner} ${cloud_region_id} ${TENANT_ID}
+ [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${cloud_owner} ${cloud_region_id}
+ ${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
- ... required by the Orchstrate VNF exists in A&AI
+ [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}
Initialize Tenant From Openstack
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_NAME} ${TENANT_ID}
- Log Orchestrate VNF setup complete
-
+ \ Inventory Tenant If Not Exists ${cloud_owner} ${region} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${TENANT_NAME} ${TENANT_ID}
+ Log Orchestrate VNF setup complete
+
Initialize Tenant From Openstack
[Documentation] Initialize the tenant test variables
Run Openstack Auth Request auth
${tenants}= Get Current Openstack Tenant auth
${tenant_name}= Evaluate $tenants.get("name")
- ${tenant_id}= Evaluate $tenants.get("id")
+ ${tenant_id}= Evaluate $tenants.get("id")
Set Test Variable ${TENANT_NAME} ${tenant_name}
- Set Test Variable ${TENANT_ID} ${tenant_id}
+ Set Test Variable ${TENANT_ID} ${tenant_id}
Initialize Regions From Openstack
[Documentation] Initialize the regions test variable
Run Openstack Auth Request auth
${regs}= Get Openstack Regions auth
- Set Test Variable ${REGIONS} ${regs}
+ Set Test Variable ${REGIONS} ${regs}
Create VVG Server
[Documentation] For the VolumeGroup test case, create a server to attach the volume group to be orchestrated.
- [Arguments] ${uuid}
+ [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}= Get From Dictionary ${server} server
${server_id}= Get From Dictionary ${server} id
Set Test Variable ${VVG_SERVER_ID} ${server_id}
- ${vvg_params}= Get VVG Preload Parameters
+ ${vvg_params}= Get VVG Preload Parameters
Set To Dictionary ${vvg_params} nova_instance ${server_id}
- Wait for Server to Be Active auth ${server_id}
+ Wait for Server to Be Active auth ${server_id}
Get VVG Preload Parameters
- [Documentation] Get preload parameters for the VVG test case so we can include
- ... the nova_instance id of the attached server
+ [Documentation] Get preload parameters for the VVG test case so we can include
+ ... the nova_instance id of the attached server
${test_dict}= Get From Dictionary ${GLOBAL_PRELOAD_PARAMETERS} Vnf-Orchestration
${vvg_params} Get From Dictionary ${test_dict} vvg_preload.template
[Return] ${vvg_params}
-
+
Teardown VNF
[Documentation] Called at the end of a test case to tear down the VNF created by Orchestrate VNF
- Teardown VVG Server
- 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 Model Distribution
- Run Keyword If '${TEST STATUS}' == 'PASS' Clean A&AI Inventory
- Close All Browsers
+ 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 Model Distribution
+ Run Keyword If '${TEST STATUS}' == 'PASS' Clean A&AI Inventory
+ Close All Browsers
Log Teardown VNF implemented for successful tests only
Teardown VVG Server
[Documentation] Teardown the server created as a place to mount the Volume Group.
Return From Keyword if '${VVG_SERVER_ID}' == ''
Delete Server auth ${VVG_SERVER_ID}
- Wait for Server To Be Deleted auth ${VVG_SERVER_ID}
- ${vvg_params}= Get VVG Preload Parameters
+ Wait for Server To Be Deleted auth ${VVG_SERVER_ID}
+ ${vvg_params}= Get VVG Preload Parameters
Remove from Dictionary ${vvg_params} nova_instance
Log Teardown VVG Server Completed
-
+
Teardown Stack
[Documentation] OBSOLETE - Called at the end of a test case to tear down the Stack created by Orchestrate VNF
[Arguments] ${stack}
@@ -152,11 +152,11 @@ Teardown Stack
Run Keyword If '${key_pair_status}' == 'PASS' Delete Openstack Keypair auth ${keypair_name}
Teardown VLB Closed Loop Hack
-Clean A&AI Inventory
- [Documentation] Clean up Tenant in A&AI, Create Customer, Create Service and related relationships
+Clean A&AI Inventory
+ [Documentation] Clean up Tenant in A&AI, Create Customer, Create Service and related relationships
:FOR ${region} IN @{REGIONS}
\ Delete Tenant ${TENANT_ID} ${GLOBAL_AAI_CLOUD_OWNER} ${region}
\ Delete Cloud Region ${TENANT_ID} ${GLOBAL_AAI_CLOUD_OWNER} ${region}
Delete Customer ${CUSTOMER_NAME}
- Delete Service If Exists ${SERVICE}
+ Delete Service If Exists ${SERVICE}