Check Key Removal
[Arguments] ${json}
- Post Log Check ${LFM_RPC_API}:get-key ${json} 404
+ Post Log Check ${LFM_RPC_API}:get-key ${json} status_codes=${DELETED_STATUS_CODE}
Check Mapping Removal
[Arguments] ${json}
- Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
+ Post Log Check ${LFM_RPC_API}:get-mapping ${json} status_codes=${DELETED_STATUS_CODE}
Get Mapping JSON
[Arguments] ${eid} ${rloc}
# TODO: Remove overlap with keywords from Utils.robot
BuiltIn.Log ${response.text}
BuiltIn.Log ${response.status_code}
- BuiltIn.Run_Keyword_And_Return_If """${explicit_status_codes}""" != """${NO_STATUS_CODES}""" Collections.List_Should_Contain_Value ${explicit_status_codes} ${response.status_code}
- ${final_allowd_list} = Collections.Combine_Lists ${ALLOWED_STATUS_CODES} ${additional_allowed_status_codes}
+ # In order to allow other existing keywords to consume this keyword by passing a single non-list status code, we need to
+ # check the type of the argument passed and convert those single non-list codes in to a one item list
+ ${status_codes_type} = Evaluate type($additional_allowed_status_codes).__name__
+ ${allowed_status_codes_list} = Run Keyword If "${status_codes_type}"!="list" Create List ${additional_allowed_status_codes}
+ ... ELSE Set Variable ${additional_allowed_status_codes}
+ ${status_codes_type} = Evaluate type($explicit_status_codes).__name__
+ ${explicit_status_codes_list} = Run Keyword If "${status_codes_type}"!="list" Create List ${explicit_status_codes}
+ ... ELSE Set Variable ${explicit_status_codes}
+ BuiltIn.Run_Keyword_And_Return_If """${explicit_status_codes_list}""" != """${NO_STATUS_CODES}""" Collections.List_Should_Contain_Value ${explicit_status_codes_list} ${response.status_code}
+ ${final_allowd_list} = Collections.Combine_Lists ${ALLOWED_STATUS_CODES} ${allowed_status_codes_list}
Collections.List_Should_Contain_Value ${final_allowd_list} ${response.status_code}
Join_Two_Headers
\ Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}]
Post Log Check
- [Arguments] ${uri} ${body} ${status_code}=200 ${session}=session
+ [Arguments] ${uri} ${body} ${session}=session ${status_codes}=200
[Documentation] Post body to ${uri}, log response content, and check status
${resp}= RequestsLibrary.Post Request ${session} ${uri} ${body}
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} ${status_code}
+ TemplatedRequests.Check Status Code ${resp} ${status_codes}
[Return] ${resp}
Get Log File Name
${SUBNET_IPV6} = BuiltIn.Catenate ${substr}0
BuiltIn.Set Suite Variable ${SUBNET_IPV6}
${body} = Genius.Set Json ${vlan} ${gateway_ip} ${SUBNET_IPV6} @{TOOLS_SYSTEM_IPV6_LIST}
- Utils.Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} 204
+ Utils.Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} status_codes=${204}
Get Network Topology with Tunnel
[Arguments] ${url} ${network_topology_list}
Attempt To Create Key Again
[Documentation] Try to overwrite existing IPv4 EID key
${add_key}= OperatingSystem.Get File ${IPV4_C_KEY}
- Post Log Check ${LFM_RPC_API_LI}:add-key ${add_key} 409
+ Post Log Check ${LFM_RPC_API_LI}:add-key ${add_key} status_codes=${409}
Attempt To Read Non-Existing Key
[Documentation] Try to read a non-existing key for an IPv4 EID
${get_key}= OperatingSystem.Get File ${MISS_RD}
- Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} 404
+ Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} status_codes=${404}
Read Key
[Documentation] Read an existing key for an IPv4 EID
Attempt To Read Deleted Key
[Documentation] Try to read the key deleted in the previous test
${get_key}= OperatingSystem.Get File ${IPV4_RD}
- Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} 404
+ Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key} status_codes=${404}
Attempt To Update Non-Existing Key
[Documentation] Update a non-existing key for an IPv4 EID
${update_key}= OperatingSystem.Get File ${IPV4_U_KEY}
- Post Log Check ${LFM_RPC_API_LI}:update-key ${update_key} 404
+ Post Log Check ${LFM_RPC_API_LI}:update-key ${update_key} status_codes=${404}
Create Mapping
[Documentation] Create a mapping for an IPv4 EID
Library ../../../libraries/JsonGenerator.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/LISPFlowMapping.robot
+Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/Utils.robot
*** Test Cases ***
${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
${authkey_json}= Get MappingAuthkey JSON
${add_key}= Merge And Wrap input ${eid_json} ${authkey_json}
- Post Log Check ${LFM_RPC_API}:add-key ${add_key}
+ Post Log Check ${LFM_RPC_API}:add-key ${add_key} status_codes=${ALLOWED_STATUS_CODES}
Attempt To Read Non-Existing Key
[Documentation] Try to read a non-existing key for an IPv4 EID
${get_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.255/32
- Post Log Check ${LFM_RPC_API}:get-key ${get_key} 404
+ Post Log Check ${LFM_RPC_API}:get-key ${get_key} status_codes=${DELETED_STATUS_CODE}
Read Key
[Documentation] Read an existing key for an IPv4 EID
${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
${authkey_json}= Get MappingAuthkey JSON key_string=updated-password
${update_key}= Merge And Wrap input ${eid_json} ${authkey_json}
- Post Log Check ${LFM_RPC_API}:update-key ${update_key}
+ Post Log Check ${LFM_RPC_API}:update-key ${update_key} status_codes=${ALLOWED_STATUS_CODES}
Read Updated Key
[Documentation] Read the key updated in the previous test
Delete Key
[Documentation] Delete an existing key for an IPv4 EID
${remove_key}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
- Post Log Check ${LFM_RPC_API}:remove-key ${remove_key}
+ Post Log Check ${LFM_RPC_API}:remove-key ${remove_key} status_codes=${ALLOWED_STATUS_CODES}
Attempt To Read Deleted Key
[Documentation] Try to read the key deleted in the previous test
${eid_json}= Get LispAddress JSON ipv4:192.0.2.1/32
${authkey_json}= Get MappingAuthkey JSON key_string=updated-password
${update_key}= Merge And Wrap input ${eid_json} ${authkey_json}
- Post Log Check ${LFM_RPC_API}:update-key ${update_key} 404
+ Post Log Check ${LFM_RPC_API}:update-key ${update_key} status_codes=${DELETED_STATUS_CODE}
Create Mapping
[Documentation] Create a mapping for an IPv4 EID
${add_mapping}= Get Mapping JSON ipv4:192.0.2.1/32 ipv4:10.10.10.10
- Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping}
+ Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping} status_codes=${ALLOWED_STATUS_CODES}
Attempt To Read Non-Existing Mapping
[Documentation] Try to read a non-existing mapping for an IPv4 EID
Update Mapping
[Documentation] Update an existing mapping for an IPv4 EID
${update_mapping}= Get Mapping JSON ipv4:192.0.2.1/32 ipv4:20.20.20.20
- Post Log Check ${LFM_RPC_API}:update-mapping ${update_mapping}
+ Post Log Check ${LFM_RPC_API}:update-mapping ${update_mapping} status_codes=${ALLOWED_STATUS_CODES}
Read Updated Mapping
[Documentation] Read the mapping updated in the previous test
Delete Mapping
[Documentation] Delete an existing mapping for an IPv4 EID
${remove_mapping}= Get LispAddress JSON And Wrap input ipv4:192.0.2.1/32
- Post Log Check ${LFM_RPC_API}:remove-mapping ${remove_mapping}
+ Post Log Check ${LFM_RPC_API}:remove-mapping ${remove_mapping} status_codes=${ALLOWED_STATUS_CODES}
Attempt To Read Deleted Mapping
[Documentation] Try to read the mapping deleted in the previous test
${add_mapping}= Get Mapping JSON ${add_mapping_eid} ${add_mapping_rloc}
${get_mapping}= Get LispAddress JSON And Wrap input ${get_mapping_eid}
Set Suite Variable ${RPC_Datatype__current_json} ${get_mapping}
- Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping}
+ Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping} status_codes=${ALLOWED_STATUS_CODES}
Wait Until Keyword Succeeds 5s 200ms Post Log Check LocatorRecord ${get_mapping}
Remove Datatype And Check Removal
Variable Should Exist ${RPC_Datatype__current_json}
- Post Log Check ${LFM_RPC_API}:remove-mapping ${RPC_Datatype__current_json}
+ Post Log Check ${LFM_RPC_API}:remove-mapping ${RPC_Datatype__current_json} status_codes=${ALLOWED_STATUS_CODES}
Wait Until Keyword Succeeds 5s 200ms Check Mapping Removal ${RPC_Datatype__current_json}
Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}