Convert Sleep to WUKS in lispflowmapping CSIT 71/63271/2
authorLorand Jakab <lojakab@cisco.com>
Tue, 19 Sep 2017 09:11:12 +0000 (12:11 +0300)
committerJamo Luhrsen <jluhrsen@redhat.com>
Wed, 20 Sep 2017 23:38:42 +0000 (23:38 +0000)
Part 2, 020_RPC_CRUD.robot

Change-Id: Ibdce362fbb6e87e0221878832be57474717e59e9
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
csit/libraries/LISPFlowMapping.robot
csit/suites/lispflowmapping/msmr/020_RPC_CRUD.robot
csit/suites/lispflowmapping/msmr/030_RPC_Datatypes.robot

index 9dad54ef0fad7e061376c0ec787fb5c3d83308e9..e1efb78d476d8c5ce5178be772180bbb1a61cfe1 100644 (file)
@@ -52,6 +52,10 @@ Get Elp Hop
     ${hop}=    Get From List    ${exp_loc_path}    ${actual_hop_index}
     [Return]    ${hop}
 
+Check Key Removal
+    [Arguments]    ${json}
+    Post Log Check    ${LFM_RPC_API}:get-key    ${json}    404
+
 Check Mapping Removal
     [Arguments]    ${json}
     Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}    404
@@ -65,3 +69,22 @@ Get Mapping JSON
     ${mapping_record_json}=    Get MappingRecord JSON    ${lisp_address}    ${loc_record_list}
     ${mapping}=    Wrap input    ${mapping_record_json}
     [Return]    ${mapping}
+
+Post Log Check Authkey
+    [Arguments]    ${json}    ${password}
+    [Documentation]    Extend the 'Post Log Check' keyword to check for the correct authentication key
+    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-key    ${json}
+    Authentication Key Should Be    ${resp}    ${password}
+
+Post Log Check Ipv4 Rloc
+    [Arguments]    ${json}    ${rloc}
+    [Documentation]    Extend the 'Post Log Check' keyword to check for the correct IPv4 RLOC
+    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}
+    Ipv4 Rloc Should Be    ${resp}    ${rloc}
+
+Post Log Check LocatorRecord
+    [Arguments]    ${json}
+    [Documentation]    Extend the 'Post Log Check' keyword to check for the existence of a LocatorRecord
+    ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}
+    ${eid_record}=    Get Eid Record    ${resp}
+    Dictionary Should Contain Key    ${eid_record}    LocatorRecord
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}
index 4d02bbfca0feacacabde95b6e95c13749cc1b3b9..d6d956386e026cdeaa923e7054f5d7c91c91aa15 100644 (file)
@@ -74,10 +74,3 @@ Remove Datatype And Check Removal
     Post Log Check    ${LFM_RPC_API}:remove-mapping    ${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