Convert Sleep to WUKS in lispflowmapping CSIT 54/63254/2
authorLorand Jakab <lojakab@cisco.com>
Mon, 18 Sep 2017 21:20:35 +0000 (00:20 +0300)
committerVenkatrangan Govindarajan <venkatrangang@hcl.com>
Tue, 19 Sep 2017 07:02:07 +0000 (07:02 +0000)
Part 1, 030_RPC_Datatypes.robot

Change-Id: I6885a831f40ee2b1ff555de0f67b456ca6e9650e
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
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