summaryrefslogtreecommitdiffstats
path: root/robot/resources/aai/add-relationship-list.robot
diff options
context:
space:
mode:
authorKeong Lim <keong.lim@huawei.com>2019-03-19 15:44:35 +1100
committerKeong Lim <keong.lim@huawei.com>2019-03-19 15:46:49 +1100
commiteff1eab948cd5624477e56c65db01104f87e7c96 (patch)
tree6c4b3a809e6e19d65f08a0a3a3c25b4b947ad4c1 /robot/resources/aai/add-relationship-list.robot
parent2c0558d9c185638a071666e459bab50dd010f0ed (diff)
AAI-2208 Robot tests for CCVPN and relationships
Add relationship to relationship-list Add vpn-binding keywords Update connectivity keywords Update test cases to relate connectivity to vpn-binding and vice-versa Change-Id: Id23f4603f0df47e737adf481d8b6308a64936ba0 Issue-ID: AAI-2208 Signed-off-by: Keong Lim <keong.lim@huawei.com>
Diffstat (limited to 'robot/resources/aai/add-relationship-list.robot')
-rw-r--r--robot/resources/aai/add-relationship-list.robot43
1 files changed, 43 insertions, 0 deletions
diff --git a/robot/resources/aai/add-relationship-list.robot b/robot/resources/aai/add-relationship-list.robot
new file mode 100644
index 00000000..056b896f
--- /dev/null
+++ b/robot/resources/aai/add-relationship-list.robot
@@ -0,0 +1,43 @@
+*** Settings ***
+Documentation Operations on relationship-list sub-object in AAI,
+... using specified base URL path including API version where it is implemented,
+... relies on system to choose default EdgeRule for the pair of object classes
+
+Resource ../json_templater.robot
+Resource aai_interface.robot
+Resource api_version_properties.robot
+Library OperatingSystem
+Library Collections
+
+
+*** Variables ***
+${AAI_RELATIONSHIPLIST_PATH}= relationship-list
+${AAI_RELATIONSHIP_PATH}= ${AAI_RELATIONSHIPLIST_PATH}/relationship
+${AAI_ADD_RELATIONSHIP_BODY}= robot/assets/templates/aai/add-relationship.template
+${AAI_RELATIONSHIP_DEPTH}= ?depth=1
+
+*** Keywords ***
+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}
+ ${data}= Fill JSON Template File ${AAI_ADD_RELATIONSHIP_BODY} ${arguments}
+ ${put_resp}= Run A&AI Put Request ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH} ${data}
+ ${status_string}= Convert To String ${put_resp.status_code}
+ Should Match Regexp ${status_string} ^(201|200)$
+
+Get RelationshipList
+ [Documentation] Return RelationshipList of the object in AAI
+ [Arguments] ${api_version_base_object_url}
+ ${resp}= Get Object With Depth ${api_version_base_object_url}
+ Log Returning response ${resp['${AAI_RELATIONSHIPLIST_PATH}']}
+ [Return] ${resp['${AAI_RELATIONSHIPLIST_PATH}']}
+
+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}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Log Returning response ${resp.json()}
+ [Return] ${resp.json()}
+