Definitions of needed test suites and test cases
[integration/test.git] / csit / suites / iotdm / basic / 102_ProceduresContent.robot
1 *** Settings ***
2 Documentation     Test suite tests Container and ContentInstance resources according to OneM2M specifications:
3 ...               <container>: (TS-0001: 10.2.4 <container> Resource Procedures; TS-0004 7.4.6 Resource Type <container>)
4 ...               <contentInstance>: (TS-0001 10.2.19 <contentInstance> Resource Procedures; TS-0004 7.4.7 Resource Type <contentInstance>)
5 Suite Setup       Create Session    session    http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
6 Suite Teardown    Delete All Sessions
7 Library           RequestsLibrary
8 Library           ../../../libraries/Common.py
9 Resource          ../../../libraries/Utils.robot
10 Resource          ../../../variables/Variables.robot
11
12 *** Variables ***
13
14 *** Test Cases ***
15 1.00 C/R Container, positive: With valid contentInstance resources
16     [Documentation]    Create container resource with more than one contentInstance child resources.
17     ...    Retrieve the container with all attributes and all child resources by one request and
18     ...    verify the response.
19     [Tags]    not-implemented    exclude
20     TODO
21
22 1.01 C/R Container negative: Without contentInstance resources, without subscription
23     [Documentation]    Create container resource without contentInstance child resources and without subscription
24     ...    resource.
25     ...    Retrieve the container with all attributes and all child resources by one request and
26     ...    verify the error code and error message of the response.
27     [Tags]    not-implemented    exclude
28     TODO
29
30 1.02 C/R Container negative: Without contentInstance resources, with subscription, eventType != E
31     [Documentation]    Create container resource without contentInstance child resources and with subscription resource
32     ...    with eventType attribute set to other value than E.
33     ...    Retrieve the container with all attributes and all child resources by one request and
34     ...    verify the error code and error message of the response.
35     [Tags]    not-implemented    exclude
36     TODO
37
38 1.03 C/R Container positive: Without contentInstance resources, with subscription, eventType == E
39     [Documentation]    Create container resource without contentInstance child resources and with subscription resource
40     ...    with eventType attribute set to value E.
41     ...    Verify this handling scenario from TS-0001, timer will not expire in this case:
42     ...    "There is a subscription on the <container> resource with the eventType 'e)'
43     ...    set (oneM2M TS-0001, table 9.6.8-3) so a notification is triggered, a timer shall be set and the
44     ...    Receiver shall delay the response until a <constentInstance> resource is available in the
45     ...    <container> resource, or until the timer expires; in that last case the Receiver shall respond
46     ...    with an error. If the Result Expiration Timestamp parameter is received from the Originator, the
47     ...    timer should be set to enforce this parameter, otherwise, the timer is set, based on the local
48     ...    policy configured at the Hosting CSE."
49     [Tags]    not-implemented    exclude
50     TODO
51
52 1.04 C/R Container negative: Without contentInstance resources, with subscription, eventType == E
53     [Documentation]    Create container resource without contentInstance child resources and with subscription resource
54     ...    with eventType attribute set to value E.
55     ...    Verify this handling scenario from TS-0001, timer will expire in this case:
56     ...    "There is a subscription on the <container> resource with the eventType 'e)'
57     ...    set (oneM2M TS-0001, table 9.6.8-3) so a notification is triggered, a timer shall be set and the
58     ...    Receiver shall delay the response until a <constentInstance> resource is available in the
59     ...    <container> resource, or until the timer expires; in that last case the Receiver shall respond
60     ...    with an error. If the Result Expiration Timestamp parameter is received from the Originator, the
61     ...    timer should be set to enforce this parameter, otherwise, the timer is set, based on the local
62     ...    policy configured at the Hosting CSE."
63     [Tags]    not-implemented    exclude
64     TODO
65
66 1.05 C/R Container negative: With stale contentInstance resources, without subscription
67     [Documentation]    Create container resource with more than one contentInstance child resources and without
68     ...    subscription resource. Let the contentInstance resources become stale.
69     ...    Retrieve the container with all attributes and all child resources by one request and
70     ...    verify the error code and error message of the response.
71     [Tags]    not-implemented    exclude
72     TODO
73
74 1.06 C/R Container negative: With stale contentInstance resources, with subscription, eventType != E
75     [Documentation]    Create container resource with more than one contentInstance child resources and with
76     ...    subscription resource with eventType attribute set to other value than E.
77     ...    Let the contentInstance resources become stale.
78     ...    Retrieve the container with all attributes and all child resources by one request and
79     ...    verify the error code and error message of the response.
80     [Tags]    not-implemented    exclude
81     TODO
82
83 1.07 C/R Container positive: With stale contentInstance resources, with subscription, eventType == E
84     [Documentation]    Create container resource with more than one contentInstance child resources and with
85     ...    subscription resource with eventType attribute set to value E. Let the contentInstance resources
86     ...    become stale.
87     ...    Verify this handling scenario from TS-0001, timer will not expire in this case:
88     ...    "There is a subscription on the <container> resource with the eventType 'e)'
89     ...    set (oneM2M TS-0001, table 9.6.8-3) so a notification is triggered, a timer shall be set and the
90     ...    Receiver shall delay the response until a <constentInstance> resource is available in the
91     ...    <container> resource, or until the timer expires; in that last case the Receiver shall respond
92     ...    with an error. If the Result Expiration Timestamp parameter is received from the Originator, the
93     ...    timer should be set to enforce this parameter, otherwise, the timer is set, based on the local
94     ...    policy configured at the Hosting CSE."
95     [Tags]    not-implemented    exclude
96     TODO
97
98 1.08 C/R Container negative: With stale contentInstance resources, with subscription, eventType == E
99     [Documentation]    Create container resource with more than one contentInstance child resources and with
100     ...    subscription resource with eventType attribute set to value E. Let the contentInstance resources
101     ...    become stale.
102     ...    Verify this handling scenario from TS-0001, timer will expire in this case:
103     ...    "There is a subscription on the <container> resource with the eventType 'e)'
104     ...    set (oneM2M TS-0001, table 9.6.8-3) so a notification is triggered, a timer shall be set and the
105     ...    Receiver shall delay the response until a <constentInstance> resource is available in the
106     ...    <container> resource, or until the timer expires; in that last case the Receiver shall respond
107     ...    with an error. If the Result Expiration Timestamp parameter is received from the Originator, the
108     ...    timer should be set to enforce this parameter, otherwise, the timer is set, based on the local
109     ...    policy configured at the Hosting CSE."
110     [Tags]    not-implemented    exclude
111     TODO
112
113 2.00 C/R Containers: Prepare set of container resources for next TCs
114     [Documentation]    This TC prepares container resources for testing of this procedure described in TS-0001:
115     ...    "If the newly created <contentInstance> resource violates any of the policies defined in the
116     ...    parent <container> resource (e.g. maxNrOfInstances or maxByteSize), then the oldest
117     ...    <contentInstance> resources shall be removed from the <container> to enable the creation of the
118     ...    new <contentInstance> resource."
119     [Tags]    not-implemented    exclude
120     TODO
121
122 2.01 C/R ContentInstance: Container with maxNrOfInstances set to 3
123     [Documentation]    Create at least 5 contentInstance resources in container with maxNrOfInstances
124     ...    attribute set to 3 and verify result of each create operation if the first three passed and
125     ...    none contentInstance deleted. Verify that the next two operations passed and oldest
126     ...    contentInstance resources has been deleted.
127     [Tags]    not-implemented    exclude
128     TODO
129
130 2.02 C/R ContentInstance: Container with maxByteSize set to N, multiple contentInstances
131     [Documentation]    Create at least 5 contentInstance resources in container with maxByteSize
132     ...    attribute set to N and verify result of each create operation if the first three passed and
133     ...    none contentInstance deleted. Verify that the next two operations passed and oldest
134     ...    contentInstance resources has been deleted.
135     [Tags]    not-implemented    exclude
136     TODO
137
138 2.03 C/R ContentInstance: Container with maxByteSize set to N, single contentInstance
139     [Documentation]    Try to create such contentInstance resource which is the first contentInstance resource of the
140     ...    parent container resource and which has content size higher than N value set in maxByteSize
141     ...    attribute of the parent container.
142     ...    Verify if the response includes NOT_ACCEPTABLE error.
143     ...    Create also contentInstance with content size equal to N and verify if such contentInstance has
144     ...    been successfully created.
145     [Tags]    not-implemented    exclude
146     TODO
147
148 2.04 C/R ContentInstance: Container with maxNrOfInstances and maxByteSize, violation of maxNrOfInstances
149     [Documentation]    Create at least 5 contentInstance resources in container with maxNrOfInstances
150     ...    attribute set to 3 and and maxByteSize set to N. Sum of all five contentInstance resources
151     ...    content sizes is lower than N so the maxByteSize is not violated in this TC.
152     ...    Verify result of create operations if the first three passed and none contentInstance is
153     ...    deleted. Verify that the next two operations passed and oldest contentInstance resources has
154     ...    been deleted.
155     [Tags]    not-implemented    exclude
156     TODO
157
158 2.05 C/R ContentInstance: Container with maxNrOfInstances and maxByteSize, violation of maxByteSize
159     [Documentation]    Create at least 4 contentInstance resources in container with maxNrOfInstances
160     ...    attribute set to 4 and and maxByteSize set to N. Sum of all first two contentInstance
161     ...    resources content sizes is lower than N so the maxByteSize is not violated by them.
162     ...    Verify result of create operations if the first two passed and none contentInstance is
163     ...    deleted. Verify that the next two operations passed and oldest contentInstance resources has
164     ...    been deleted due to violation of the maxByteSize.
165     [Tags]    not-implemented    exclude
166     TODO
167
168 2.06 C/R ContentInstance: Container with maxNrOfInstances and maxByteSize, no contentInstance, too big content
169     [Documentation]    Create single contentInstance in container without contentInstances and with maxNrOfInstances
170     ...    attribute set to 4 and maxByteSize set to N. Content size of the new contentInstance
171     ...    resource is higher than N so it violates the maxByteSize and the operation results with
172     ...    NOT_ACCEPTABLE error.
173     ...    Verify the error received in response and verify that the contentInstanse has not been created.
174     [Tags]    not-implemented    exclude
175     TODO
176
177 2.07 C/R ContentInstance: Container with maxNrOfInstances and maxByteSize, with contentInstance, too big content
178     [Documentation]    Create single contentInstance in container with three contentInstances and with maxNrOfInstances
179     ...    attribute set to 4 and maxByteSize set to N. Content size of the new contentInstance
180     ...    resource is higher than N so it violates the maxByteSize and the operation results with
181     ...    NOT_ACCEPTABLE error.
182     ...    Verify the error received in response and verify that the contentInstanse has not been created
183     ...    and no any contentInstance child resource has been deleted from the parent container.
184     [Tags]    not-implemented    exclude
185     TODO
186
187 2.08 C/R ContentInstance: No violation after violation of maxByteSize
188     [Documentation]    Use container with maxNrOfInstances set to 2 and maxByteSize set to N.
189     ...    1. Create first contentInstance which doesn't violate maxByteSize.
190     ...    2. Create second contentInstance which violates maxByteSize so the first one is deleted.
191     ...    3. Create third contentInstance which doesn't violate maxByteSize. (So 2. and 3. are there)
192     ...    4. Create fourth contentInstance with content size so big that second and third
193     ...    contentInstances must be deleted.
194     [Tags]    not-implemented    exclude
195     TODO
196
197 3.00 U/R ContentInstance: Operation not allowed
198     [Documentation]    Test update operation targetted to contentInstance resource. Verify the error response if
199     ...    includes OPERATION_NOT_ALLOWED and verify that the contentInstance has not been updated.
200     [Tags]    not-implemented    exclude
201     TODO
202
203 4.00 Container stateTag: Update of the container itself
204     [Documentation]    Test update of container resource and verify that stateTag attribute has been incremented.
205     [Tags]    not-implemented    exclude
206     TODO
207
208 4.01.00 Container stateTag: Create operation of contentInstance
209     [Documentation]    Test Create operation of child contentInstance resource of the container. Verify that
210     ...    stateTag of the container has been incremented and stateTag of the contentInstance resource
211     ...    was set to the value of container's stateTag.
212     [Tags]    not-implemented    exclude
213     TODO
214
215 4.01.01 Container stateTag: CUD operations of child resources - contentInstance
216     [Documentation]    Test CUD operations with contentInstance child resoruces of the container resource and
217     ...    verify that stateTag attribute of the parent container has been incremented.
218     [Tags]    not-implemented    exclude
219     TODO
220
221 4.01.02 Container stateTag: CUD operations of child resources - container
222     [Documentation]    Test CUD operations with container child resoruces of the container parent resource and
223     ...    verify that stateTag attribute of the parent container has been incremented.
224     [Tags]    not-implemented    exclude
225     TODO
226
227 4.01.03 Container stateTag: CUD operations of child resources - subscription
228     [Documentation]    Test CUD operations with subscription child resoruces of the container parent resource and
229     ...    verify that stateTag attribute of the parent container has been incremented.
230     [Tags]    not-implemented    exclude
231     TODO
232
233 4.02.01 Container stateTag + notification: CUD operations of child resources - contentInstance
234     [Documentation]    Test CUD operations with contentInstance child resoruces of the container resource
235     ...    with subscription.
236     ...    Verify that stateTag attribute of the parent container has been incremented and it has
237     ...    trigerred notification.
238     [Tags]    not-implemented    exclude
239     TODO
240
241 4.02.02 Container stateTag + notification: CUD operations of child resources - container
242     [Documentation]    Test CUD operations with container child resoruces of the container resource
243     ...    with subscription.
244     ...    Verify that stateTag attribute of the parent container has been incremented and it has
245     ...    trigerred notification.
246     [Tags]    not-implemented    exclude
247     TODO
248
249 4.02.03 Container stateTag + notification: CUD operations of child resources - subscription
250     [Documentation]    Test CUD operations with subscription child resoruces of the container resource
251     ...    with subscription.
252     ...    Verify that stateTag attribute of the parent container has been incremented and it has
253     ...    trigerred notification.
254     [Tags]    not-implemented    exclude
255     TODO
256
257 *** Keywords ***
258 TODO
259     Fail    "Not implemented"