diff options
Diffstat (limited to 'robot/resources/aai/ccvpn-vpn-bindings.robot')
-rw-r--r-- | robot/resources/aai/ccvpn-vpn-bindings.robot | 41 |
1 files changed, 22 insertions, 19 deletions
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} |