Convert Sleep to WUKS in lispflowmapping CSIT
[integration/test.git] / csit / suites / lispflowmapping / msmr / 020_RPC_CRUD.robot
index 9773f89936a1b8d81cb8c6c13cf98761f68ff874..aec37c7359045145af729c9f5f76b675e4c41fe0 100644 (file)
@@ -26,11 +26,8 @@ Attempt To Read Non-Existing Key
 
 Read Key
     [Documentation]    Read an existing key for an IPv4 EID
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_key}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-key    ${get_key}
-    Authentication Key Should Be    ${resp}    password
+    Wait Until Keyword Succeeds    5s    200ms    Post Log Check Authkey    ${get_key}    password
 
 Update Key
     [Documentation]    Update an existing key for an IPv4 EID
@@ -41,11 +38,8 @@ Update Key
 
 Read Updated Key
     [Documentation]    Read the key updated in the previous test
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_key}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-key    ${get_key}
-    Authentication Key Should Be    ${resp}    updated-password
+    Wait Until Keyword Succeeds    5s    200ms    Post Log Check Authkey    ${get_key}    updated-password
 
 Delete Key
     [Documentation]    Delete an existing key for an IPv4 EID
@@ -54,10 +48,8 @@ Delete Key
 
 Attempt To Read Deleted Key
     [Documentation]    Try to read the key deleted in the previous test
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_key}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    Post Log Check    ${LFM_RPC_API}:get-key    ${get_key}    404
+    Wait Until Keyword Succeeds    5s    200ms    Check Key Removal    ${get_key}
 
 Attempt To Update Non-Existing Key
     [Documentation]    Update a non-existing key for an IPv4 EID
@@ -78,11 +70,8 @@ Attempt To Read Non-Existing Mapping
 
 Read Mapping
     [Documentation]    Read an existing mapping for an IPv4 EID
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_mapping}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
-    Ipv4 Rloc Should Be    ${resp}    10.10.10.10
+    Wait Until Keyword Succeeds    5s    200ms    Post Log Check Ipv4 Rloc    ${get_mapping}    10.10.10.10
 
 Update Mapping
     [Documentation]    Update an existing mapping for an IPv4 EID
@@ -91,11 +80,8 @@ Update Mapping
 
 Read Updated Mapping
     [Documentation]    Read the mapping updated in the previous test
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_mapping}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
-    Ipv4 Rloc Should Be    ${resp}    20.20.20.20
+    Wait Until Keyword Succeeds    5s    200ms    Post Log Check Ipv4 Rloc    ${get_mapping}    20.20.20.20
 
 Delete Mapping
     [Documentation]    Delete an existing mapping for an IPv4 EID
@@ -104,7 +90,5 @@ Delete Mapping
 
 Attempt To Read Deleted Mapping
     [Documentation]    Try to read the mapping deleted in the previous test
-    # TODO: Test to be rewritten to avoid `Sleep` using WUKS
-    Sleep    500ms    Account for cluster propagation delay
     ${get_mapping}=    Get LispAddress JSON And Wrap input    ipv4:192.0.2.1/32
-    Check Mapping Removal    ${get_mapping}
+    Wait Until Keyword Succeeds    5s    200ms    Check Mapping Removal    ${get_mapping}