f22eb1d646817bfa5db73ebf0f81c49bbd66f3dc
[integration/test.git] / test / csit / suites / 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
5 Library           Collections
6 Library           ../../../libraries/RequestsLibrary.py
7 Library           ../../../libraries/Common.py
8 Library           ../../../libraries/CrudLibrary.py
9 Library           ../../../libraries/SettingsLibrary.py
10 Library           ../../../libraries/UtilLibrary.py
11 Library           ../../../libraries/ClusterStateLibrary.py
12 Resource           ../../../libraries/ClusterKeywords.txt
13 Variables         ../../../variables/Variables.py
14
15 *** Variables ***
16 ${REST_CONTEXT}    /restconf/config/
17 ${SHARD_CAR_NAME}      shard-car-config
18 ${SHARD_PEOPLE_NAME}      shard-people-config
19 ${SHARD_CAR_PERSON_NAME}      shard-car-people-config
20 ${NUM_ENTRIES}  ${40}
21
22 *** Test Cases ***
23 Get Car Followers
24     ${CAR_FOLLOWERS}   Get All Followers   ${SHARD_CAR_NAME}
25     Set Suite Variable  ${CAR_FOLLOWERS}
26
27 Get People Followers
28     ${PEOPLE_FOLLOWERS}   Get All Followers   ${SHARD_PEOPLE_NAME}
29     Set Suite Variable  ${PEOPLE_FOLLOWERS}
30
31 Get Car-Person Followers
32     ${CAR_PERSON_FOLLOWERS}   Get All Followers   ${SHARD_CAR_PERSON_NAME}
33     Set Suite Variable  ${CAR_PERSON_FOLLOWERS}
34
35 Delete cars from Follower1
36     Delete All Cars And Verify    @{CAR_FOLLOWERS}[0]
37
38 Delete people from Follower1
39     Delete All People And Verify   @{PEOPLE_FOLLOWERS}[0]
40
41 Delete car-persons from Follower1
42     Delete All Cars-Persons And Verify    @{CAR_PERSON_FOLLOWERS}[0]
43
44 Add cars and get cars from Follower1
45     [Documentation]    Add cars and get added cars from Follower1
46     Add Cars And Verify   @{CAR_FOLLOWERS}[0]   ${NUM_ENTRIES}
47
48 Get added cars from Follower2
49     [Documentation]   Get added cars from Follower2
50     Wait Until Keyword Succeeds   60s  2s  Get Cars And Verify   @{CAR_FOLLOWERS}[1]   ${NUM_ENTRIES}
51
52 Add people and get people from Follower1
53     [Documentation]  Add people and get people from Follower1
54     Add People And Verify   @{PEOPLE_FOLLOWERS}[0]   ${NUM_ENTRIES}
55
56 Get added people from Follower2
57     [Documentation]   Get added people from Follower2
58     Wait Until Keyword Succeeds   60s  2s  Get People And Verify   @{PEOPLE_FOLLOWERS}[1]    ${NUM_ENTRIES}
59
60 Add car-person mapping and get car-person mapping from Follower1
61     Add Car Person And Verify   @{CAR_PERSON_FOLLOWERS}[0]
62
63 Purchase cars on Follower1
64     [Documentation]  Purchase cars using Follower1
65     Buy Cars And Verify   @{CAR_PERSON_FOLLOWERS}[0]   ${NUM_ENTRIES}
66
67 Get car-person mappings from Follower1
68     [Documentation]     Get car-person mappings from Follower1 to see all entries
69     Wait Until Keyword Succeeds   60s  2s  Get Car-Person Mappings And Verify   @{CAR_PERSON_FOLLOWERS}[0]  ${NUM_ENTRIES}
70
71 Get car-person mappings from Leader
72     [Documentation]     Get car-person mappings from the Leader to see all entries
73     ${CURRENT_CAR_LEADER}   Wait For Leader   ${SHARD_CAR_PERSON_NAME}
74     Wait Until Keyword Succeeds   60s  2s  Get Car-Person Mappings And Verify   ${CURRENT_CAR_LEADER}  ${NUM_ENTRIES}
75
76 Get car-person mappings from Follower2
77     [Documentation]     Get car-person mappings from Follower2 to see all entries
78     Wait Until Keyword Succeeds   60s  2s  Get Car-Person Mappings And Verify   @{CAR_PERSON_FOLLOWERS}[1]  ${NUM_ENTRIES}