Tidy for clustering test suite.
[integration/test.git] / test / csit / suites / 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.txt
8
9 *** Variables ***
10 ${PEOPLE_SHARD}    shard-people-config
11 ${NUM_ENTRIES}    ${50}
12
13 *** Test Cases ***
14 Switch People Leader
15     [Documentation]    Stop the leader to cause a new leader to be elected
16     ${OLD_PEOPLE_LEADER}    Wait For Leader    ${PEOPLE_SHARD}
17     ${NEW_PEOPLE_LEADER}    Switch Leader    ${PEOPLE_SHARD}    ${OLD_PEOPLE_LEADER}
18     Set Suite Variable    ${OLD_PEOPLE_LEADER}
19     Set Suite Variable    ${NEW_PEOPLE_LEADER}
20
21 Delete people from new leader
22     Delete All People And Verify    ${NEW_PEOPLE_LEADER}
23
24 Add people and get from new leader
25     [Documentation]    Add people and get people from new leader
26     Add People And Verify    ${NEW_PEOPLE_LEADER}    ${NUM_ENTRIES}
27
28 Get People Followers
29     ${PEOPLE_FOLLOWERS}    Get All Followers    ${PEOPLE_SHARD}
30     Set Suite Variable    ${PEOPLE_FOLLOWERS}
31
32 Get added people from Follower
33     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    @{PEOPLE_FOLLOWERS}[0]    ${NUM_ENTRIES}
34
35 Delete people from new Follower
36     Delete All People And Verify    @{PEOPLE_FOLLOWERS}[0]
37
38 Add people from new Follower
39     [Documentation]    Add people and get people from follower
40     Add People And Verify    @{PEOPLE_FOLLOWERS}[0]    ${NUM_ENTRIES}
41
42 Get added people from new leader
43     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    ${NEW_PEOPLE_LEADER}    ${NUM_ENTRIES}
44
45 Restart old People leader
46     StartController    ${OLD_PEOPLE_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${PORT}
47
48 Get added people from old leader
49     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    ${OLD_PEOPLE_LEADER}    ${NUM_ENTRIES}