f62c289a3f9bad5d13cbc5f07b881f76ce49f34c
[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
5 Library           ../../../libraries/CrudLibrary.py
6 Library           ../../../libraries/UtilLibrary.py
7 Library           ../../../libraries/ClusterStateLibrary.py
8 Resource           ../../../libraries/ClusterKeywords.txt
9
10 *** Variables ***
11 ${PEOPLE_SHARD}   shard-people-config
12 ${NUM_ENTRIES}  ${50}
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  ${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}
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     StartController    ${OLD_PEOPLE_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${PORT}
48
49 Get added people from old leader
50     Wait Until Keyword Succeeds   60s  2s  Get People And Verify   ${OLD_PEOPLE_LEADER}   ${NUM_ENTRIES}