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.
12 Suite Setup Start_Suite
13 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
14 Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
15 Variables ${CURDIR}/../../../variables/Variables.py
16 Resource ${CURDIR}/../../../libraries/SetupUtils.robot
17 Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
20 ${VAR_BASE} ${CURDIR}/../../../variables/carpeople/libtest
22 ${TIMEOUT_BUG_4220} 60s
26 [Documentation] Issue (invalid) RPC requests until 501 goes away (or timeout expires).
27 ... See https://bugs.opendaylight.org/show_bug.cgi?id=4220
28 BuiltIn.Wait_Until_Keyword_Succeeds ${TIMEOUT_BUG_4220} 5s Check_Rpc_Readiness
31 [Documentation] Add a person entry, verify it is seen in the datastore.
32 TemplatedRequests.Put_As_Json_Templated folder=${VAR_BASE}/person
33 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/person verify=True
36 [Documentation] Add a car entry, verify it is seen in the datastore.
37 TemplatedRequests.Put_As_Json_Templated folder=${VAR_BASE}/car
38 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/car verify=True
40 Purchase_And_Verify_Car
41 [Documentation] Post RPC to buy a car.
42 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/purchase
43 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/car_person verify=True
46 [Documentation] Remove the car-people entry from the datastore.
47 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/car_person
48 # TODO: Add specific error check on Get attempt.
51 [Documentation] Remove the car entry from the datastore.
52 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/car
53 # TODO: Add specific error check on Get attempt.
56 [Documentation] Remove the person entry from the datastore.
57 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/person
58 # TODO: Add specific error check on Get attempt.
61 [Documentation] Create container with several people, verify it is seen in the datastore..
62 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/people iterations=${BULK_SIZE}
63 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/people verify=True iterations=${BULK_SIZE}
66 [Documentation] Create container with several cars, verify it is seen in the datastore.
67 TemplatedRequests.Post_As_Json_Templated folder=${VAR_BASE}/cars iterations=${BULK_SIZE}
68 TemplatedRequests.Get_As_Json_Templated folder=${VAR_BASE}/cars verify=True iterations=${BULK_SIZE}
69 # TODO: Add cases with purchase loop.
72 [Documentation] Remove cars-people container from the datastore.
73 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/cars_people
74 # TODO: Add specific error check on Get attempt.
77 [Documentation] Remove cars container from the datastore.
78 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/cars
79 # TODO: Add specific error check on Get attempt.
82 [Documentation] Remove people container from the datastore.
83 TemplatedRequests.Delete_Templated folder=${VAR_BASE}/people
84 # TODO: Add specific error check on Get attempt.
88 [Documentation] Suite setup keyword
89 SetupUtils.Setup_Utils_For_Setup_And_Teardown
90 TemplatedRequests.Create_Default_Session
93 [Documentation] Issue invalid RPC requests and assert appropriate http status code
94 # So far only buy-car is checked, but other RPCs such as add-car may be added later.
95 ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error TemplatedRequests.Post_As_Json_To_Uri uri=restconf/operations/car-purchase:buy-car data={"input":{}}
96 # TODO: Create template directory for this?
97 BuiltIn.Should_Not_Contain ${message} '50