Add SXP clustering CSIT
[integration/test.git] / csit / suites / sxp / clustering / 030_RPC_functionality.robot
1 *** Settings ***
2 Documentation     Test suite to verify RPC funcionality on cluster
3 Suite Setup       Setup SXP Cluster Session
4 Suite Teardown    Clean SXP Cluster Session
5 Test Setup        Setup SXP Cluster
6 Test Teardown     Clean SXP Cluster
7 Library           ../../../libraries/Sxp.py
8 Resource          ../../../libraries/SxpLib.robot
9 Resource          ../../../libraries/ClusterManagement.robot
10 Resource          ../../../libraries/SxpClusterLib.robot
11
12 *** Variables ***
13 ${SAMPLES}        1
14
15 *** Test Cases ***
16 Isolation of RCP service Test
17     [Documentation]    Test SXP RPC functionality only if Controller with SCS is isolated
18     : FOR    ${i}    IN RANGE    0    ${SAMPLES}
19     \    ${controller_index}    Get Active Controller
20     \    Isolate SXP Controller    ${controller_index}
21
22 Isolation of RPC noservice Test
23     [Documentation]    Test SXP RPC functionality only if Controller without SCS are isolated
24     : FOR    ${i}    IN RANGE    0    ${SAMPLES}
25     \    ${controller_index}    Get Inactive Controller
26     \    Isolate SXP Controller    ${controller_index}
27
28 *** Keywords ***
29 Isolate SXP Controller
30     [Arguments]    ${controller_index}
31     [Documentation]    Isolate one of cluster nodes and perform check that RPC changes were performed afterwards reverts isolation
32     ${active_controller}    Get Active Controller
33     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
34     \    Add Binding    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32    node=${CLUSTER_NODE_ID}    session=controller${active_controller}
35     Isolate_Member_From_List_Or_All    ${controller_index}
36     Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_False    ${controller_index}
37     Wait Until Keyword Succeeds    30    1    Check Bindings Exist
38     ${active_controller}    Get Active Controller
39     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
40     \    Delete Binding    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32    node=${CLUSTER_NODE_ID}    session=controller${active_controller}
41     Flush_Iptables_From_List_Or_All
42     Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_True    ${controller_index}
43     Wait Until Keyword Succeeds    30    1    Check Bindings Does Not Exist
44
45 Check Bindings Exist
46     [Documentation]    Check that bindings exists in Cluster datastore
47     ${controller_index}    Get Active Controller
48     ${resp}    Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
49     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
50     \    Should Contain Binding    ${resp}    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32
51
52 Check Bindings Does Not Exist
53     [Documentation]    Check that bindings does not exist in Cluster datastore
54     ${controller_index}    Get Active Controller
55     ${resp}    Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
56     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
57     \    Should Not Contain Binding    ${resp}    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32