*** Settings *** Documentation This test finds the leader for shards in a 3-Node cluster and executes CRUD operations on them Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Library ../../../libraries/CrudLibrary.py Library ../../../libraries/SettingsLibrary.py Library ../../../libraries/UtilLibrary.py Library ../../../libraries/ClusterStateLibrary.py Variables ../../../variables/Variables.py *** Variables *** ${REST_CONTEXT} /restconf/config/ ${SHARD_CAR_NAME} shard-car-config ${SHARD_PEOPLE_NAME} shard-people-config ${SHARD_CAR_PERSON_NAME} shard-car-people-config *** Test Cases *** Add cars and get cars from Leader [Documentation] Add 100 cars and get added cars from Leader ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log CURRENT_CAR_SHARD_LEADER ${CURRENT_CAR_LEADER} Set Suite Variable ${CURRENT_CAR_LEADER} ${resp} AddCar ${CURRENT_CAR_LEADER} ${PORT} ${100} ${resp} Getcars ${CURRENT_CAR_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} manufacturer1 Add persons and get persons from Leader [Documentation] Add 100 persons and get persons [Documentation] Note: There should be one person added first to enable rpc ${CURRENT_PEOPLE_LEADER} GetLeader ${SHARD_PEOPLE_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Set Suite Variable ${CURRENT_PEOPLE_LEADER} ${resp} AddPerson ${CURRENT_PEOPLE_LEADER} ${PORT} ${0} ${resp} AddPerson ${CURRENT_PEOPLE_LEADER} ${PORT} ${100} ${resp} GetPersons ${CURRENT_PEOPLE_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user5 Add car-person mapping and get car-person mapping from Leader [Documentation] Add car-person and get car-person from Leader [Documentation] Note: This is done to enable working of rpc ${CURRENT_CAR_PERSON_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Set Suite Variable ${CURRENT_CAR_PERSON_LEADER} ${resp} AddCarPerson ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} Sleep 2 ${resp} GetCarPersonMappings ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user0 Purchase 100 cars using Leader [Documentation] Purchase 100 cars using Leader ${resp} BuyCar ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${100} Sleep 2 ${resp} GetCarPersonMappings ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Get car-person mappings using Leader [Documentation] Get car-person mappings using Leader to see 100 entry ${resp} GetCarPersonMappings ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Get car-person mappings using Follower1 [Documentation] Get car-person mappings using Follower1 to see 100 entry ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${FOLLOWERS} SET SUITE VARIABLE ${FOLLOWERS} ${resp} GetCarPersonMappings ${FOLLOWERS[0]} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Should Contain ${resp.content} user5 Get car-person mappings using Follower2 [Documentation] Get car-person mappings using Follower2 to see 100 entry ${resp} GetCarPersonMappings ${FOLLOWERS[1]} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user0 Should Contain ${resp.content} user100