Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / controller / cluster_singleton / chasing_the_leader.robot
1 *** Settings ***
2 Documentation       Cluster Singleton testing: Chasing the Leader
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 test aims to establish the service operates correctly when faced with
11 ...                 rapid application transitions without having a stabilized application.
12
13 Library             SSHLibrary
14 Resource            ${CURDIR}/../../../libraries/controller/CsCommon.robot
15 Resource            ${CURDIR}/../../../libraries/CompareStream.robot
16 Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
17
18 Suite Setup         Setup_Keyword
19 Suite Teardown      SSHLibrary.Close_All_Connections
20 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
22
23 Default Tags        critical
24
25
26 *** Variables ***
27 ${TEST_DURATION}            1m
28 ${ACCEPTED_PER_SEC_RATE}    5
29 # NOTE: The shared infra that we use can sometimes be sluggish and we get false failures.
30 # There are cases when the rate will be under 20 as well as over 100. Normally it is over
31 # 50, but in order to stabilize our tests and avoid false failures this rate has been set
32 # low. The test will still fail if there are failed registrations during the "flapping".
33 # Some discussion of this can be found in the comments of
34 # https://git.opendaylight.org/gerrit/#/c/74692/.
35
36
37 *** Test Cases ***
38 Register_Candidates
39     [Documentation]    Register a candidate application on each node which starts the test.
40     CsCommon.Register_Flapping_Singleton_On_Nodes    ${cs_all_indices}
41
42 Do_Nothing
43     [Documentation]    Do nothing for the time of the test duration, because there is no api to monitor the statistics
44     ...    during the test execution. Statistics are available only at the end, when unregister-flapping-singleton rpc is
45     ...    called.
46     BuiltIn.Sleep    ${TEST_DURATION}
47
48 Unregister_Candidates_And_Validate_Criteria
49     [Documentation]    Unregister the testing service and check recevied statistics.
50     CsCommon.Unregister_Flapping_Singleton_On_Nodes_And_Validate_Results
51     ...    ${cs_all_indices}
52     ...    ${ACCEPTED_PER_SEC_RATE}
53     ...    ${TEST_DURATION}
54
55
56 *** Keywords ***
57 Setup_Keyword
58     SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=125
59     CsCommon.Cluster_Singleton_Init