eccfbdb96f2fb7d148d388f9dbab514c0015ff38
[integration/test.git] / csit / suites / sxp / clustering / 010_Connection_switchover.robot
1 *** Settings ***
2 Documentation     Test suite to test cluster connection switchover
3 Suite Setup       SxpClusterLib.Setup SXP Cluster Session With Device
4 Suite Teardown    SxpClusterLib.Clean SXP Cluster Session
5 Test Setup        SxpClusterLib.Setup SXP Cluster
6 Test Teardown     SxpClusterLib.Clean SXP Cluster
7 Resource          ../../../libraries/ClusterManagement.robot
8 Resource          ../../../libraries/SxpClusterLib.robot
9
10 *** Test Cases ***
11 Isolation of SXP service follower Test
12     [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
13     SxpClusterLib.Check Shards Status
14     ${controller_index} =    SxpClusterLib.Get Owner Controller
15     Isolate SXP Controller    ${controller_index}
16
17 Isolation of SXP noservice follower Test
18     [Documentation]    Test SXP connection switchover only if Controller without SCS are isolated
19     SxpClusterLib.Check Shards Status
20     ${controller_index} =    SxpClusterLib.Get Not Owner Controller
21     Isolate SXP Controller    ${controller_index}
22
23 *** Keywords ***
24 Isolate SXP Controller
25     [Arguments]    ${controller_index}
26     [Documentation]    Isolate one of cluster nodes and perform check that Device is still connected afterwards reverts isolation
27     ${running_members} =    ClusterManagement.Isolate_Member_From_List_Or_All    ${controller_index}
28     BuiltIn.Wait Until Keyword Succeeds    120x    1s    ClusterManagement.Verify_Members_Are_Ready    member_index_list=${running_members}    verify_cluster_sync=True    verify_restconf=True
29     ...    verify_system_status=False    service_list=${EMPTY_LIST}
30     BuiltIn.Wait Until Keyword Succeeds    240x    1s    ClusterManagement.Sync_Status_Should_Be_False    ${controller_index}
31     BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpClusterLib.Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
32     ClusterManagement.Flush_Iptables_From_List_Or_All
33     BuiltIn.Wait Until Keyword Succeeds    120x    1s    ClusterManagement.Verify_Members_Are_Ready    member_index_list=${EMPTY}    verify_cluster_sync=True    verify_restconf=True
34     ...    verify_system_status=False    service_list=${EMPTY_LIST}
35     BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpClusterLib.Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}