2 Documentation Test suite for RESTCONF RPC CAR PERSON
4 Library ../../../../libraries/RequestsLibrary.py
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 Variables ../../../../variables/Variables.py
13 ${REST_CONTEXT} /restconf/config/
14 ${KARAF_HOME} /root/odl/dist
17 ${CAR_SHARD} shard-car-config
21 [Documentation] Stop all the controllers in the cluster
22 Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
23 Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
24 Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
26 KillController ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
27 KillController ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
28 KillController ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
32 [Documentation] Clean the journals of all the controllers in the cluster
33 CleanJournal ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
34 CleanJournal ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
35 CleanJournal ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
39 [Documentation] Start all the controllers in the cluster
40 Startcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
41 Startcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
42 Startcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
46 [Documentation] Delete all the cars from the system
47 ${resp} DeleteAllCars ${LEADER} ${PORT} 0
48 ${resp} GetCars ${LEADER} ${PORT} 0
49 Should Be Equal As Strings ${resp.status_code} 404
53 [Documentation] Delete all the people from the system
54 ${resp} DeleteAllPersons ${LEADER} ${PORT} 0
55 ${resp} GetPersons ${LEADER} ${PORT} 0
56 Should Be Equal As Strings ${resp.status_code} 404
59 [Documentation] Add 200 cars
60 ${resp} AddCar ${LEADER} ${PORT} ${200}
61 Should Be Equal As Strings ${resp.status_code} 204
64 [Documentation] Add 200 people
65 ${resp} AddPerson ${LEADER} ${PORT} ${0}
66 ${resp} AddPerson ${LEADER} ${PORT} ${200}
67 Should Be Equal As Strings ${resp.status_code} 204
69 Add Car Person mapping
70 [Documentation] Add Car Persons
71 ${resp} AddCarPerson ${LEADER} ${PORT} ${0}
72 ${resp} BuyCar ${LEADER} ${PORT} ${200}
75 ${CAR_LEADER} GetLeader ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2}
76 Set Suite Variable ${CAR_LEADER}
77 Stopcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
79 KillController ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
81 Get all the cars from Follower 1
82 ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2}
83 ${resp} Getcars ${followers[0]} ${PORT} ${0}
84 Should Be Equal As Strings ${resp.status_code} 200
85 Should Contain ${resp.content} manufacturer1
88 Startcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
91 Get all the cars from Leader
92 ${resp} Getcars ${CAR_LEADER} ${PORT} ${0}
93 Should Be Equal As Strings ${resp.status_code} 200
94 Should Contain ${resp.content} manufacturer1
96 Cleanup All Controllers
97 [Documentation] Stop all the controllers in the cluster
98 Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
99 Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
100 Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}