Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / controller / dom_rpc_broker / rpc_provider_precedence_longevity.robot
1 *** Settings ***
2 Documentation       DOMRpcBroker testing: RPC Provider Precedence
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 ...                 The aim is to establish that remote RPC implementations have lower priority
11 ...                 than local ones, which is to say that any movement of RPCs on remote nodes
12 ...                 does not affect routing as long as a local implementation is available.
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_Keyword
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 # TODO: change back to 24h when releng has more granular steps to kill VMs than days; now 23h=82800s
29 ${LONGEVITY_TEST_DURATION_IN_SECS}      82800
30
31
32 *** Test Cases ***
33 Rpc_Provider_Precedence_Longevity
34     [Documentation]    Repeat the tested scenario for 24h.
35     DrbCommons.Register_Rpc_On_Nodes    ${all_indices}
36     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
37     ...    ${LONGEVITY_TEST_DURATION_IN_SECS}
38     ...    1s
39     ...    Test_Scenario
40     DrbCommons.Unregister_Rpc_On_Nodes    ${all_indices}
41
42
43 *** Keywords ***
44 Setup_Keyword
45     [Documentation]    Create a list of possible constant responses on the node with unregistered rpc.
46     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=125
47     DrbCommons.DrbCommons_Init
48
49 Test_Scenario
50     [Documentation]    Test randomly unregister rpc on one node while testing checking expected constants.
51     ${unregistered_rpc_node} =    BuiltIn.Evaluate    random.choice(${all_indices})    modules=random
52     ${unregistered_rpc_node} =    BuiltIn.Convert_To_Integer    ${unregistered_rpc_node}
53     DrbCommons.Verify_Constant_On_Registered_Nodes    ${all_indices}
54     DrbCommons.Unregister_Rpc_And_Update_Possible_Constants    ${unregistered_rpc_node}
55     DrbCommons.Verify_Constant_On_Unregistered_Node    ${unregistered_rpc_node}
56     DrbCommons.Verify_Constant_On_Registered_Nodes    ${registered_indices}
57     DrbCommons.Register_Rpc_And_Update_Possible_Constants    ${unregistered_rpc_node}
58     DrbCommons.Verify_Constant_On_Registered_Nodes    ${all_indices}