290daae84c3cee317e59dff487c94aa89616e911
[integration/test.git] / csit / suites / controller / Clustering_Datastore / entity_isolate.robot
1 *** Settings ***
2 Documentation     Suite for performing member isolation and rejoin, we do with entity-ownership leader.
3 Suite Setup       Setup
4 Suite Teardown    Teardown
5 Default Tags      clustering    carpeople    critical
6 Library           Collections
7 Resource          ${CURDIR}/../../../libraries/CarPeople.robot
8 Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
9 Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
10 Variables         ${CURDIR}/../../../variables/Variables.py
11
12 *** Variables ***
13 @{SHARD_OPER_LIST}    car    people    car-people    inventory    topology    default    toaster
14 ...               entity-ownership
15 @{SHARD_CONF_LIST}    car    people    car-people    inventory    topology    default    toaster
16
17 *** Test Cases ***
18 Check All Shards Before Isolate
19     [Documentation]    Check all shards in controller.
20     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_OPER_LIST}    shard_type=operational
21     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_CONF_LIST}    shard_type=config
22
23 Isolate Entity Leader
24     [Documentation]    Isolate the entity-ownership Leader to cause a new leader to get elected.
25     ClusterManagement.Isolate_Member_From_List_Or_All    ${entity-ownership_leader_index}
26
27 Check All Shards After Isolate
28     [Documentation]    Check all shards in controller.
29     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_OPER_LIST}    shard_type=operational    member_index_list=${entity-ownership_follower_indices}
30     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_CONF_LIST}    shard_type=config    member_index_list=${entity-ownership_follower_indices}
31
32 Rejoin Entity Leader
33     [Documentation]    Rejoin the entity-ownership Leader.
34     ClusterManagement.Rejoin_Member_From_List_Or_All    ${entity-ownership_leader_index}
35
36 Check All Shards After Rejoin
37     [Documentation]    Check all shards in controller.
38     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_OPER_LIST}    shard_type=operational
39     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_CONF_LIST}    shard_type=config
40
41 *** Keywords ***
42 Setup
43     [Documentation]    Initialize resources, memorize car shard leader and followers.
44     ClusterManagement.ClusterManagement_Setup
45     CarPeople.Set_Variables_For_Shard    shard_name=entity-ownership    shard_type=operational
46
47 Teardown
48     [Documentation]    Clear IPTables in all nodes.
49     ClusterManagement.Flush_Iptables_From_List_Or_All