diff options
author | DR695H <dr695h@att.com> | 2019-07-19 18:20:40 -0400 |
---|---|---|
committer | Gary Wu <gary.wu@futurewei.com> | 2019-07-22 20:30:51 +0000 |
commit | d979465ec6720dffbebd22bd83104ea5a5f4e65e (patch) | |
tree | 584f93eed3328a3dcdf195d26855717491fac304 /robot/resources/aai | |
parent | fe131258f17c871a738a3fd6b1b73c056a5a5978 (diff) |
replace aai keywords with aai lib
Issue-ID: TEST-174
Change-Id: Id4fd63c8f25cd695f77c3e81f658c8dbd99914f4
Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robot/resources/aai')
-rw-r--r-- | robot/resources/aai/aai_interface.robot | 63 | ||||
-rw-r--r-- | robot/resources/aai/add-relationship-list.robot | 13 | ||||
-rw-r--r-- | robot/resources/aai/ccvpn-connectivities.robot | 37 | ||||
-rw-r--r-- | robot/resources/aai/ccvpn-vpn-bindings.robot | 41 | ||||
-rw-r--r-- | robot/resources/aai/create_availability_zone.robot | 23 | ||||
-rw-r--r-- | robot/resources/aai/create_complex.robot | 20 | ||||
-rw-r--r-- | robot/resources/aai/create_customer.robot | 16 | ||||
-rw-r--r-- | robot/resources/aai/create_service.robot | 24 | ||||
-rw-r--r-- | robot/resources/aai/create_tenant.robot | 30 | ||||
-rw-r--r-- | robot/resources/aai/create_vnfc.robot | 22 | ||||
-rw-r--r-- | robot/resources/aai/create_zone.robot | 22 | ||||
-rw-r--r-- | robot/resources/aai/network.robot | 13 | ||||
-rw-r--r-- | robot/resources/aai/service_instance.robot | 35 | ||||
-rw-r--r-- | robot/resources/aai/volume_group.robot | 4 |
14 files changed, 188 insertions, 175 deletions
diff --git a/robot/resources/aai/aai_interface.robot b/robot/resources/aai/aai_interface.robot index 5580033f..cc8475fa 100644 --- a/robot/resources/aai/aai_interface.robot +++ b/robot/resources/aai/aai_interface.robot @@ -2,6 +2,7 @@ Documentation The main interface for interacting with A&AI. It handles low level stuff like managing the http request library and A&AI required fields Library RequestsLibrary Library ONAPLibrary.Utilities +Library ONAPLibrary.AAI WITH NAME AAI Resource ../global_properties.robot *** Variables *** @@ -13,66 +14,20 @@ ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AA *** Keywords *** Run A&AI Health Check [Documentation] Runs an A&AI health check - ${resp}= Run A&AI Get Request ${AAI_HEALTH_PATH} - Should Be Equal As Strings ${resp.status_code} 200 - -Run A&AI Get Request - [Documentation] Runs an A&AI get request - [Arguments] ${data_path} - Disable Warnings - ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} - ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth} - ${uuid}= Generate UUID4 - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Get Request aai ${data_path} headers=${headers} - Log Received response from aai ${resp.text} - [Return] ${resp} - -Run A&AI Put Request - [Documentation] Runs an A&AI put request - [Arguments] ${data_path} ${data} - Disable Warnings - ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} - ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth} - ${uuid}= Generate UUID4 - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Put Request aai ${data_path} data=${data} headers=${headers} - Log Received response from aai ${resp.text} - [Return] ${resp} - -Run A&AI Post Request - [Documentation] Runs an A&AI Post request - [Arguments] ${data_path} ${data} - Disable Warnings ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} - ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth} - ${uuid}= Generate UUID4 - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Post Request aai ${data_path} data=${data} headers=${headers} - Log Received response from aai ${resp.text} - [Return] ${resp} - -Run A&AI Delete Request - [Documentation] Runs an A&AI delete request - [Arguments] ${data_path} ${resource_version} - Disable Warnings - ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} - ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth} - ${uuid}= Generate UUID4 - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Delete Request aai ${data_path}?resource-version=${resource_version} headers=${headers} - Log Received response from aai ${resp.text} - [Return] ${resp} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_HEALTH_PATH} auth=${auth} + Should Be Equal As Strings ${resp.status_code} 200 Delete A&AI Entity [Documentation] Deletes an entity in A&AI [Arguments] ${uri} - ${get_resp}= Run A&AI Get Request ${VERSIONED_INDEX_PATH}${uri} - Run Keyword If '${get_resp.status_code}' == '200' Delete A&AI Entity Exists ${uri} ${get_resp.json()['resource-version']} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} auth=${auth} + Run Keyword If '${resp.status_code}' == '200' Delete A&AI Entity Exists ${uri} ${resp.json()['resource-version']} Delete A&AI Entity Exists [Documentation] Deletes an A&AI entity [Arguments] ${uri} ${resource_version_id} - ${put_resp}= Run A&AI Delete Request ${VERSIONED_INDEX_PATH}${uri} ${resource_version_id} - Should Be Equal As Strings ${put_resp.status_code} 204 - + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} ${resource_version_id} auth=${auth} + Should Be Equal As Strings ${put_resp.status_code} 204
\ No newline at end of file diff --git a/robot/resources/aai/add-relationship-list.robot b/robot/resources/aai/add-relationship-list.robot index 7b353498..95363fdf 100644 --- a/robot/resources/aai/add-relationship-list.robot +++ b/robot/resources/aai/add-relationship-list.robot @@ -5,7 +5,8 @@ Documentation Operations on relationship-list sub-object in AAI, Resource aai_interface.robot Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${AAI_RELATIONSHIPLIST_PATH} relationship-list @@ -18,9 +19,10 @@ Add Relationship [Documentation] Adds Relationship sub-object to existing object in AAI [Arguments] ${api_version_base_object_url} ${related_class_name} ${related_object_url} ${arguments}= Create Dictionary related_class_name=${related_class_name} related_object_url=${related_object_url} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_RELATIONSHIP_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_RELATIONSHIP_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ @@ -34,7 +36,8 @@ Get RelationshipList Get Object With Depth [Documentation] Return Object with Depth parameter to show RelationshipList [Arguments] ${api_version_base_object_url} - ${resp}= Run A&AI Get Request ${api_version_base_object_url}${AAI_RELATIONSHIP_DEPTH} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${api_version_base_object_url}${AAI_RELATIONSHIP_DEPTH} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 Log Returning response ${resp.json()} [Return] ${resp.json()}
\ No newline at end of file diff --git a/robot/resources/aai/ccvpn-connectivities.robot b/robot/resources/aai/ccvpn-connectivities.robot index 7e18709c..df783970 100644 --- a/robot/resources/aai/ccvpn-connectivities.robot +++ b/robot/resources/aai/ccvpn-connectivities.robot @@ -6,7 +6,8 @@ Resource api_version_properties.robot Resource add-relationship-list.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${AAI_CONN_ROOT_PATH} /network/connectivities/connectivity @@ -20,7 +21,8 @@ ${AAI_CONN_API_IMPL_INDEX_PATH}= ${AAI_CASABLANCA_INDEX_PATH} Create Connectivity If Not Exists [Documentation] Creates Connectivity in AAI if it doesn't exist [Arguments] ${connectivity_id} - ${get_resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Create Connectivity ${connectivity_id} @@ -28,62 +30,71 @@ Create Connectivity [Documentation] Creates Connectivity in AAI [Arguments] ${connectivity_id} ${arguments}= Create Dictionary connectivity_id=${connectivity_id} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_CONNECTIVITY_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_CONNECTIVITY_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete Connectivity If Exists [Documentation] Removes Connectivity from AAI if it exists [Arguments] ${connectivity_id} - ${get_resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Connectivity ${connectivity_id} ${get_resp.json()} Delete Connectivity [Documentation] Removes Connectivity from AAI [Arguments] ${connectivity_id} ${json} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get Connectivity [Documentation] Return Connectivity [Arguments] ${connectivity_id} - ${resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Valid Connectivity URL [Documentation] Return Valid Connectivity URL [Arguments] ${connectivity_id} - ${resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} Get Nodes Query Connectivity [Documentation] Return Nodes query Connectivity [Arguments] ${connectivity_id} - ${resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_NODES_PATH}?connectivity-id=${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_NODES_PATH}?connectivity-id=${connectivity_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Example Connectivity [Documentation] Return Example Connectivity - ${resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_EXAMPLES_PATH} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_EXAMPLES_PATH} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Confirm No Connectivity [Documentation] Confirm No Connectivity [Arguments] ${connectivity_id} - ${resp}= Run A&AI Get Request ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 404 Confirm API Not Implemented Connectivity [Documentation] Confirm latest API version where Connectivity is not implemented [Arguments] ${connectivity_id} - ${resp}= Run A&AI Get Request ${AAI_CONN_API_NA_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_NA_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 400 Add Connectivity Relationship diff --git a/robot/resources/aai/ccvpn-vpn-bindings.robot b/robot/resources/aai/ccvpn-vpn-bindings.robot index 67789e27..192753e0 100644 --- a/robot/resources/aai/ccvpn-vpn-bindings.robot +++ b/robot/resources/aai/ccvpn-vpn-bindings.robot @@ -8,7 +8,8 @@ Resource api_version_properties.robot Resource add-relationship-list.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${AAI_VPNB_ROOT_PATH} /network/vpn-bindings/vpn-binding @@ -22,7 +23,8 @@ ${AAI_VPNB_API_IMPL_INDEX_PATH}= ${AAI_CASABLANCA_INDEX_PATH} Create VPN Binding If Not Exists [Documentation] Creates VPN Binding in AAI if it doesn't exist [Arguments] ${vpn_id} - ${get_resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Create VPN Binding ${vpn_id} @@ -30,65 +32,66 @@ Create VPN Binding [Documentation] Creates VPN Binding in AAI [Arguments] ${vpn_id} ${arguments}= Create Dictionary vpn_id=${vpn_id} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_VPNBINDING_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_VPNBINDING_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete VPN Binding If Exists [Documentation] Removes VPN Binding from AAI if it exists [Arguments] ${vpn_id} - ${get_resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete VPN Binding ${vpn_id} ${get_resp.json()} Delete VPN Binding [Documentation] Removes VPN Binding from AAI [Arguments] ${vpn_id} ${json} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get VPN Binding [Documentation] Return VPN Binding [Arguments] ${vpn_id} - ${resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Valid VPN Binding URL [Documentation] Return Valid VPN Binding URL [Arguments] ${vpn_id} - ${resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} Get Nodes Query VPN Binding [Documentation] Return Nodes query VPN Binding [Arguments] ${vpn_id} - ${resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_NODES_PATH}?vpn-id=${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_NODES_PATH}?vpn-id=${vpn_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Example VPN Binding [Documentation] Return Example VPN Binding - ${resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_EXAMPLES_PATH} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_EXAMPLES_PATH} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Confirm No VPN Binding [Documentation] Confirm No VPN Binding [Arguments] ${vpn_id} - ${resp}= Run A&AI Get Request ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_VPNB_API_IMPL_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 404 -# Not applicable to VPN Binding as it appears in all known API versions -# Confirm API Not Implemented VPN Binding - # [Documentation] Confirm latest API version where VPN Binding is not implemented - # [Arguments] ${vpn_id} - # ${resp}= Run A&AI Get Request ${AAI_VPNB_API_NA_INDEX_PATH}${AAI_VPNB_ROOT_PATH}/${vpn_id} - # Should Be Equal As Strings ${resp.status_code} 400 - Add VPN Binding Relationship [Documentation] Adds Relationship to existing VPN Binding in AAI [Arguments] ${vpn_id} ${related_class_name} ${related_object_url} diff --git a/robot/resources/aai/create_availability_zone.robot b/robot/resources/aai/create_availability_zone.robot index 8bc7b640..af05faf9 100644 --- a/robot/resources/aai/create_availability_zone.robot +++ b/robot/resources/aai/create_availability_zone.robot @@ -4,7 +4,9 @@ Documentation Create availability zone in A&AI. Resource aai_interface.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI + *** Variables *** ${AZ_ROOT_PATH} /cloud-infrastructure/cloud-regions/cloud-region @@ -16,7 +18,8 @@ ${AAI_ADD_AVAILABILITY_ZONE_BODY} aai/add_availability_zone_body.jinja Create Availability Zone If Not Exists [Documentation] Creates availability zone in A&AI if it doesn't exist [Arguments] ${cloud-owner} ${cloud-region-id} ${availability_zone_name}=${GLOBAL_AAI_AVAILABILITY_ZONE_NAME} - ${get_resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Create Availability Zone ${availability_zone_name} ${cloud-owner} ${cloud-region-id} @@ -24,27 +27,31 @@ Create Availability Zone [Documentation] Creates availability zone in A&AI [Arguments] ${availability_zone_name} ${cloud-owner} ${cloud-region-id} ${arguments}= Create Dictionary availability_zone_name=${availability_zone_name} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_AVAILABILITY_ZONE_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_AVAILABILITY_ZONE_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete Availability Zone If Exists [Documentation] Removes availability zone [Arguments] ${cloud-owner} ${cloud-region-id} ${availability_zone_name}=${GLOBAL_AAI_AVAILABILITY_ZONE_NAME} - ${get_resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Availability Zone ${availability_zone_name} ${cloud-owner} ${cloud-region-id} ${get_resp.json()} Delete Availability Zone [Arguments] ${availability_zone_name} ${cloud-owner} ${cloud-region-id} ${json} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get Availability Zone [Documentation] Return availability zone [Arguments] ${availability_zone_name} ${cloud-owner} ${cloud-region-id} - ${resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${AZ_ROOT_PATH}/${cloud-owner}/${cloud-region-id}${AZ_ZONE_PATH}/${availability_zone_name} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} diff --git a/robot/resources/aai/create_complex.robot b/robot/resources/aai/create_complex.robot index 8fed0c79..43a641a0 100644 --- a/robot/resources/aai/create_complex.robot +++ b/robot/resources/aai/create_complex.robot @@ -4,7 +4,8 @@ Documentation Create A&AI Customer API. Resource aai_interface.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** @@ -18,7 +19,8 @@ ${AAI_ADD_COMPLEX_BODY} aai/add_complex_body.jinja Inventory Complex If Not Exists [Documentation] Creates a service in A&AI if it doesn't exist [Arguments] ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} - ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Inventory Complex ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} @@ -32,32 +34,36 @@ Inventory Complex Set To Dictionary ${arguments} owner_defined_type=${owner_defined_type} Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} ${data}= Apply Template aai ${AAI_ADD_COMPLEX_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${data} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete Complex If Exists [Documentation] Removes a complex [Arguments] ${physical_location_id} - ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} Run Keyword If '${get_resp.status_code}' == '200' Delete Complex ${physical_location_id} ${get_resp.json()} Delete Complex [Arguments] ${physical_location_id} ${json} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get Complex [Documentation] Return a complex [Arguments] ${physical_location_id} - ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Complexes [Documentation] Return all complexes - ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEXES_PATH} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${COMPLEX_INDEX_PATH}${ROOT_COMPLEXES_PATH} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.json()} [Return] ${resp.json()}
\ No newline at end of file diff --git a/robot/resources/aai/create_customer.robot b/robot/resources/aai/create_customer.robot index ecae4d3a..f1ebe936 100644 --- a/robot/resources/aai/create_customer.robot +++ b/robot/resources/aai/create_customer.robot @@ -3,7 +3,8 @@ Documentation Create A&AI Customer API. Resource aai_interface.robot Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${INDEX PATH} /aai/v11 @@ -16,9 +17,10 @@ Create Customer [Documentation] Creates a customer in A&AI [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} ${arguments}= Create Dictionary subscriber_name=${customer_name} global_customer_id=${customer_id} subscriber_type=${customer_type} cloud_owner1=${clouder_owner} cloud_region_id1=${cloud_region_id} tenant_id1=${tenant_id} service1=${service_type} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${A&AI ADD CUSTOMER BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${A&AI ADD CUSTOMER BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} @@ -26,12 +28,14 @@ Create Customer Delete Customer [Documentation] Deletes a customer in A&AI [Arguments] ${customer_id} - ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Customer Exists ${customer_id} ${get_resp.json()['resource-version']} *** Keywords *** Delete Customer Exists [Documentation] Deletes a customer in A&AI [Arguments] ${customer_id} ${resource_version_id} - ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 diff --git a/robot/resources/aai/create_service.robot b/robot/resources/aai/create_service.robot index cbf04676..b4e21bb0 100644 --- a/robot/resources/aai/create_service.robot +++ b/robot/resources/aai/create_service.robot @@ -4,7 +4,8 @@ Documentation Create A&AI Customer API. Resource aai_interface.robot Library Collections Library ONAPLibrary.Utilities -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** @@ -27,14 +28,14 @@ Create Service [Arguments] ${service_type} ${uuid}= Generate UUID4 ${arguments}= Create Dictionary service_type=${service_type} UUID=${uuid} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_SERVICE_BODY} ${arguments} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_SERVICE_BODY} ${arguments} ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} - ${put_resp}= Run A&AI Put Request ${fullpath} ${data} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${fullpath} ${data} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} - Delete Service If Exists [Documentation] Deletes a service in A&AI if it exists [Arguments] ${service_type} @@ -48,13 +49,14 @@ Delete Service ${uuid}= Get From Dictionary ${dict} service-id ${resource_version}= Get From Dictionary ${dict} resource-version ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} - ${resp}= Run A&AI Delete Request ${fullpath} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${fullpath} ${resource_version} auth=${auth} Should Be Equal As Strings ${resp.status_code} 204 - Get Services [Documentation] Creates a service in A&AI - ${resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_SERVICE_PATH} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_SERVICE_PATH} auth=${auth} ${dict}= Create Dictionary ${status} ${value}= Run Keyword And Ignore Error Should Be Equal As Strings ${resp.status_code} 200 Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} @@ -62,10 +64,8 @@ Get Services Update Service Dictionary [Arguments] ${dict} ${json} - ${list}= Evaluate ${json}['service'] + @{list}= Copy List ${json['service']} :FOR ${map} IN @{list} \ ${status} ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} - Log ${dict} - - + Log ${dict}
\ No newline at end of file diff --git a/robot/resources/aai/create_tenant.robot b/robot/resources/aai/create_tenant.robot index 1e9fa802..08e70ce7 100644 --- a/robot/resources/aai/create_tenant.robot +++ b/robot/resources/aai/create_tenant.robot @@ -3,7 +3,8 @@ Documentation Create A&AI Customer API. Resource aai_interface.robot Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** @@ -25,9 +26,10 @@ Inventory Tenant [Arguments] ${cloud_owner} ${cloud_region_id} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${tenant_id} ${tenant_name} ${json_resource_version}= Get Resource Version If Exists ${cloud_owner} ${cloud_region_id} ${cloud_type} ${owner_defined_type} ${cloud_region_version} ${cloud_zone} ${arguments}= Create Dictionary cloud_owner=${cloud_owner} cloud_region_id=${cloud_region_id} cloud_type=${cloud_type} owner_defined_type=${owner_defined_type} cloud_region_version=${cloud_region_version} cloud_zone=${cloud_zone} tenant_id=${tenant_id} tenant_name=${tenant_name} resource_version=${json_resource_version} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_TENANT_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_TENANT_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ @@ -45,31 +47,36 @@ Get Resource Version If Exists Delete Tenant [Documentation] Removes both Tenant [Arguments] ${tenant_id} ${cloud_owner} ${cloud_region_id} - ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants/tenant/${tenant_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants/tenant/${tenant_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Tenant Exists ${tenant_id} ${cloud_owner} ${cloud_region_id} ${get_resp.json()['resource-version']} Delete Tenant Exists [Arguments] ${tenant_id} ${cloud_owner} ${cloud_region_id} ${resource_version} - ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants/tenant/${tenant_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants/tenant/${tenant_id} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Delete Cloud Region [Documentation] Removes both Tenant and Cloud Region in A&AI [Arguments] ${tenant_id} ${cloud_owner} ${cloud_region_id} - ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Cloud Region Exists ${tenant_id} ${cloud_owner} ${cloud_region_id} ${get_resp.json()['resource-version']} Delete Cloud Region Exists [Documentation] Delete may get status 400 (Bad Request) if the region is still referenced [Arguments] ${tenant_id} ${cloud_owner} ${cloud_region_id} ${resource_version} - ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} ${resource_version} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(204|400)$ Get Tenants [Documentation] Return list of tenants for this cloud owner/region [Arguments] ${cloud_owner} ${cloud_region_id} - ${resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id}/tenants auth=${auth} ${dict}= Create Dictionary ${status} ${value}= Run Keyword And Ignore Error Should Be Equal As Strings ${resp.status_code} 200 Run Keyword If '${status}' == 'PASS' Update Tenant Dictionary ${dict} ${resp.json()} @@ -78,12 +85,13 @@ Get Tenants Get Cloud Region [Documentation] Returns the Cloud Region if it exists [Arguments] ${cloud_owner} ${cloud_region_id} - ${resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${ROOT_TENANT_PATH}${cloud_owner}/${cloud_region_id} auth=${auth} [Return] ${resp} Update Tenant Dictionary [Arguments] ${dict} ${json} - ${list}= Evaluate ${json}['tenant'] + @{list}= Copy List ${json['tenant']} :FOR ${map} IN @{list} \ ${status} ${tenant_id}= Run Keyword And Ignore Error Get From Dictionary ${map} tenant-id \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${tenant_id}=${map} diff --git a/robot/resources/aai/create_vnfc.robot b/robot/resources/aai/create_vnfc.robot index de79f468..16f9ef30 100644 --- a/robot/resources/aai/create_vnfc.robot +++ b/robot/resources/aai/create_vnfc.robot @@ -4,7 +4,8 @@ Documentation Create VNFC in AAI Resource aai_interface.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${VNFC_ROOT_PATH} /network/vnfcs/vnfc @@ -15,7 +16,8 @@ ${AAI_ADD_VNFC_BODY}= aai/add_vnfc_body.jinja Create VNFC If Not Exists [Documentation] Creates VNFC in A&AI if it doesn't exist [Arguments] ${vnfc_name} ${vnfc_nc} ${vnfc_func} - ${get_resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Create VNFC ${vnfc_name} ${vnfc_nc} ${vnfc_func} @@ -23,28 +25,32 @@ Create VNFC [Documentation] Creates VNFC in A&AI [Arguments] ${vnfc_name} ${vnfc_nc} ${vnfc_func} ${arguments}= Create Dictionary vnfc_name=${vnfc_name} vnfc_nc=${vnfc_nc} vnfc_func=${vnfc_func} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_VNFC_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_VNFC_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete VNFC If Exists [Documentation] Removes VNFC from AAI if it exists [Arguments] ${vnfc_name} - ${get_resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete VNFC ${vnfc_name} ${get_resp.json()} Delete VNFC [Documentation] Removes VNFC from AAI [Arguments] ${vnfc_name} ${json} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} ${resource_version} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get VNFC [Documentation] Return VNFC [Arguments] ${vnfc_name} - ${resp}= Run A&AI Get Request ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_INDEX_PATH}${VNFC_ROOT_PATH}/${vnfc_name} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} diff --git a/robot/resources/aai/create_zone.robot b/robot/resources/aai/create_zone.robot index 644817c9..bb6577d1 100644 --- a/robot/resources/aai/create_zone.robot +++ b/robot/resources/aai/create_zone.robot @@ -4,7 +4,8 @@ Documentation Create A&AI Customer API. Resource aai_interface.robot Library OperatingSystem Library Collections -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** @@ -17,7 +18,8 @@ ${AAI_ADD_ZONE_BODY}= aai/add_zone_body.jinja Inventory Zone If Not Exists [Documentation] Creates a service in A&AI if it doesn't exist [Arguments] ${zone_id}=${GLOBAL_AAI_ZONE_ID} ${zone_name}=${GLOBAL_AAI_ZONE_NAME} ${design_type}=${GLOBAL_AAI_DESIGN_TYPE} ${zone_context}=${GLOBAL_AAI_ZONE_CONTEXT} - ${get_resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} auth=${auth} Return From Keyword If '${get_resp.status_code}' == '200' Inventory Zone ${zone_id} ${zone_name} ${design_type} ${zone_context} @@ -25,27 +27,31 @@ Inventory Zone [Documentation] Inventorys a Tenant in A&AI [Arguments] ${zone_id} ${zone_name} ${design_type} ${zone_context} ${arguments}= Create Dictionary zone_id=${zone_id} zone_name=${zone_name} design_type=${design_type} zone_context=${zone_context} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${AAI_ADD_ZONE_BODY} ${arguments} - ${put_resp}= Run A&AI Put Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${data} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template aai ${AAI_ADD_ZONE_BODY} ${arguments} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${data} auth=${auth} ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|200)$ Delete Zone [Documentation] Removes both Tenant [Arguments] ${zone_id}=${GLOBAL_AAI_ZONE_ID} - ${get_resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} auth=${auth} Run Keyword If '${get_resp.status_code}' == '200' Delete Zone Exists ${zone_id} ${get_resp.json()} Delete Zone Exists [Arguments] ${zone_id} ${json} ${resource_version}= Catenate ${json['resource-version']} - ${put_resp}= Run A&AI Delete Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${resource_version} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} ${resource_version} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 204 Get Zone [Documentation] Return zone [Arguments] ${zone_id} - ${resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} auth=${auth} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} diff --git a/robot/resources/aai/network.robot b/robot/resources/aai/network.robot index 8229a7e4..bb74d388 100644 --- a/robot/resources/aai/network.robot +++ b/robot/resources/aai/network.robot @@ -3,6 +3,7 @@ Documentation Validate A&AI Serivce Instance Resource aai_interface.robot Library Collections +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${INDEX_PATH} /aai/v11 @@ -14,17 +15,15 @@ ${SERVICE_INSTANCE} /service-instances?service-instance-name= Validate Network [Documentation] Query and Validates A&AI Service Instance [Arguments] ${service_instance_name} ${service_type} ${customer_id} - ${resp}= Run A&AI Get Request ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE}${service_instance_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE}${service_instance_name} auth=${auth} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} - - -*** Keywords *** Create Network [Documentation] Query and Validates A&AI Service Instance [Arguments] ${customer_id} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} ${json_string}= Catenate { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]} - ${put_resp}= Run A&AI Put Request ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}/VDNS ${json_string} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}/VDNS ${json_string} auth=${auth} Should Be Equal As Strings ${put_resp.status_code} 201 - [Return] ${put_resp.status_code} - + [Return] ${put_resp.status_code}
\ No newline at end of file diff --git a/robot/resources/aai/service_instance.robot b/robot/resources/aai/service_instance.robot index 6c110977..cca1eaf6 100644 --- a/robot/resources/aai/service_instance.robot +++ b/robot/resources/aai/service_instance.robot @@ -1,14 +1,13 @@ *** Settings *** Documentation Validate A&AI Serivce Instance -... -... Validate A&AI Serivce Instance Resource aai_interface.robot Library Collections Library OperatingSystem Library RequestsLibrary Library ONAPLibrary.JSON -Library ONAPLibrary.Templating +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.AAI WITH NAME AAI Resource ../stack_validation/validate_vlb.robot Resource ../stack_validation/validate_vfw.robot Resource ../stack_validation/validate_vvg.robot @@ -35,19 +34,21 @@ ${VLB_CLOSED_LOOP_VNF_ID} Validate 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} - ${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} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${cust_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}/business/customers?subscriber-name=${customer_name} auth=${auth + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${CUSTOMER SPEC PATH}${cust_resp.json()['customer'][0]['global-customer-id']}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} auth=${auth Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} 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} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${generic_vnf}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-name=${vnf_name} auth=${auth Dictionary Should Contain Value ${generic_vnf.json()} ${vnf_name} ${returned_vnf_type}= Get From Dictionary ${generic_vnf.json()} vnf-type Should Contain ${returned_vnf_type} ${vnf_type} ${vnf_id}= Get From Dictionary ${generic_vnf.json()} vnf-id - ${generic_vnf}= Run A&AI Get Request ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}?depth=all + ${generic_vnf}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}/network/generic-vnfs/generic-vnf/${vnf_id}?depth=all auth=${auth [Return] ${generic_vnf.json()} VLB Closed Loop Hack @@ -61,10 +62,11 @@ VLB Closed Loop Hack ${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} - ${datapath}= Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} - Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Apply Template aai ${VLB_CLOSED_LOOP_HACK_BODY} ${dict} - ${put_resp}= Run A&AI Put Request ${INDEX PATH}${datapath} ${data} + ${datapath}= Templating.Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} + Templating.Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${data}= Templating.Apply Template aai ${VLB_CLOSED_LOOP_HACK_BODY} ${dict} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${INDEX PATH}${datapath} ${data} auth=${auth ${status_string}= Convert To String ${put_resp.status_code} Should Match Regexp ${status_string} ^(201|412)$ Set Test Variable ${VLB_CLOSED_LOOP_DELETE} ${datapath} @@ -73,16 +75,17 @@ VLB Closed Loop Hack 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} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} ${dict}= Create Dictionary vnf_id=${VLB_CLOSED_LOOP_VNF_ID} vf_module_name=${stack_name} - ${query}= Template String ${GENERIC_VNF_QUERY_TEMPLATE} ${dict} - ${get_resp}= Run A&AI Get Request ${INDEX_PATH}${query} + ${query}= Templating.Template String ${GENERIC_VNF_QUERY_TEMPLATE} ${dict} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${query} auth=${auth ${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} - ${resp}= Run A&AI Put Request ${INDEX_PATH}${uri} ${json} - ${get_resp}= Run A&AI Get Request ${INDEX_PATH}${query} + ${uri}= Templating.Template String ${GENERIC_VNF_PATH_TEMPLATE} ${dict} + ${resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${uri} ${json} auth=${auth + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${query} auth=${auth Teardown VLB Closed Loop Hack Return From Keyword If ' ${VLB_CLOSED_LOOP_DELETE}' == '' diff --git a/robot/resources/aai/volume_group.robot b/robot/resources/aai/volume_group.robot index c9fc0f84..8277ec74 100644 --- a/robot/resources/aai/volume_group.robot +++ b/robot/resources/aai/volume_group.robot @@ -3,6 +3,7 @@ Documentation Validate A&AI Serivce Instance Resource aai_interface.robot Library Collections +Library ONAPLibrary.AAI WITH NAME AAI *** Variables *** ${INDEX_PATH} /aai/v11 @@ -13,5 +14,6 @@ ${SERVICE_INSTANCE} /service-instances?service-instance-name= *** Keywords *** Validate Volume Group [Arguments] ${service_instance_name} ${service_type} ${customer_id} - ${resp}= Run A&AI Get Request ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE}${service_instance_name} + ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE}${service_instance_name} auth=${auth} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name}
\ No newline at end of file |