2 Documentation Test suite to verify CRUD operations using RPCs
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
6 Library OperatingSystem
7 Library RequestsLibrary
8 Library ../../../libraries/Common.py
9 Library ../../../libraries/JsonGenerator.py
10 Variables ../../../variables/Variables.py
11 Resource ../../../libraries/LISPFlowMapping.robot
12 Resource ../../../libraries/TemplatedRequests.robot
13 Resource ../../../libraries/Utils.robot
17 [Documentation] Create a key for an IPv4 EID
18 ${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
19 ${authkey_json}= Get MappingAuthkey JSON
20 ${add_key}= Merge And Wrap input ${eid_json} ${authkey_json}
21 Post Log Check ${LFM_RPC_API}:add-key ${add_key} status_codes=${ALLOWED_STATUS_CODES}
23 Attempt To Read Non-Existing Key
24 [Documentation] Try to read a non-existing key for an IPv4 EID
25 ${get_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.255/32
26 Post Log Check ${LFM_RPC_API}:get-key ${get_key} status_codes=${DELETED_STATUS_CODES}
29 [Documentation] Read an existing key for an IPv4 EID
30 ${get_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
31 Wait Until Keyword Succeeds 5s 200ms Post Log Check Authkey ${get_key} password
34 [Documentation] Update an existing key for an IPv4 EID
35 ${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
36 ${authkey_json}= Get MappingAuthkey JSON key_string=updated-password
37 ${update_key}= Merge And Wrap input ${eid_json} ${authkey_json}
38 Post Log Check ${LFM_RPC_API}:update-key ${update_key} status_codes=${ALLOWED_STATUS_CODES}
41 [Documentation] Read the key updated in the previous test
42 ${get_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
43 Wait Until Keyword Succeeds 5s 200ms Post Log Check Authkey ${get_key} updated-password
46 [Documentation] Delete an existing key for an IPv4 EID
47 ${remove_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
48 Post Log Check ${LFM_RPC_API}:remove-key ${remove_key} status_codes=${ALLOWED_STATUS_CODES}
50 Attempt To Read Deleted Key
51 [Documentation] Try to read the key deleted in the previous test
52 ${get_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
53 Wait Until Keyword Succeeds 5s 200ms Check Key Removal ${get_key}
55 Attempt To Update Non-Existing Key
56 [Documentation] Update a non-existing key for an IPv4 EID
57 ${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
58 ${authkey_json}= Get MappingAuthkey JSON key_string=updated-password
59 ${update_key}= Merge And Wrap input ${eid_json} ${authkey_json}
60 Post Log Check ${LFM_RPC_API}:update-key ${update_key} status_codes=${DELETED_STATUS_CODES}
63 [Documentation] Create a mapping for an IPv4 EID
64 ${add_mapping}= Get Mapping JSON ipv4:192.0.2.1/32 ipv4:10.10.10.10
65 Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping} status_codes=${ALLOWED_STATUS_CODES}
67 Attempt To Read Non-Existing Mapping
68 [Documentation] Try to read a non-existing mapping for an IPv4 EID
69 ${get_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.255/32
70 Check Mapping Removal ${get_mapping}
73 [Documentation] Read an existing mapping for an IPv4 EID
74 ${get_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
75 Wait Until Keyword Succeeds 5s 200ms Post Log Check Ipv4 Rloc ${get_mapping} 10.10.10.10
78 [Documentation] Update an existing mapping for an IPv4 EID
79 ${update_mapping}= Get Mapping JSON ipv4:192.0.2.1/32 ipv4:20.20.20.20
80 Post Log Check ${LFM_RPC_API}:update-mapping ${update_mapping} status_codes=${ALLOWED_STATUS_CODES}
83 [Documentation] Read the mapping updated in the previous test
84 ${get_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
85 Wait Until Keyword Succeeds 5s 200ms Post Log Check Ipv4 Rloc ${get_mapping} 20.20.20.20
88 [Documentation] Delete an existing mapping for an IPv4 EID
89 ${remove_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
90 Post Log Check ${LFM_RPC_API}:remove-mapping ${remove_mapping} status_codes=${ALLOWED_STATUS_CODES}
92 Attempt To Read Deleted Mapping
93 [Documentation] Try to read the mapping deleted in the previous test
94 ${get_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
95 Wait Until Keyword Succeeds 5s 200ms Check Mapping Removal ${get_mapping}