summaryrefslogtreecommitdiffstats
path: root/robot/resources
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-10-24 19:24:27 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-24 19:24:27 +0000
commitc09d468ab783c52ca1e96a47cc0eb2418f587734 (patch)
tree98b77fbf700b06fe06cee10d89665f3f0154ee8a /robot/resources
parent21ea570970282f4f4b9dc3663a9a081657df9c63 (diff)
parentadaa2374a3bbfc972605f33238f0ebd14b946f42 (diff)
Merge "Updates for cloud_config, SDC health, VID timing"
Diffstat (limited to 'robot/resources')
-rw-r--r--robot/resources/asdc_interface.robot15
-rw-r--r--robot/resources/so/create_cloud_config.robot42
-rw-r--r--robot/resources/so_interface.robot24
-rw-r--r--robot/resources/vid/create_vid_vnf.robot2
4 files changed, 78 insertions, 5 deletions
diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot
index 8a5aa3f5..c49f942e 100644
--- a/robot/resources/asdc_interface.robot
+++ b/robot/resources/asdc_interface.robot
@@ -80,11 +80,13 @@ Distribute Model From ASDC
Loop Over Check Catalog Service Distributed
[Arguments] ${catalog_service_id}
- # SO watchdog timeout is 300 seconds
- : FOR ${CHECK_INDEX} IN RANGE 15
- \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id}
+ # SO watchdog timeout is 300 seconds need buffer
+ ${dist_status}= Set Variable FAIL
+ : FOR ${CHECK_INDEX} IN RANGE 20
+ \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
\ Sleep 20s
\ Return From Keyword If '${status}'=='PASS'
+ \ Exit For Loop If '${dist_status}'=='EXIT'
Should Be Equal As Strings ${status} PASS
Setup ASDC Catalog Resource
@@ -398,7 +400,7 @@ Get Catalog Service Distribution
[Return] ${resp.json()}
Check Catalog Service Distributed
[Documentation] gets an asdc catalog Service distrbution
- [Arguments] ${catalog_service_uuid}
+ [Arguments] ${catalog_service_uuid} ${dist_status}
${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
@@ -411,6 +413,8 @@ Check Catalog Service Distributed
\ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
\ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
\ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
+ \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
+ \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
Get Catalog Service Distribution Details
[Documentation] gets an asdc catalog Service distrbution details
@@ -424,13 +428,14 @@ Run ASDC Health Check
${uuid}= Generate UUID
${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
+ # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
${SDC_DE_HEALTH}= Catenate DOWN
@{ITEMS}= Copy List ${resp.json()['componentsInfo']}
:FOR ${ELEMENT} IN @{ITEMS}
\ Log ${ELEMENT['healthCheckStatus']}
\ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
- Should Be Equal As Strings ${SDC_DE_HEALTH} UP SDC_DE DOWN
+ Log Console SDC DMaaP Interface Health: ${SDC_DE_HEALTH}
Run ASDC Get Request
[Documentation] Runs an ASDC get request
[Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
diff --git a/robot/resources/so/create_cloud_config.robot b/robot/resources/so/create_cloud_config.robot
new file mode 100644
index 00000000..be578127
--- /dev/null
+++ b/robot/resources/so/create_cloud_config.robot
@@ -0,0 +1,42 @@
+*** Settings ***
+Documentation Create Cloud Config
+
+Resource ../json_templater.robot
+Resource ../so_interface.robot
+Library OperatingSystem
+Library Collections
+
+
+*** Variables ***
+${CLOUD_CONFIG_PATH} /cloudSite
+
+${SYSTEM USER} robot-ete
+${SO_ADD_CLOUD_CONFIG}= robot/assets/templates/so/create_cloud_config.template
+
+*** Keywords ***
+Create Cloud Configuration
+ [Documentation] Creates a cloud configuration in SO, so it knows how to talk to an openstack cloud
+ [Arguments] ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type}
+ ${arguments}= Create Dictionary site_name=${site_name} region_id=${region_id} clli=${clli} identity_id=${identity_id} identity_url=${identity_url} mso_id=${mso_id} mso_pass=${mso_pass} admin_tenant=${admin_tenant} member_role=${member_role} identity_server_type=${identity_server_type} authentication_type=${authentication_type}
+ ${data}= Fill JSON Template File ${SO_ADD_CLOUD_CONFIG} ${arguments}
+ ${get_resp}= Run SO Catalog Post request ${CLOUD_CONFIG_PATH}/${site_name} ${data}
+
+ ${get_resp}= Run Keyword If '${get_resp.status_code}'=='404' Update Cloud Configuration ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type}
+ Should Be Equal As Strings ${get_resp.status_code} 200
+
+Update Cloud Configuration
+ [Documentation] Updates a cloud configuration in SO
+ [Arguments] ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type}
+ ${arguments}= Create Dictionary site_name=${site_name} region_id=${region_id} clli=${clli} identity_id=${identity_id} identity_url=${identity_url} mso_id=${mso_id} mso_pass=${mso_pass} admin_tenant=${admin_tenant} member_role=${member_role} identity_server_type=${identity_server_type} authentication_type=${authentication_type}
+ ${data}= Fill JSON Template File ${SO_ADD_CLOUD_CONFIG} ${arguments}
+ ${get_resp}= Run SO Catalog Put request ${CLOUD_CONFIG_PATH}/${site_name} ${data}
+ Should Be Equal As Strings ${get_resp.status_code} 200
+ [Return] ${get_resp}
+
+Get Cloud Configuration
+ [Documentation] Gets cloud configuration in SO
+ [Arguments] ${site_name}
+ ${get_resp}= Run MSO Catalog Get request ${CLOUD_CONFIG_PATH}/${site_name}
+ Should Be Equal As Strings ${get_resp.status_code} 200
+
+
diff --git a/robot/resources/so_interface.robot b/robot/resources/so_interface.robot
index 23ab9415..0378caff 100644
--- a/robot/resources/so_interface.robot
+++ b/robot/resources/so_interface.robot
@@ -113,6 +113,30 @@ Run MSO Post request
Log Received response from mso ${resp.text}
[Return] ${resp}
+Run SO Catalog Post request
+ [Documentation] Runs an SO post request
+ [Arguments] ${data_path} ${data} ${so_port}=
+ ${auth}= Create List ${GLOBAL_MSO_CATDB_USERNAME} ${GLOBAL_MSO_PASSWORD}
+ Log Creating session ${SO_CATDB_ENDPOINT}
+ ${session}= Create Session so_catdb ${SO_CATDB_ENDPOINT} auth=${auth}
+ ${uuid}= Generate UUID
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
+ ${resp}= Post Request so_catdb ${data_path} data=${data} headers=${headers}
+ Log Received response from so_catdb ${resp.text}
+ [Return] ${resp}
+
+Run SO Catalog Put request
+ [Documentation] Runs an SO put request
+ [Arguments] ${data_path} ${data} ${so_port}=
+ ${auth}= Create List ${GLOBAL_MSO_CATDB_USERNAME} ${GLOBAL_MSO_PASSWORD}
+ Log Creating session ${SO_CATDB_ENDPOINT}
+ ${session}= Create Session so_catdb ${SO_CATDB_ENDPOINT} auth=${auth}
+ ${uuid}= Generate UUID
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
+ ${resp}= Put Request so_catdb ${data_path} data=${data} headers=${headers}
+ Log Received response from so_catdb ${resp.text}
+ [Return] ${resp}
+
Run MSO Delete request
[Documentation] Runs an MSO Delete request
[Arguments] ${data_path} ${data}
diff --git a/robot/resources/vid/create_vid_vnf.robot b/robot/resources/vid/create_vid_vnf.robot
index 5997b07e..fe0d3e15 100644
--- a/robot/resources/vid/create_vid_vnf.robot
+++ b/robot/resources/vid/create_vid_vnf.robot
@@ -109,6 +109,8 @@ Create VID VNF module
Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name}
Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
+ Wait Until Element Is Visible xpath=//input[@parameter-id='sdncPreload'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
+ Wait Until Element Is Enabled xpath=//input[@parameter-id='sdncPreload'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
Select Checkbox xpath=//input[@parameter-id='sdncPreload']
Click Element button=Confirm
Wait Until Element Contains xpath=//pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}