Fix dom rpc broker suites 21/56721/4
authorPeter Gubka <pgubka@cisco.com>
Tue, 9 May 2017 12:26:50 +0000 (14:26 +0200)
committerVratko Polák <vrpolak@cisco.com>
Wed, 10 May 2017 11:32:26 +0000 (11:32 +0000)
- add comments
- change test setup - rpc (de)registration has to be
  performed only once at the start/end of the suite
- removed checking isolated node

Change-Id: I6553a27da323cba9fe0a13a1d8cfc964e4f91fc3
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal.robot
csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal_longevity.robot
csit/suites/controller/dom_rpc_broker/rpc_provider_precedence_longevity.robot

index f2bb7c89d460f259175fde0f6b08e0929bdffe66..6778c9cd9d448bb6cbd5e9fcff2d8f19c9a63af3 100644 (file)
@@ -23,7 +23,6 @@ Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
 *** Variables ***
 @{INSTALLED_RPC_MEMEBER_IDX_LIST}    ${1}    ${2}
 ${TESTED_MEMBER_WITHOUT_RPC_IDX}    ${3}
-@{NON_WORKING_RPC_STATUS_CODE}    ${501}
 
 *** Test Cases ***
 Register_Rpc_On_Two_Nodes
@@ -45,13 +44,7 @@ Isolate_One_Node
     BuiltIn.Set_Suite_Variable    ${isolated_idx}
     DrbCommons.Isolate_Node    ${isolated_idx}
 
-Invoke_Rpc_On_Isolated_Node
-    [Documentation]    Invoke rpc on isolated node. Because rpc is registered on this node, local constant
-    ...    is expected.
-    BuiltIn.Pass_Execution    Aaa has a problem to authenticate http request as it is out of cluster too (see bug 8214), skipping for now.
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    DrbCommons.Verify_Constant_On_Registered_Node    ${isolated_idx}
-
-Invoke_Rpc_On_Remaining_Nodes
+Invoke_Rpc_On_Nonisolated_Nodes
     [Documentation]    Invoke rpc on non-islolated nodes.
     BuiltIn.Wait_Until_Keyword_Succeeds    45s    5s    DrbCommons.Verify_Constant_On_Active_Nodes
 
index 59c4a980e2ad90f3674ed1010fc6c9beb54e423c..edb11e60b38865e06108d3faf9ccfa017430816a 100644 (file)
@@ -21,13 +21,17 @@ Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
 
 *** Variables ***
+@{INSTALLED_RPC_MEMEBER_IDX_LIST}    ${1}    ${2}
+# TODO: Consider unregistering one at random for each iteration, as in the precedence longevity suite.
+${TESTED_MEMBER_WITHOUT_RPC_IDX}    ${3}
 ${DURATION_24_HOURS_IN_SECONDS}    86400
-@{NON_WORKING_RPC_STATUS_CODE_LIST}    ${501}
 
 *** Test Cases ***
 Rpc_Provider_Precedence_Longevity
-    [Documentation]    FIXME: Add a documentation.
+    [Documentation]    Test register rpc on two of three nodes and repeat the tested scenario for 24h.
+    DrbCommons.Register_Rpc_On_Nodes    ${INSTALLED_RPC_MEMEBER_IDX_LIST}
     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario
+    DrbCommons.Unregister_Rpc_On_Nodes    ${INSTALLED_RPC_MEMEBER_IDX_LIST}
 
 *** Keywords ***
 Setup_Kw
@@ -36,33 +40,10 @@ Setup_Kw
     DrbCommons.DrbCommons_Init
 
 Test_Scenario
-    [Documentation]    FIXME: Add a documentation.
-    Setup_Test_Scenario_Variables
-    DrbCommons.Register_Rpc_On_Nodes    ${installed_rpc_member_idx_list}
+    [Documentation]    Isolate and rejoin one of the registrated nodes while testing expected constants.
     DrbCommons.Verify_Constant_On_Active_Nodes
-    ${isolated_idx} =    DrbCommons.Get_Constant_Index_From_Node    ${tested_member_without_rpc_idx}
+    ${isolated_idx} =    DrbCommons.Get_Constant_Index_From_Node    ${TESTED_MEMBER_WITHOUT_RPC_IDX}
     DrbCommons.Isolate_Node    ${isolated_idx}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    DrbCommons.Verify_Constant_On_Registered_Node    ${isolated_idx}
-    DrbCommons.Verify_Constant_On_Active_Nodes
+    BuiltIn.Wait_Until_Keyword_Succeeds    45s    1s    DrbCommons.Verify_Constant_On_Active_Nodes
     DrbCommons.Rejoin_Node    ${isolated_idx}
-    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    20s    3s    DrbCommons.Verify_Constant_On_Active_Nodes
-    DrbCommons.Isolate_Node    ${tested_member_without_rpc_idx}
-    BuiltIn.Wait_Until_Keyword_Succeeds    15s    2s    MdsalLowlevel.Get_Constant    ${tested_member_without_rpc_idx}    explicit_status_codes=${NON_WORKING_RPC_STATUS_CODE_LIST}
-    DrbCommons.Rejoin_Node    ${tested_member_without_rpc_idx}
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    3s    DrbCommons.Verify_Constant_On_Unregistered_Node    ${tested_member_without_rpc_idx}
-    DrbCommons.Unregister_Rpc_On_Nodes    ${installed_rpc_member_idx_list}
-
-Setup_Test_Scenario_Variables
-    [Documentation]    Create several variables for test scenario run.
-    ...    ${installed_rpc_member_idx_list} - members where the rpc will be installed
-    ...    ${tested_member_without_rpc_idx} - one member to be tested where rpc is not installed
-    ...    ${non_installed_rpc_member_idx_list} - members without rpc installed
-    ...    This supports more thatn 3 node odl setup.
-    ${idx1}    ${idx2}    ${idx3} =    BuiltIn.Evaluate    random.sample(${all_indices}, 3)    modules=random
-    ${installed_rpc_member_idx_list}    BuiltIn.Create_list    ${idx1}    ${idx2}
-    BuiltIn.Set_Suite_Variable    ${installed_rpc_member_idx_list}
-    BuiltIn.Set_Suite_Variable    ${tested_member_without_rpc_idx}    ${idx3}
-    ${non_installed_rpc_member_idx_list} =    ClusterManagement.List_All_Indices
-    : FOR    ${index}    IN    @{installed_rpc_member_idx_list}
-    \    ${non_installed_rpc_member_idx_list} =    ClusterManagement.List_Indices_Minus_Member    ${index}    ${non_installed_rpc_member_idx_list}
-    BuiltIn.Set_Suite_Variable    ${non_installed_rpc_member_idx_list}
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    20s    1s    DrbCommons.Verify_Constant_On_Active_Nodes
index 9b31583bc73a4a070ce66c56c86f3122b1e92b32..2799a8cdeaa2bcfac68b8288f5b9896ca749bd92 100644 (file)
@@ -25,8 +25,10 @@ ${DURATION_24_HOURS_IN_SECONDS}    86400
 
 *** Test Cases ***
 Rpc_Provider_Precedence_Longevity
-    [Documentation]    FIXME: Add a documentation.
+    [Documentation]    Repeat the tested scenario for 24h.
+    DrbCommons.Register_Rpc_On_Nodes    ${all_indices}
     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario
+    DrbCommons.Unregister_Rpc_On_Nodes    ${all_indices}
 
 *** Keywords ***
 Setup_Keyword
@@ -35,8 +37,7 @@ Setup_Keyword
     DrbCommons.DrbCommons_Init
 
 Test_Scenario
-    [Documentation]    FIXME: Add a documentation.
-    DrbCommons.Register_Rpc_On_Nodes    ${all_indices}
+    [Documentation]    Test randomly unregister rpc on one node while testing checking expected constants.
     ${unregistered_rpc_node} =    BuiltIn.Evaluate    random.choice(${all_indices})    modules=random
     ${unregistered_rpc_node} =    BuiltIn.Convert_To_Integer    ${unregistered_rpc_node}
     DrbCommons.Verify_Constant_On_Registered_Nodes    ${all_indices}
@@ -45,4 +46,3 @@ Test_Scenario
     DrbCommons.Verify_Constant_On_Registered_Nodes    ${registered_indices}
     DrbCommons.Register_Rpc_And_Update_Possible_Constants    ${unregistered_rpc_node}
     DrbCommons.Verify_Constant_On_Registered_Nodes    ${all_indices}
-    DrbCommons.Unregister_Rpc_On_Nodes    ${all_indices}