Step 2: Move test folder to root
[integration/test.git] / csit / suites / controller / Clustering_Datastore / 040_people_failover_crud_on_new_leader.robot
1 *** Settings ***
2 Documentation     This test brings down the current leader of the "car" shard and then executes CRUD operations on the new leader
3 Default Tags      3-node-cluster
4 Library           ../../../libraries/CrudLibrary.py
5 Library           ../../../libraries/UtilLibrary.py
6 Library           ../../../libraries/ClusterStateLibrary.py
7 Resource          ../../../libraries/ClusterKeywords.robot
8
9 *** Variables ***
10 ${PEOPLE_SHARD}    shard-people-config
11 ${NUM_ENTRIES}    ${50}
12 ${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
13
14 *** Test Cases ***
15 Switch People Leader
16     [Documentation]    Stop the leader to cause a new leader to be elected
17     ${OLD_PEOPLE_LEADER}    Wait For Leader To Be Found    ${PEOPLE_SHARD}
18     ${NEW_PEOPLE_LEADER}    Switch Leader    ${PEOPLE_SHARD}    ${OLD_PEOPLE_LEADER}
19     Set Suite Variable    ${OLD_PEOPLE_LEADER}
20     Set Suite Variable    ${NEW_PEOPLE_LEADER}
21
22 Delete people from new leader
23     Delete All People And Verify    ${NEW_PEOPLE_LEADER}
24
25 Add people and get from new leader
26     [Documentation]    Add people and get people from new leader
27     Add People And Verify    ${NEW_PEOPLE_LEADER}    ${NUM_ENTRIES}
28
29 Get People Followers
30     ${PEOPLE_FOLLOWERS}    Get All Followers    ${PEOPLE_SHARD}    ${OLD_PEOPLE_LEADER}
31     Set Suite Variable    ${PEOPLE_FOLLOWERS}
32
33 Get added people from Follower
34     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    @{PEOPLE_FOLLOWERS}[0]    ${NUM_ENTRIES}
35
36 Delete people from new Follower
37     Delete All People And Verify    @{PEOPLE_FOLLOWERS}[0]
38
39 Add people from new Follower
40     [Documentation]    Add people and get people from follower
41     Add People And Verify    @{PEOPLE_FOLLOWERS}[0]    ${NUM_ENTRIES}
42
43 Get added people from new leader
44     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    ${NEW_PEOPLE_LEADER}    ${NUM_ENTRIES}
45
46 Restart old People leader
47     Start One Or More Controllers    ${OLD_PEOPLE_LEADER}
48
49 Get added people from old leader
50     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    ${OLD_PEOPLE_LEADER}    ${NUM_ENTRIES}