*** Settings *** Documentation This test brings down the current leader of the "car" shard and then executes CRUD operations on the new leader Library ../../../libraries/CrudLibrary.py Library ../../../libraries/UtilLibrary.py Library ../../../libraries/ClusterStateLibrary.py *** Variables *** ${SHARD} shard-car-config *** Test Cases *** Switch Leader [Documentation] stop leader and elect new leader ${OLD_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Stopcontroller ${OLD_LEADER} ${USERNAME} ${PASSWORD} ${KARAFHOME} Sleep 30 ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${NEW_LEADER} Set Suite Variable ${NEW_LEADER} Delete cars at new leader [Documentation] delete cars DeleteAllCars ${NEW_LEADER} ${PORT} ${0} ${resp} Getcars ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 404 Delete people at new leader [Documentation] delete people DeleteAllPersons ${NEW_LEADER} ${PORT} ${0} ${resp} GetPersons ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 404 Add cars and get cars from new leader [Documentation] Add 50 cars and get added cars from Leader ${resp} AddCar ${NEW_LEADER} ${PORT} ${50} Sleep 10 ${resp} Getcars ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} manufacturer1 Should Contain ${resp.content} manufacturer50 Should Not Contain ${resp.content} manufacturer60 Add people and get people from leader [Documentation] Add 50 persons and get people [Documentation] Note: There should be one person added first to enable rpc ${resp} AddPerson ${NEW_LEADER} ${PORT} ${0} ${resp} AddPerson ${NEW_LEADER} ${PORT} ${50} Sleep 10 ${resp} GetPersons ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user2 Should Contain ${resp.content} user50 Should Not Contain ${resp.content} user60 Purchase 50 cars at new leader [Documentation] Add car-person and get car-person from Leader [Documentation] Note: This is done to enable working of rpc [Documentation] Purchase 50 cars using Leader ${resp} AddCarPerson ${NEW_LEADER} ${PORT} ${0} ${resp} GetCarPersonMappings ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user0 ${resp} BuyCar ${NEW_LEADER} ${PORT} ${50} Sleep 10 Get car-person mappings at new Leader [Documentation] Get car-person mappings using new leader to see 50 entry ${resp} GetCarPersonMappings ${NEW_LEADER} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user5 Should Contain ${resp.content} user50