Update Robot Framework format - step 14
[integration/test.git] / csit / suites / sxp / clustering / 010_Connection_switchover.robot
1 *** Settings ***
2 Documentation       Test suite to test cluster connection switchover
3
4 Resource            ../../../libraries/ClusterManagement.robot
5 Resource            ../../../libraries/SxpClusterLib.robot
6
7 Suite Setup         SxpClusterLib.Setup SXP Cluster Session With Device
8 Suite Teardown      SxpClusterLib.Clean SXP Cluster Session
9 Test Setup          SxpClusterLib.Setup SXP Cluster
10 Test Teardown       SxpClusterLib.Clean SXP Cluster
11
12
13 *** Test Cases ***
14 Isolation of SXP service follower Test
15     [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
16     SxpClusterLib.Check Shards Status
17     ${controller_index} =    SxpClusterLib.Get Owner Controller
18     Isolate SXP Controller    ${controller_index}
19
20 Isolation of SXP noservice follower Test
21     [Documentation]    Test SXP connection switchover only if Controller without SCS are isolated
22     SxpClusterLib.Check Shards Status
23     ${controller_index} =    SxpClusterLib.Get Not Owner Controller
24     Isolate SXP Controller    ${controller_index}
25
26
27 *** Keywords ***
28 Isolate SXP Controller
29     [Documentation]    Isolate one of cluster nodes and perform check that Device is still connected afterwards reverts isolation
30     [Arguments]    ${controller_index}
31     ${running_members} =    ClusterManagement.Isolate_Member_From_List_Or_All    ${controller_index}
32     BuiltIn.Wait Until Keyword Succeeds
33     ...    120x
34     ...    1s
35     ...    ClusterManagement.Verify_Members_Are_Ready
36     ...    member_index_list=${running_members}
37     ...    verify_cluster_sync=True
38     ...    verify_restconf=True
39     ...    verify_system_status=False
40     ...    service_list=${EMPTY_LIST}
41     BuiltIn.Wait Until Keyword Succeeds
42     ...    240x
43     ...    1s
44     ...    ClusterManagement.Sync_Status_Should_Be_False
45     ...    ${controller_index}
46     BuiltIn.Wait Until Keyword Succeeds
47     ...    120x
48     ...    1s
49     ...    SxpClusterLib.Check Device is Connected
50     ...    ${DEVICE_NODE_ID}
51     ...    session=${DEVICE_SESSION}
52     ClusterManagement.Flush_Iptables_From_List_Or_All
53     BuiltIn.Wait Until Keyword Succeeds
54     ...    120x
55     ...    1s
56     ...    ClusterManagement.Verify_Members_Are_Ready
57     ...    member_index_list=${EMPTY}
58     ...    verify_cluster_sync=True
59     ...    verify_restconf=True
60     ...    verify_system_status=False
61     ...    service_list=${EMPTY_LIST}
62     BuiltIn.Wait Until Keyword Succeeds
63     ...    120x
64     ...    1s
65     ...    SxpClusterLib.Check Device is Connected
66     ...    ${DEVICE_NODE_ID}
67     ...    session=${DEVICE_SESSION}