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 Variables ../../../variables/Variables.py
10 Resource ../../../libraries/LISPFlowMapping__Lithium.robot
11 Resource ../../../libraries/Utils.robot
14 ${IPV4_C_KEY} ${JSON_DIR}/rpc_add-key_ipv4.json
15 ${IPV4_RD} ${JSON_DIR}/rpc_get-remove_ipv4.json
16 ${MISS_RD} ${JSON_DIR}/rpc_get-remove_missing.json
17 ${IPV4_U_KEY} ${JSON_DIR}/rpc_update-key_ipv4.json
18 ${IPV4_C_MAP} ${JSON_DIR}/rpc_add-mapping_ipv4_ipv4.json
19 ${IPV4_U_MAP} ${JSON_DIR}/rpc_update-mapping_ipv4_ipv4.json
23 [Documentation] Create a key for an IPv4 EID
24 ${add_key}= OperatingSystem.Get File ${IPV4_C_KEY}
25 Post Log Check ${LFM_RPC_API_LI}:add-key ${add_key}
27 Attempt To Create Key Again
28 [Documentation] Try to overwrite existing IPv4 EID key
29 ${add_key}= OperatingSystem.Get File ${IPV4_C_KEY}
30 Post Log Check ${LFM_RPC_API_LI}:add-key ${add_key} 409
32 Attempt To Read Non-Existing Key
33 [Documentation] Try to read a non-existing key for an IPv4 EID
34 ${get_key}= OperatingSystem.Get File ${MISS_RD}
35 Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} 404
38 [Documentation] Read an existing key for an IPv4 EID
39 ${get_key}= OperatingSystem.Get File ${IPV4_RD}
40 ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key}
41 Authentication Key Should Be ${resp} password
44 [Documentation] Update an existing key for an IPv4 EID
45 ${update_key}= OperatingSystem.Get File ${IPV4_U_KEY}
46 Post Log Check ${LFM_RPC_API_LI}:update-key ${update_key}
49 [Documentation] Read the key updated in the previous test
50 ${get_key}= OperatingSystem.Get File ${IPV4_RD}
51 ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key}
52 Authentication Key Should Be ${resp} updated-password
55 [Documentation] Delete an existing key for an IPv4 EID
56 ${remove_key}= OperatingSystem.Get File ${IPV4_RD}
57 Post Log Check ${LFM_RPC_API_LI}:remove-key ${remove_key}
59 Attempt To Read Deleted Key
60 [Documentation] Try to read the key deleted in the previous test
61 ${get_key}= OperatingSystem.Get File ${IPV4_RD}
62 Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} 404
64 Attempt To Update Non-Existing Key
65 [Documentation] Update a non-existing key for an IPv4 EID
66 ${update_key}= OperatingSystem.Get File ${IPV4_U_KEY}
67 Post Log Check ${LFM_RPC_API_LI}:update-key ${update_key} 404
70 [Documentation] Create a mapping for an IPv4 EID
71 ${add_mapping}= OperatingSystem.Get File ${IPV4_C_MAP}
72 Post Log Check ${LFM_RPC_API_LI}:add-mapping ${add_mapping}
74 Attempt To Read Non-Existing Mapping
75 [Documentation] Try to read a non-existing mapping for an IPv4 EID
76 ${get_mapping}= OperatingSystem.Get File ${MISS_RD}
77 Check Mapping Removal ${get_mapping}
80 [Documentation] Read an existing mapping for an IPv4 EID
81 ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
82 ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${get_mapping}
83 Ipv4 Rloc Should Be ${resp} 10.10.10.10
86 [Documentation] Update an existing mapping for an IPv4 EID
87 ${update_mapping}= OperatingSystem.Get File ${IPV4_U_MAP}
88 Post Log Check ${LFM_RPC_API_LI}:update-mapping ${update_mapping}
91 [Documentation] Read the mapping updated in the previous test
92 ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
93 ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${get_mapping}
94 Ipv4 Rloc Should Be ${resp} 20.20.20.20
97 [Documentation] Delete an existing mapping for an IPv4 EID
98 ${remove_mapping}= OperatingSystem.Get File ${IPV4_RD}
99 Post Log Check ${LFM_RPC_API_LI}:remove-mapping ${remove_mapping}
101 Attempt To Read Deleted Mapping
102 [Documentation] Try to read the mapping deleted in the previous test
103 Sleep 200ms Avoid race conditions
104 ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
105 Check Mapping Removal ${get_mapping}