2 Documentation Basic library verification suite, handling cars/people in 1-node setup.
4 ... Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
10 ... This is a lightweight and stripped-down functional analogue of performance suite.
11 ... Intention is to use this as a verify suite for changes in TemplatedRequests resource.
13 Variables ${CURDIR}/../../../variables/Variables.py
14 Resource ${CURDIR}/../../../libraries/SetupUtils.robot
15 Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
17 Suite Setup Start_Suite
18 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
19 Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
23 ${VAR_BASE} ${CURDIR}/../../../variables/carpeople/libtest
25 ${TIMEOUT_BUG_4220} 60s
30 [Documentation] Issue (invalid) RPC requests until 501 goes away (or timeout expires).
31 ... See https://bugs.opendaylight.org/show_bug.cgi?id=4220
32 BuiltIn.Wait_Until_Keyword_Succeeds ${TIMEOUT_BUG_4220} 5s Check_Rpc_Readiness
35 [Documentation] Add a person entry, verify it is seen in the datastore.
36 TemplatedRequests.Put_As_Json_Templated folder=${VAR_BASE}/person
37 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/person verify=True
40 [Documentation] Add a car entry, verify it is seen in the datastore.
41 TemplatedRequests.Put_As_Json_Templated folder=${VAR_BASE}/car
42 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/car verify=True
44 Purchase_And_Verify_Car
45 [Documentation] Post RPC to buy a car.
46 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/purchase
47 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/car_person verify=True
50 [Documentation] Remove the car-people entry from the datastore.
51 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/car_person
52 # TODO: Add specific error check on Get attempt.
55 [Documentation] Remove the car entry from the datastore.
56 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/car
57 # TODO: Add specific error check on Get attempt.
60 [Documentation] Remove the person entry from the datastore.
61 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/person
62 # TODO: Add specific error check on Get attempt.
65 [Documentation] Create container with several people, verify it is seen in the datastore..
66 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/people iterations=${BULK_SIZE}
67 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/people verify=True iterations=${BULK_SIZE}
70 [Documentation] Create container with several cars, verify it is seen in the datastore.
71 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/cars iterations=${BULK_SIZE}
72 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/cars verify=True iterations=${BULK_SIZE}
73 # TODO: Add cases with purchase loop.
76 [Documentation] Remove cars-people container from the datastore.
77 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/cars_people
78 # TODO: Add specific error check on Get attempt.
81 [Documentation] Remove cars container from the datastore.
82 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/cars
83 # TODO: Add specific error check on Get attempt.
86 [Documentation] Remove people container from the datastore.
87 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/people
88 # TODO: Add specific error check on Get attempt.
93 [Documentation] Suite setup keyword
94 SetupUtils.Setup_Utils_For_Setup_And_Teardown
95 TemplatedRequests.Create_Default_Session
98 [Documentation] Issue invalid RPC requests and assert appropriate http status code
99 # So far only buy-car is checked, but other RPCs such as add-car may be added later.
100 ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error
101 ... TemplatedRequests.Post_As_Json_To_Uri
102 ... uri=restconf/operations/car-purchase:buy-car
103 ... data={"input":{}}
104 # TODO: Create template directory for this?
105 BuiltIn.Should_Not_Contain ${message} '50