diff options
Diffstat (limited to 'robot/resources/aai/ccvpn-connectivities.robot')
-rw-r--r-- | robot/resources/aai/ccvpn-connectivities.robot | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/robot/resources/aai/ccvpn-connectivities.robot b/robot/resources/aai/ccvpn-connectivities.robot index df783970..25a7bdf5 100644 --- a/robot/resources/aai/ccvpn-connectivities.robot +++ b/robot/resources/aai/ccvpn-connectivities.robot @@ -21,8 +21,7 @@ ${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} - ${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} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} Return From Keyword If '${get_resp.status_code}' == '200' Create Connectivity ${connectivity_id} @@ -32,69 +31,60 @@ Create Connectivity ${arguments}= Create Dictionary connectivity_id=${connectivity_id} 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} + ${put_resp}= AAI.Run Put Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${data} auth=${GLOBAL_AAI_AUTHENTICATION} ${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} - ${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} + ${get_resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} 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']} - ${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} + ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} ${resource_version} auth=${GLOBAL_AAI_AUTHENTICATION} Should Be Equal As Strings ${put_resp.status_code} 204 Get Connectivity [Documentation] Return Connectivity [Arguments] ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Valid Connectivity URL [Documentation] Return Valid Connectivity URL [Arguments] ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} 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} - ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_NODES_PATH}?connectivity-id=${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get Example Connectivity [Documentation] Return Example Connectivity - ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_EXAMPLES_PATH} auth=${GLOBAL_AAI_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Confirm No Connectivity [Documentation] Confirm No Connectivity [Arguments] ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_IMPL_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} 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} - ${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} + ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_CONN_API_NA_INDEX_PATH}${AAI_CONN_ROOT_PATH}/${connectivity_id} auth=${GLOBAL_AAI_AUTHENTICATION} Should Be Equal As Strings ${resp.status_code} 400 Add Connectivity Relationship |