Update Robot Framework format - step 5
[integration/test.git] / csit / suites / controller / dom_rpc_broker / action_provider_partition_and_heal.robot
1 *** Settings ***
2 Documentation       DOMRpcBroker testing: RPC Action 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 for actions operates correctly
11 ...                 when faced with node failures.
12 ...                 This suite supports more than three node cluster setup too.
13
14 Library             SSHLibrary
15 Resource            ${CURDIR}/../../../libraries/controller/DrbCommons.robot
16 Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
17 Resource            ${CURDIR}/../../../libraries/WaitForFailure.robot
18
19 Suite Setup         Setup_Kw
20 Suite Teardown      SSHLibrary.Close_All_Connections
21 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
22 Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
23
24 Default Tags        critical
25
26
27 *** Variables ***
28 @{INSTALLED_RPC_MEMEBER_IDX_LIST}       ${1}    ${2}
29 ${TESTED_MEMBER_WITHOUT_RPC_IDX}        ${3}
30
31
32 *** Test Cases ***
33 Register_Rpc_On_Two_Nodes
34     [Documentation]    Register rpc on two nodes of the odl cluster.
35     DrbCommons.Register_Action_On_Nodes    ${INSTALLED_RPC_MEMEBER_IDX_LIST}
36
37 Invoke_Rpc_On_Each_Node
38     [Documentation]    Invoke get-contexted-constant rpc on every node of the cluster. When requested on the node with
39     ...    local instance the local value is expected. If invoked on the node with no local instance, any remote
40     ...    value is expected. From the constant returned from the ${TESTED_MEMBER_WITHOUT_RPC_IDX} node (with no rpc instance) an index of
41     ...    the node to be isolated is derived. And in the tc Invoke_Rpc_On_Remaining_Nodes a different constant
42     ...    is expected. The second for loop makes the suite suitable for more that 3 nodes cluster.
43     DrbCommons.Verify_Contexted_Constant_On_Active_Nodes
44
45 Isolate_One_Node
46     [Documentation]    Isolate one node with registered rpc.
47     ${isolated_idx} =    DrbCommons.Get_Contexted_Constant_Index_From_Node    ${TESTED_MEMBER_WITHOUT_RPC_IDX}
48     BuiltIn.Set_Suite_Variable    ${isolated_idx}
49     DrbCommons.Isolate_Node    ${isolated_idx}
50
51 Invoke_Rpc_On_Remaining_Nodes
52     [Documentation]    Invoke rpc on non-islolated nodes. As the only instance of rpc remained in the non-isolated
53     ...    cluster nodes, only this value is expected.
54     BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    DrbCommons.Verify_Contexted_Constant_On_Active_Nodes
55
56 Rejoin_Isolated_Member
57     [Documentation]    Rejoin isolated node
58     DrbCommons.Rejoin_Node    ${isolated_idx}
59
60 Invoke_Rpc_On_Each_Node_Again
61     [Documentation]    Invoke rpc get-contexted-constant on every node. When requested on the node with
62     ...    local instance the local value is expected. If invoked on the node with no local instance, any remote
63     ...    value is expected.
64     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
65     ...    20s
66     ...    3s
67     ...    DrbCommons.Verify_Contexted_Constant_On_Active_Nodes
68
69 Unregister_Rpc_On_Each_Node
70     [Documentation]    Inregister rpc on both nodes.
71     DrbCommons.Unregister_Action_On_Nodes    ${INSTALLED_RPC_MEMEBER_IDX_LIST}
72
73
74 *** Keywords ***
75 Setup_Kw
76     [Documentation]    Setup keyword. Create ${possible_constants} list with possible variables of remote constants.
77     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=125
78     DrbCommons.DrbCommons_Init