Add rpc longevity suites 29/53629/7
authorPeter Gubka <pgubka@cisco.com>
Tue, 21 Mar 2017 18:19:04 +0000 (19:19 +0100)
committerVratko Polák <vrpolak@cisco.com>
Fri, 7 Apr 2017 12:35:02 +0000 (12:35 +0000)
Change-Id: I16302649df4f4f5e13a3e66843a9ea1069d5d215
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal_longevity.robot [new file with mode: 0644]
csit/suites/controller/dom_rpc_broker/rpc_provider_precedence_longevity.robot [new file with mode: 0644]
csit/testplans/controller-drb-partnheal-longevity.txt [new file with mode: 0644]
csit/testplans/controller-drb-precedence-longevity.txt [new file with mode: 0644]

diff --git a/csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal_longevity.robot b/csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal_longevity.robot
new file mode 100644 (file)
index 0000000..43aae02
--- /dev/null
@@ -0,0 +1,66 @@
+*** Settings ***
+Documentation     DOMRpcBroker testing: RPC Provider Partition And Heal
+...
+...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+...               This program and the accompanying materials are made available under the
+...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+...               This tests establishes that the RPC service operates correctly when faced
+...               with node failures.
+...               This suite supports more than three node cluster setup too.
+Suite Setup       Setup_Kw
+Suite Teardown    SSHLibrary.Close_All_Connections
+Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags      critical
+Library           SSHLibrary
+Resource          ${CURDIR}/../../../libraries/controller/DrbCommons.robot
+Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
+
+*** Variables ***
+${DURATION_24_HOURS_IN_SECONDS}    86400
+@{NON_WORKING_RPC_STATUS_CODE_LIST}    ${501}
+
+*** Test Cases ***
+Rpc_Provider_Precedence_Longevity
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario
+
+*** Keywords ***
+Setup_Kw
+    [Documentation]    Setup keyword. Create ${possible_constants} list with possible variables of remote constants.
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    DrbCommons.DrbCommons_Init
+
+Test_Scenario
+    Setup_Test_Scenario_Variables
+    DrbCommons.Register_Rpc_On_Nodes    ${installed_rpc_member_idx_list}
+    DrbCommons.Verify_Constant_On_Active_Nodes
+    ${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
+    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}
diff --git a/csit/suites/controller/dom_rpc_broker/rpc_provider_precedence_longevity.robot b/csit/suites/controller/dom_rpc_broker/rpc_provider_precedence_longevity.robot
new file mode 100644 (file)
index 0000000..0b2477e
--- /dev/null
@@ -0,0 +1,46 @@
+*** Settings ***
+Documentation     DOMRpcBroker testing: RPC Provider Precedence
+...
+...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+...               This program and the accompanying materials are made available under the
+...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+...               The aim is to establish that remote RPC implementations have lower priority
+...               than local ones, which is to say that any movement of RPCs on remote nodes
+...               does not affect routing as long as a local implementation is available.
+Suite Setup       Setup_Keyword
+Suite Teardown    SSHLibrary.Close_All_Connections
+Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags      critical
+Library           SSHLibrary
+Resource          ${CURDIR}/../../../libraries/controller/DrbCommons.robot
+Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
+
+*** Variables ***
+${DURATION_24_HOURS_IN_SECONDS}    86400
+
+*** Test Cases ***
+Rpc_Provider_Precedence_Longevity
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario
+
+*** Keywords ***
+Setup_Keyword
+    [Documentation]    Create a list of possible constant responses on the node with unregistered rpc.
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    DrbCommons.DrbCommons_Init
+
+Test_Scenario
+    DrbCommons.Register_Rpc_On_Nodes    ${all_indices}
+    ${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}
+    DrbCommons.Unregister_Rpc_And_Update_Possible_Constants    ${unregistered_rpc_node}
+    DrbCommons.Verify_Constant_On_Unregistered_Node    ${unregistered_rpc_node}
+    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}
diff --git a/csit/testplans/controller-drb-partnheal-longevity.txt b/csit/testplans/controller-drb-partnheal-longevity.txt
new file mode 100644 (file)
index 0000000..b7073c0
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+
+# Place the suites in run order:
+integration/test/csit/suites/controller/dom_rpc_broker/rpc_provider_partition_and_heal_longevity.robot
diff --git a/csit/testplans/controller-drb-precedence-longevity.txt b/csit/testplans/controller-drb-precedence-longevity.txt
new file mode 100644 (file)
index 0000000..cc3c2d1
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+
+# Place the suites in run order:
+integration/test/csit/suites/controller/dom_rpc_broker/rpc_provider_precedence_longevity.robot