Added keyword to get the rloc object pointed to by hop_index.
[integration/test.git] / csit / libraries / LISPFlowMapping.robot
index cd11661f788aae09f01641af51408db8b5b433bc..79571cc7d713a78778b5f9bc7885ed3c7637ce0a 100644 (file)
@@ -5,7 +5,7 @@ Documentation     This resource file defines keywords that are used in more
 ...               variables are coming from.
 
 *** Variables ***
-${JSON_DIR}      ${CURDIR}/../variables/lispflowmapping/Be
+${JSON_DIR}       ${CURDIR}/../variables/lispflowmapping/Be
 
 *** Keywords ***
 Authentication Key Should Be
@@ -42,6 +42,15 @@ Get Ipv4 Rloc
     ${ipv4}=    Get From Dictionary    ${loc}    ipv4
     [Return]    ${ipv4}
 
+Get Elp Hop
+    [Arguments]    ${loc_record}    ${hop_index}
+    [Documentation]    Returns the Rloc object pointed to by ${hop_index}
+    ${rloc}=    Get From Dictionary    ${loc_record}    rloc
+    ${exp_loc_path}=    Get From Dictionary    ${rloc}    explicit-locator-path
+    ${actual_hop_index}=    Evaluate    ${hop_index} - 1
+    ${hop}=    Get From List    ${exp_loc_path}     ${actual_hop_index}
+    [Return]    ${hop}
+
 Check Mapping Removal
     [Arguments]    ${json}
     Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}    404