Set http_timeout=30 for several controller suites
[integration/test.git] / csit / suites / controller / dom_rpc_broker / rpc_provider_partition_and_heal_longevity.robot
1 *** Settings ***
2 Documentation     DOMRpcBroker testing: RPC Provider Partition And Heal
3 ...
4 ...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
5 ...
6 ...               This program and the accompanying materials are made available under the
7 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
9 ...
10 ...               This tests establishes that the RPC service operates correctly when faced
11 ...               with node failures.
12 ...               This suite supports more than three node cluster setup too.
13 Suite Setup       Setup_Kw
14 Suite Teardown    SSHLibrary.Close_All_Connections
15 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
16 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
17 Default Tags      critical
18 Library           SSHLibrary
19 Resource          ${CURDIR}/../../../libraries/controller/DrbCommons.robot
20 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
21 Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
22
23 *** Variables ***
24 ${DURATION_24_HOURS_IN_SECONDS}    86400
25 @{NON_WORKING_RPC_STATUS_CODE_LIST}    ${501}
26
27 *** Test Cases ***
28 Rpc_Provider_Precedence_Longevity
29     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DURATION_24_HOURS_IN_SECONDS}    1s    Test_Scenario
30
31 *** Keywords ***
32 Setup_Kw
33     [Documentation]    Setup keyword. Create ${possible_constants} list with possible variables of remote constants.
34     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=30
35     DrbCommons.DrbCommons_Init
36
37 Test_Scenario
38     Setup_Test_Scenario_Variables
39     DrbCommons.Register_Rpc_On_Nodes    ${installed_rpc_member_idx_list}
40     DrbCommons.Verify_Constant_On_Active_Nodes
41     ${isolated_idx} =    DrbCommons.Get_Constant_Index_From_Node    ${tested_member_without_rpc_idx}
42     DrbCommons.Isolate_Node    ${isolated_idx}
43     BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    DrbCommons.Verify_Constant_On_Registered_Node    ${isolated_idx}
44     DrbCommons.Verify_Constant_On_Active_Nodes
45     DrbCommons.Rejoin_Node    ${isolated_idx}
46     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    20s    3s    DrbCommons.Verify_Constant_On_Active_Nodes
47     DrbCommons.Isolate_Node    ${tested_member_without_rpc_idx}
48     BuiltIn.Wait_Until_Keyword_Succeeds    15s    2s    MdsalLowlevel.Get_Constant    ${tested_member_without_rpc_idx}    explicit_status_codes=${NON_WORKING_RPC_STATUS_CODE_LIST}
49     DrbCommons.Rejoin_Node    ${tested_member_without_rpc_idx}
50     BuiltIn.Wait_Until_Keyword_Succeeds    10x    3s    DrbCommons.Verify_Constant_On_Unregistered_Node    ${tested_member_without_rpc_idx}
51     DrbCommons.Unregister_Rpc_On_Nodes    ${installed_rpc_member_idx_list}
52
53 Setup_Test_Scenario_Variables
54     [Documentation]    Create several variables for test scenario run.
55     ...    ${installed_rpc_member_idx_list} - members where the rpc will be installed
56     ...    ${tested_member_without_rpc_idx} - one member to be tested where rpc is not installed
57     ...    ${non_installed_rpc_member_idx_list} - members without rpc installed
58     ...    This supports more thatn 3 node odl setup.
59     ${idx1}    ${idx2}    ${idx3} =    BuiltIn.Evaluate    random.sample(${all_indices}, 3)    modules=random
60     ${installed_rpc_member_idx_list}    BuiltIn.Create_list    ${idx1}    ${idx2}
61     BuiltIn.Set_Suite_Variable    ${installed_rpc_member_idx_list}
62     BuiltIn.Set_Suite_Variable    ${tested_member_without_rpc_idx}    ${idx3}
63     ${non_installed_rpc_member_idx_list} =    ClusterManagement.List_All_Indices
64     : FOR    ${index}    IN    @{installed_rpc_member_idx_list}
65     \    ${non_installed_rpc_member_idx_list} =    ClusterManagement.List_Indices_Minus_Member    ${index}    ${non_installed_rpc_member_idx_list}
66     BuiltIn.Set_Suite_Variable    ${non_installed_rpc_member_idx_list}