Convert Sleep to WUKS in lispflowmapping CSIT
[integration/test.git] / csit / suites / lispflowmapping / msmr / 030_RPC_Datatypes.robot
index 41afb035519a4ce7bcbe9cdccf3eb5fa978b86ad..4d02bbfca0feacacabde95b6e95c13749cc1b3b9 100644 (file)
@@ -67,16 +67,17 @@ Check Datatype
     ${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}
-    # TODO: Keyword to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
-    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
-    ${eid_record}=    Get Eid Record    ${resp}
-    Dictionary Should Contain Key    ${eid_record}    LocatorRecord
+    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}
-    # TODO: Keyword to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
-    Check Mapping Removal    ${RPC_Datatype__current_json}
+    Wait Until Keyword Succeeds    5s    200ms    Check Mapping Removal    ${RPC_Datatype__current_json}
     Set Suite Variable    ${RPC_Datatype__current_json}    ${EMPTY}
+
+Post Log Check LocatorRecord
+    [Arguments]    ${get_mapping}
+    [Documentation]    Extend the 'Post Log Check' keyword to check for the existence of a LocatorRecord
+    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
+    ${eid_record}=    Get Eid Record    ${resp}
+    Dictionary Should Contain Key    ${eid_record}    LocatorRecord