See this thread [1] for more info.
[1] https://lists.opendaylight.org/pipermail/lispflowmapping-dev/2015-December/000532.html
Change-Id: Ied5a1a0eeae2c8c719eb61255855c445e099b340
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
... variables are coming from.
*** Variables ***
-${ODL_VERSION} Be
+${JSON_DIR} ${CURDIR}/../variables/lispflowmapping/Be
*** Keywords ***
Authentication Key Should Be
Get Authentication Key
[Arguments] ${resp}
${output}= Get From Dictionary ${resp.json()} output
- ${authkey}= Run Keyword If "${ODL_VERSION}" == "Li" Get Authentication Key Lithium ${output}
- ... ELSE Get Authentication Key Beryllium ${output}
- [Return] ${authkey}
-
-Get Authentication Key Beryllium
- [Arguments] ${output}
${mapping_authkey}= Get From Dictionary ${output} mapping-authkey
${authkey}= Get From Dictionary ${mapping_authkey} key-string
[Return] ${authkey}
-Get Authentication Key Lithium
- [Arguments] ${output}
- ${authkey}= Get From Dictionary ${output} authkey
- [Return] ${authkey}
-
Ipv4 Rloc Should Be
[Arguments] ${resp} ${address}
[Documentation] Check if the RLOC in the ${resp} is ${address}
Get Eid Record
[Arguments] ${resp}
${output}= Get From Dictionary ${resp.json()} output
- ${eid_record}= Run Keyword If "${ODL_VERSION}" == "Li" Get Eid Record Lithium ${output}
- ... ELSE Get Eid Record Beryllium ${output}
- [Return] ${eid_record}
-
-Get Eid Record Beryllium
- [Arguments] ${output}
${eid_record}= Get From Dictionary ${output} mapping-record
[Return] ${eid_record}
-Get Eid Record Lithium
- [Arguments] ${output}
- ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
- ${eid_record}= Get From List ${eid_record} 0
- [Return] ${eid_record}
-
Get Ipv4 Rloc
- [Arguments] ${loc_record}
- ${ipv4}= Run Keyword If "${ODL_VERSION}" == "Li" Get Ipv4 Rloc Lithium ${loc_record}
- ... ELSE Get Ipv4 Rloc Beryllium ${loc_record}
- [Return] ${ipv4}
-
-Get Ipv4 Rloc Beryllium
[Arguments] ${loc_record}
${loc}= Get From Dictionary ${loc_record} rloc
${ipv4}= Get From Dictionary ${loc} ipv4
[Return] ${ipv4}
-Get Ipv4 Rloc Lithium
- [Arguments] ${loc_record}
- ${loc}= Get From Dictionary ${loc_record} LispAddressContainer
- ${address}= Get From Dictionary ${loc} Ipv4Address
- ${ipv4}= Get From Dictionary ${address} Ipv4Address
- [Return] ${ipv4}
-
Check Mapping Removal
[Arguments] ${json}
- Run Keyword If "${ODL_VERSION}" == "Li" Check Mapping Removal Lithium ${json}
- ... ELSE Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
-
-Check Mapping Removal Lithium
- [Arguments] ${json}
- ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json}
- ${output}= Get From Dictionary ${resp.json()} output
- ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
- ${eid_record_0}= Get From List ${eid_record} 0
- ${action}= Get From Dictionary ${eid_record_0} action
- Should Be Equal As Strings ${action} NativelyForward
-
-Post Log Check
- [Arguments] ${uri} ${body} ${status_code}=200
- [Documentation] Post body to uri, log response content, and check status
- ${resp}= RequestsLibrary.Post session ${uri} ${body}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} ${status_code}
- [Return] ${resp}
-
-Create Session And Set External Variables
- Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
- Run Keyword If "${ODL_VERSION}" == "Li" Set Suite Variable ${LFM_RPC_API} ${LFM_RPC_API_LI}
+ Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
--- /dev/null
+*** Settings ***
+Documentation This resource file defines keywords that are used in more
+... than one lispflowmapping test suite. Those suites include
+... ../variables/Variables.py, which is where some of the
+... variables are coming from.
+
+*** Variables ***
+${JSON_DIR} ${CURDIR}/../variables/lispflowmapping/Li
+
+*** Keywords ***
+Authentication Key Should Be
+ [Arguments] ${resp} ${password}
+ [Documentation] Check if the authentication key in the ${resp} is ${password}
+ ${authkey}= Get Authentication Key ${resp}
+ Should Be Equal As Strings ${authkey} ${password}
+
+Get Authentication Key
+ [Arguments] ${resp}
+ ${output}= Get From Dictionary ${resp.json()} output
+ ${authkey}= Get From Dictionary ${output} authkey
+ [Return] ${authkey}
+
+Ipv4 Rloc Should Be
+ [Arguments] ${resp} ${address}
+ [Documentation] Check if the RLOC in the ${resp} is ${address}
+ ${eid_record}= Get Eid Record ${resp}
+ ${loc_record}= Get From Dictionary ${eid_record} LocatorRecord
+ ${loc_record_0}= Get From List ${loc_record} 0
+ ${ipv4}= Get Ipv4 Rloc ${loc_record_0}
+ Should Be Equal As Strings ${ipv4} ${address}
+
+Get Eid Record
+ [Arguments] ${resp}
+ ${output}= Get From Dictionary ${resp.json()} output
+ ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
+ ${eid_record}= Get From List ${eid_record} 0
+ [Return] ${eid_record}
+
+Get Ipv4 Rloc
+ [Arguments] ${loc_record}
+ ${loc}= Get From Dictionary ${loc_record} LispAddressContainer
+ ${address}= Get From Dictionary ${loc} Ipv4Address
+ ${ipv4}= Get From Dictionary ${address} Ipv4Address
+ [Return] ${ipv4}
+
+Check Mapping Removal
+ [Arguments] ${json}
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${json}
+ ${output}= Get From Dictionary ${resp.json()} output
+ ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
+ ${eid_record_0}= Get From List ${eid_record} 0
+ ${action}= Get From Dictionary ${eid_record_0} action
+ Should Be Equal As Strings ${action} NativelyForward
[Documentation] Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present.
: FOR ${item} IN @{dictionary_item_occurrence}
\ Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}]
+
+Post Log Check
+ [Arguments] ${uri} ${body} ${status_code}=200
+ [Documentation] Post body to ${uri}, log response content, and check status
+ ${resp}= RequestsLibrary.Post session ${uri} ${body}
+ Log ${resp.content}
+ Should Be Equal As Strings ${resp.status_code} ${status_code}
+ [Return] ${resp}
--- /dev/null
+*** Settings ***
+Documentation Test suite to verify CRUD operations using RPCs
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Teardown Delete All Sessions
+Library Collections
+Library OperatingSystem
+Library RequestsLibrary
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+Resource ../../../libraries/LISPFlowMapping__Lithium.robot
+Resource ../../../libraries/Utils.robot
+
+*** Variables ***
+${IPV4_C_KEY} ${JSON_DIR}/rpc_add-key_ipv4.json
+${IPV4_RD} ${JSON_DIR}/rpc_get-remove_ipv4.json
+${MISS_RD} ${JSON_DIR}/rpc_get-remove_missing.json
+${IPV4_U_KEY} ${JSON_DIR}/rpc_update-key_ipv4.json
+${IPV4_C_MAP} ${JSON_DIR}/rpc_add-mapping_ipv4_ipv4.json
+${IPV4_U_MAP} ${JSON_DIR}/rpc_update-mapping_ipv4_ipv4.json
+
+*** Test Cases ***
+Create Key
+ [Documentation] Create a key for an IPv4 EID
+ ${add_key}= OperatingSystem.Get File ${IPV4_C_KEY}
+ Post Log Check ${LFM_RPC_API_LI}:add-key ${add_key}
+
+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
+
+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
+
+Read Key
+ [Documentation] Read an existing key for an IPv4 EID
+ ${get_key}= OperatingSystem.Get File ${IPV4_RD}
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key}
+ Authentication Key Should Be ${resp} password
+
+Update Key
+ [Documentation] Update an 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}
+
+Read Updated Key
+ [Documentation] Read the key updated in the previous test
+ ${get_key}= OperatingSystem.Get File ${IPV4_RD}
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-key ${get_key}
+ Authentication Key Should Be ${resp} updated-password
+
+Delete Key
+ [Documentation] Delete an existing key for an IPv4 EID
+ ${remove_key}= OperatingSystem.Get File ${IPV4_RD}
+ Post Log Check ${LFM_RPC_API_LI}:remove-key ${remove_key}
+
+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
+
+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
+
+Create Mapping
+ [Documentation] Create a mapping for an IPv4 EID
+ ${add_mapping}= OperatingSystem.Get File ${IPV4_C_MAP}
+ Post Log Check ${LFM_RPC_API_LI}:add-mapping ${add_mapping}
+
+Attempt To Read Non-Existing Mapping
+ [Documentation] Try to read a non-existing mapping for an IPv4 EID
+ ${get_mapping}= OperatingSystem.Get File ${MISS_RD}
+ Check Mapping Removal ${get_mapping}
+
+Read Mapping
+ [Documentation] Read an existing mapping for an IPv4 EID
+ ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${get_mapping}
+ Ipv4 Rloc Should Be ${resp} 10.10.10.10
+
+Update Mapping
+ [Documentation] Update an existing mapping for an IPv4 EID
+ ${update_mapping}= OperatingSystem.Get File ${IPV4_U_MAP}
+ Post Log Check ${LFM_RPC_API_LI}:update-mapping ${update_mapping}
+
+Read Updated Mapping
+ [Documentation] Read the mapping updated in the previous test
+ ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${get_mapping}
+ Ipv4 Rloc Should Be ${resp} 20.20.20.20
+
+Delete Mapping
+ [Documentation] Delete an existing mapping for an IPv4 EID
+ ${remove_mapping}= OperatingSystem.Get File ${IPV4_RD}
+ Post Log Check ${LFM_RPC_API_LI}:remove-mapping ${remove_mapping}
+
+Attempt To Read Deleted Mapping
+ [Documentation] Try to read the mapping deleted in the previous test
+ Sleep 200ms Avoid race conditions
+ ${get_mapping}= OperatingSystem.Get File ${IPV4_RD}
+ Check Mapping Removal ${get_mapping}
--- /dev/null
+*** Settings ***
+Documentation Test suite to verify data types using RPCs
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Teardown Delete All Sessions
+Test Setup Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
+Test Teardown Remove Datatype And Check Removal
+Test Template Check Datatype
+Library Collections
+Library OperatingSystem
+Library RequestsLibrary
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+Resource ../../../libraries/LISPFlowMapping__Lithium.robot
+Resource ../../../libraries/Utils.robot
+
+*** Test Cases ***
+IPv4 Prefix
+ [Documentation] Perform mapping operations with an IPv4 EID
+ rpc_add-mapping_ipv4_ipv4.json rpc_get-remove_ipv4.json
+
+IPv6 Prefix
+ [Documentation] Perform mapping operations with an IPv6 EID
+ rpc_add-mapping_ipv6_ipv4.json rpc_get-remove_ipv6.json
+
+MAC Address
+ [Documentation] Perform mapping operations with a MAC address EID
+ rpc_add-mapping_mac_ipv4.json rpc_get-remove_mac.json
+
+Distinguished Name
+ [Documentation] Perform mapping operations with a Distinguished Name EID
+ rpc_add-mapping_dn_ipv4.json rpc_get-remove_dn.json
+
+AS Number
+ [Documentation] Perform mapping operations with an Autonomous System Number EID
+ rpc_add-mapping_as_ipv4.json rpc_get-remove_as.json
+
+Instance ID
+ [Documentation] Perform mapping operations with an IPv4 EID in Instance ID 1
+ rpc_add-mapping_iid_ipv4.json rpc_get-remove_iid.json
+
+Source/Destination
+ [Documentation] Perform mapping operations with a Source/Destination EID
+ rpc_add-mapping_srcdst_ipv4.json rpc_get-remove_srcdst.json
+
+Key/Value
+ [Documentation] Perform mapping operations with a Key/Value EID
+ rpc_add-mapping_kv_ipv4.json rpc_get-remove_kv.json
+
+AFI List
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
+ rpc_add-mapping_ipv4_list.json rpc_get-remove_ipv4.json
+
+Application Data
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
+ rpc_add-mapping_ipv4_appdata.json rpc_get-remove_ipv4.json
+
+Explicit Locator Path
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
+ rpc_add-mapping_ipv4_elp.json rpc_get-remove_ipv4.json
+
+*** Keywords ***
+Check Datatype
+ [Arguments] ${add_mapping_json_file} ${get_mapping_json_file}
+ [Documentation] Perform CRD operations using a specific datatype
+ ${add_mapping}= OperatingSystem.Get File ${JSON_DIR}/${add_mapping_json_file}
+ ${get_mapping}= OperatingSystem.Get File ${JSON_DIR}/${get_mapping_json_file}
+ Set Suite Variable ${RPC_Datatype__current_json} ${get_mapping}
+ Post Log Check ${LFM_RPC_API_LI}:add-mapping ${add_mapping}
+ Sleep 200ms Avoid race conditions
+ ${resp}= Post Log Check ${LFM_RPC_API_LI}:get-mapping ${get_mapping}
+ ${eid_record}= Get Eid Record ${resp}
+ Dictionary Should Contain Key ${eid_record} LocatorRecord
+
+Remove Datatype And Check Removal
+ Variable Should Exist ${RPC_Datatype__current_json}
+ Post Log Check ${LFM_RPC_API_LI}:remove-mapping ${RPC_Datatype__current_json}
+ Sleep 200ms Avoid race conditions
+ Check Mapping Removal ${RPC_Datatype__current_json}
+ Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
+++ /dev/null
-*** Settings ***
-Documentation Test suite to verify Restconf is OK
-Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
-Suite Teardown Delete All Sessions
-Library RequestsLibrary
-Library ../../../libraries/Common.py
-Variables ../../../variables/Variables.py
-Resource ../../../libraries/Utils.robot
-
-*** Variables ***
-${REST_CONTEXT} /restconf/modules
-
-*** Test Cases ***
-Get Controller Modules
- [Documentation] Get the controller modules via Restconf
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ietf-restconf
+++ /dev/null
-*** Settings ***
-Documentation Test suite to verify data types using RPCs
-Suite Setup Create Session And Set External Variables
-Suite Teardown Delete All Sessions
-Test Setup Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
-Test Teardown Remove Datatype And Check Removal
-Test Template Check Datatype
-Library Collections
-Library OperatingSystem
-Library RequestsLibrary
-Library ../../../libraries/Common.py
-Variables ../../../variables/Variables.py
-Resource ../../../libraries/LISPFlowMapping.robot
-Resource ../../../libraries/Utils.robot
-
-*** Variables ***
-${IPV4_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv4_ipv4.json
-${IPV4_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_ipv4.json
-${IPV6_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv6_ipv4.json
-${IPV6_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_ipv6.json
-${MAC_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_mac_ipv4.json
-${MAC_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_mac.json
-${DN_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_dn_ipv4.json
-${DN_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_dn.json
-${AS_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_as_ipv4.json
-${AS_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_as.json
-${IID_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_iid_ipv4.json
-${IID_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_iid.json
-${SD_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_srcdst_ipv4.json
-${SD_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_srcdst.json
-${KV_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_kv_ipv4.json
-${KV_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_kv.json
-${LST_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv4_list.json
-${APP_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv4_appdata.json
-${ELP_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv4_elp.json
-
-*** Test Cases ***
-IPv4 Prefix
- [Documentation] Perform mapping operations with an IPv4 EID
- ${IPV4_C_MAP} ${IPV4_RD}
-
-IPv6 Prefix
- [Documentation] Perform mapping operations with an IPv6 EID
- ${IPV6_C_MAP} ${IPV6_RD}
-
-MAC Address
- [Documentation] Perform mapping operations with a MAC address EID
- ${MAC_C_MAP} ${MAC_RD}
-
-Distinguished Name
- [Documentation] Perform mapping operations with a Distinguished Name EID
- ${DN_C_MAP} ${DN_RD}
-
-AS Number
- [Documentation] Perform mapping operations with an Autonomous System Number EID
- ${AS_C_MAP} ${AS_RD}
-
-Instance ID
- [Documentation] Perform mapping operations with an IPv4 EID in Instance ID 1
- ${IID_C_MAP} ${IID_RD}
-
-Source/Destination
- [Documentation] Perform mapping operations with a Source/Destination EID
- ${SD_C_MAP} ${SD_RD}
-
-Key/Value
- [Documentation] Perform mapping operations with a Key/Value EID
- ${KV_C_MAP} ${KV_RD}
-
-AFI List
- [Documentation] Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
- ${LST_C_MAP} ${IPV4_RD}
-
-Application Data
- [Documentation] Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
- ${APP_C_MAP} ${IPV4_RD}
-
-Explicit Locator Path
- [Documentation] Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
- ${ELP_C_MAP} ${IPV4_RD}
-
-*** Keywords ***
-Check Datatype
- [Arguments] ${add_mapping_json_file} ${get_mapping_json_file}
- [Documentation] Perform CRD operations using a specific datatype
- ${add_mapping}= OperatingSystem.Get File ${add_mapping_json_file}
- ${get_mapping}= OperatingSystem.Get File ${get_mapping_json_file}
- Set Suite Variable ${RPC_Datatype__current_json} ${get_mapping}
- Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping}
- Sleep 200ms Avoid race conditions
- ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${get_mapping}
- ${eid_record}= Get Eid Record ${resp}
- Dictionary Should Contain Key ${eid_record} LocatorRecord
-
-Remove Datatype And Check Removal
- Variable Should Exist ${RPC_Datatype__current_json}
- Post Log Check ${LFM_RPC_API}:remove-mapping ${RPC_Datatype__current_json}
- Sleep 200ms Avoid race conditions
- Check Mapping Removal ${RPC_Datatype__current_json}
- Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
*** Settings ***
Documentation Test suite to verify CRUD operations using RPCs
-Suite Setup Create Session And Set External Variables
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
Suite Teardown Delete All Sessions
Library Collections
Library OperatingSystem
Resource ../../../libraries/Utils.robot
*** Variables ***
-${IPV4_C_KEY} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-key_ipv4.json
-${IPV4_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_ipv4.json
-${MISS_RD} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_get-remove_missing.json
-${IPV4_U_KEY} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_update-key_ipv4.json
-${IPV4_C_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_add-mapping_ipv4_ipv4.json
-${IPV4_U_MAP} ${CURDIR}/../../../variables/lispflowmapping/${ODL_VERSION}/rpc_update-mapping_ipv4_ipv4.json
+${IPV4_C_KEY} ${JSON_DIR}/rpc_add-key_ipv4.json
+${IPV4_RD} ${JSON_DIR}/rpc_get-remove_ipv4.json
+${MISS_RD} ${JSON_DIR}/rpc_get-remove_missing.json
+${IPV4_U_KEY} ${JSON_DIR}/rpc_update-key_ipv4.json
+${IPV4_C_MAP} ${JSON_DIR}/rpc_add-mapping_ipv4_ipv4.json
+${IPV4_U_MAP} ${JSON_DIR}/rpc_update-mapping_ipv4_ipv4.json
*** Test Cases ***
Create Key
--- /dev/null
+*** Settings ***
+Documentation Test suite to verify data types using RPCs
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Teardown Delete All Sessions
+Test Setup Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
+Test Teardown Remove Datatype And Check Removal
+Test Template Check Datatype
+Library Collections
+Library OperatingSystem
+Library RequestsLibrary
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+Resource ../../../libraries/LISPFlowMapping.robot
+Resource ../../../libraries/Utils.robot
+
+*** Test Cases ***
+IPv4 Prefix
+ [Documentation] Perform mapping operations with an IPv4 EID
+ rpc_add-mapping_ipv4_ipv4.json rpc_get-remove_ipv4.json
+
+IPv6 Prefix
+ [Documentation] Perform mapping operations with an IPv6 EID
+ rpc_add-mapping_ipv6_ipv4.json rpc_get-remove_ipv6.json
+
+MAC Address
+ [Documentation] Perform mapping operations with a MAC address EID
+ rpc_add-mapping_mac_ipv4.json rpc_get-remove_mac.json
+
+Distinguished Name
+ [Documentation] Perform mapping operations with a Distinguished Name EID
+ rpc_add-mapping_dn_ipv4.json rpc_get-remove_dn.json
+
+AS Number
+ [Documentation] Perform mapping operations with an Autonomous System Number EID
+ rpc_add-mapping_as_ipv4.json rpc_get-remove_as.json
+
+Instance ID
+ [Documentation] Perform mapping operations with an IPv4 EID in Instance ID 1
+ rpc_add-mapping_iid_ipv4.json rpc_get-remove_iid.json
+
+Source/Destination
+ [Documentation] Perform mapping operations with a Source/Destination EID
+ rpc_add-mapping_srcdst_ipv4.json rpc_get-remove_srcdst.json
+
+Key/Value
+ [Documentation] Perform mapping operations with a Key/Value EID
+ rpc_add-mapping_kv_ipv4.json rpc_get-remove_kv.json
+
+AFI List
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
+ rpc_add-mapping_ipv4_list.json rpc_get-remove_ipv4.json
+
+Application Data
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
+ rpc_add-mapping_ipv4_appdata.json rpc_get-remove_ipv4.json
+
+Explicit Locator Path
+ [Documentation] Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
+ rpc_add-mapping_ipv4_elp.json rpc_get-remove_ipv4.json
+
+*** Keywords ***
+Check Datatype
+ [Arguments] ${add_mapping_json_file} ${get_mapping_json_file}
+ [Documentation] Perform CRD operations using a specific datatype
+ ${add_mapping}= OperatingSystem.Get File ${JSON_DIR}/${add_mapping_json_file}
+ ${get_mapping}= OperatingSystem.Get File ${JSON_DIR}/${get_mapping_json_file}
+ Set Suite Variable ${RPC_Datatype__current_json} ${get_mapping}
+ Post Log Check ${LFM_RPC_API}:add-mapping ${add_mapping}
+ Sleep 200ms Avoid race conditions
+ ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${get_mapping}
+ ${eid_record}= Get Eid Record ${resp}
+ Dictionary Should Contain Key ${eid_record} LocatorRecord
+
+Remove Datatype And Check Removal
+ Variable Should Exist ${RPC_Datatype__current_json}
+ Post Log Check ${LFM_RPC_API}:remove-mapping ${RPC_Datatype__current_json}
+ Sleep 200ms Avoid race conditions
+ Check Mapping Removal ${RPC_Datatype__current_json}
+ Set Suite Variable ${RPC_Datatype__current_json} ${EMPTY}
# Place the suites in run order:
-integration/test/csit/suites/lispflowmapping/basic
+integration/test/csit/suites/lispflowmapping/all
--- /dev/null
+# Place the suites in run order:
+integration/test/csit/suites/lispflowmapping/msmr