Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / controller / Clustering_Datastore / 020_crud_on_any_follower.robot
1 *** Settings ***
2 Documentation     This test finds the followers of certain shards in a 3-Node cluster and executes CRUD operations on any one follower
3 Default Tags      3-node-cluster
4 Library           Collections
5 Library           ../../../libraries/Common.py
6 Library           ../../../libraries/CrudLibrary.py
7 Library           ../../../libraries/SettingsLibrary.py
8 Library           ../../../libraries/UtilLibrary.py
9 Library           ../../../libraries/ClusterStateLibrary.py
10 Resource          ../../../libraries/ClusterKeywords.robot
11 Variables         ../../../variables/Variables.py
12
13 *** Variables ***
14 ${SHARD_CAR_NAME}    shard-car-config
15 ${SHARD_PEOPLE_NAME}    shard-people-config
16 ${SHARD_CAR_PERSON_NAME}    shard-car-people-config
17 ${NUM_ENTRIES}    ${40}
18
19 *** Test Cases ***
20 Get Car Followers
21     ${CAR_FOLLOWERS}    Get All Followers    ${SHARD_CAR_NAME}
22     Set Suite Variable    ${CAR_FOLLOWERS}
23
24 Get People Followers
25     ${PEOPLE_FOLLOWERS}    Get All Followers    ${SHARD_PEOPLE_NAME}
26     Set Suite Variable    ${PEOPLE_FOLLOWERS}
27
28 Get Car-Person Followers
29     ${CAR_PERSON_FOLLOWERS}    Get All Followers    ${SHARD_CAR_PERSON_NAME}
30     Set Suite Variable    ${CAR_PERSON_FOLLOWERS}
31
32 Delete cars from Follower1
33     Delete All Cars And Verify    @{CAR_FOLLOWERS}[0]
34
35 Delete people from Follower1
36     Delete All People And Verify    @{PEOPLE_FOLLOWERS}[0]
37
38 Delete car-persons from Follower1
39     Delete All Cars-Persons And Verify    @{CAR_PERSON_FOLLOWERS}[0]
40
41 Add cars and get cars from Follower1
42     [Documentation]    Add cars and get added cars from Follower1
43     Add Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_ENTRIES}
44
45 Get added cars from Follower2
46     [Documentation]    Get added cars from Follower2
47     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[1]    ${NUM_ENTRIES}
48
49 Add people and get people from Follower1
50     [Documentation]    Add people and get people from Follower1
51     Add People And Verify    @{PEOPLE_FOLLOWERS}[0]    ${NUM_ENTRIES}
52
53 Get added people from Follower2
54     [Documentation]    Get added people from Follower2
55     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    @{PEOPLE_FOLLOWERS}[1]    ${NUM_ENTRIES}
56
57 Add car-person mapping and get car-person mapping from Follower1
58     Add Car Person And Verify    @{CAR_PERSON_FOLLOWERS}[0]
59
60 Purchase cars on Follower1
61     [Documentation]    Purchase cars using Follower1
62     Buy Cars And Verify    @{CAR_PERSON_FOLLOWERS}[0]    ${NUM_ENTRIES}
63
64 Get car-person mappings from Follower1
65     [Documentation]    Get car-person mappings from Follower1 to see all entries
66     Wait Until Keyword Succeeds    60s    2s    Get Car-Person Mappings And Verify    @{CAR_PERSON_FOLLOWERS}[0]    ${NUM_ENTRIES}
67
68 Get car-person mappings from Leader
69     [Documentation]    Get car-person mappings from the Leader to see all entries
70     ${CURRENT_CAR_LEADER}    Wait For Leader To Be Found    ${SHARD_CAR_PERSON_NAME}
71     Wait Until Keyword Succeeds    60s    2s    Get Car-Person Mappings And Verify    ${CURRENT_CAR_LEADER}    ${NUM_ENTRIES}
72
73 Get car-person mappings from Follower2
74     [Documentation]    Get car-person mappings from Follower2 to see all entries
75     Wait Until Keyword Succeeds    60s    2s    Get Car-Person Mappings And Verify    @{CAR_PERSON_FOLLOWERS}[1]    ${NUM_ENTRIES}