2 Documentation Tests for Access Control Policy (ACP) resource attributes
4 Resource ../../../libraries/SubStrings.robot
5 Library ../../../libraries/IoTDM/criotdm.py
7 Resource ../../../variables/Variables.robot
8 Resource ../../../libraries/IoTDM/IoTDMKeywords.robot
10 Suite Setup IOTDM Basic Suite Setup ${ODL_SYSTEM_1_IP} ${ODL_RESTCONF_USER} ${ODL_RESTCONF_PASSWORD}
11 Suite Teardown Kill The Tree ${ODL_SYSTEM_1_IP} InCSE1 admin admin
17 ${rt_contentInstance} 4
22 1.0.0 Test whether default ACP exist
23 Modify Headers Origin ${iserver} admin
24 ${r} = Retrieve Resource ${iserver} InCSE1/_defaultACP
27 ${status_code} = Status Code ${r}
28 Should Be True 199 < ${status_code} < 299
30 1.0.1 ACP C/R resource with mandatory common and specific attributes only
31 [Documentation] After Created, test whether all the mandatory attribtues exist.
32 ${attr} = Set Variable
33 ... "pv":{"acr":[{"acor" : ["111","222"],"acop":35}, {"acor" : ["111","222"],"acop":35}]}, "pvs":{"acr":[{"acor" : ["111","222"],"acop":7}, {"acor" : ["111","222"],"acop":9}]}, "rn":"Acp1"
34 ${r} = Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
35 ${status_code} = Status Code ${r}
36 Should Be Equal As Integers ${status_code} 201
37 ${text} = Convert To String ${r.text}
38 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
40 1.0.2 ACP D/R: resource with mandatory common and specific attributes only
41 [Tags] not-implemented exclude
44 2 ACP common attributes
45 [Documentation] (TODO remove when implemented), next TCs verifies particular common attribute of ACP.
46 [Tags] not-implemented exclude
49 2.01 ACP common attribute: resourceName
50 [Tags] not-implemented exclude
53 2.02 ACP common attribute: resourceType
54 [Tags] not-implemented exclude
57 2.03 ACP common attribute: resourceID
58 [Tags] not-implemented exclude
61 2.04 ACP common attribute: parentID
62 [Tags] not-implemented exclude
65 2.05 ACP common attribute: expirationTime
66 [Tags] not-implemented exclude
69 2.06 ACP common attribute: labels
70 [Tags] not-implemented exclude
73 2.07 ACP common attribute: creationTime
74 [Tags] not-implemented exclude
77 2.08 ACP common attribute: lastModifiedTime
78 [Tags] not-implemented exclude
81 2.09 ACP common attribute: announceTo
82 [Tags] not-implemented exclude
85 2.10 ACP common attribute: announcedAttribute
86 [Tags] not-implemented exclude
89 3 ACP specific attributes
90 [Documentation] (TODO remove when implemented), next TCs verifies particular specific attribute of ACP.
91 [Tags] not-implemented exclude
94 3.01 ACP specific attributes: priviliges, selfPrivileges
95 [Tags] not-implemented exclude
96 # TODO TCs here should implement all sub-cases as described in the help file
97 # TODO next TC definities just shows subset of TCs and how it could be done
100 3.01.01 ACP U/R: priviliges attribute: Update priviliges attribute only
101 [Documentation] Update only priviliges attribute of ACP and verify by Retrieve operation.
102 [Tags] not-implemented exclude
105 3.01.02 ACP U/R: selfPriviliges attribute: Update selfPriviliges attribute only
106 [Documentation] Update only selfPriviliges attribute of ACP and verify by Retrieve operation.
107 [Tags] not-implemented exclude
110 3.01.03 ACP U/R: priviliges attribute: Delete priviliges attribute only
111 [Documentation] NEGATIVE: Use Update operation to set priviliges attribute to null. Verify error message and
112 ... verify original ACP resource by Retrieve operation.
113 [Tags] not-implemented exclude
116 3.01.04 ACP U/R: selfPriviliges attribute: Delete selfPriviliges attribute only
117 [Documentation] NEGATIVE: Use Update operation to set selfPriviliges attribute to null. Verify error message and
118 ... verify original ACP resource by Retrieve operation.
119 [Tags] not-implemented exclude
122 3.02 ACP elements of specific attributes: priviliges, selfPrivileges
123 [Tags] not-implemented exclude
124 # TODO TCs here should implement all sub-cases as described in the help file
125 # TODO next TC definities just shows subset of TCs and how it could be done
128 3.02.01 ACP C/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
129 [Documentation] After Created, test whether all the mandatory elements exist.
130 ${attr} = Set Variable
131 ... "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv4":["127.0.0.1"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp2"
132 ${r} = Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
133 ${status_code} = Status Code ${r}
134 Should Be Equal As Integers ${status_code} 201
135 ${text} = Convert To String ${r.text}
136 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
138 3.02.02 ACP U/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
139 [Documentation] After Updated, test whether all the mandatory elements exist.
140 ... Update resources with/without tested element.
141 [Tags] not-implemented exclude
144 3.02.03 ACP D/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
145 [Documentation] After Deleted, verify by Retrieve operation. Delete resources with/without tested element.
146 [Tags] not-implemented exclude
149 3.02.04 ACP C/R: priviliges, selfPrivileges attributes: With invalid IPv4 acip element
150 [Documentation] NEGATIVE: Create with invalid ipv4 address, check error message and verify by Retrieve operation.
151 ${attr} = Set Variable
152 ... "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv4":["127.0.01"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp3"
153 ${error} = Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp}
155 Should Start with ${error} Cannot create this resource [400]
156 Should Contain ${error} not a valid Ipv4 address
157 # TODO Verify by Retrieve no operation
159 3.02.05 ACP U/R: priviliges, selfPrivileges attributes: With invalid IPv4 acip element
160 [Documentation] NEGATIVE: Update with invalid ipv4 address, check error message and verify by Retrieve operation.
161 ... Update resources with/without tested element.
162 [Tags] not-implemented exclude
165 3.02.06 ACP C/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
166 [Documentation] After Created, test whether all the mandatory elements exist.
167 ${attr} = Set Variable
168 ... "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv6":["2001:db8:0:0:0:ff00:42:8329"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp4"
169 ${r} = Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
170 ${status_code} = Status Code ${r}
171 Should Be Equal As Integers ${status_code} 201
172 ${text} = Convert To String ${r.text}
173 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
174 # TODO verify by Retrieve operation
176 3.02.07 ACP U/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
177 [Documentation] After Updated, test whether all the mandatory elements exist. Update ACP resources with/without
179 [Tags] not-implemented exclude
182 3.02.08 ACP D/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
183 [Documentation] After Deleted, test whether all the mandatory elements exist. Delete ACP resources with/without
185 [Tags] not-implemented exclude
188 3.02.09 ACP C/R: priviliges, selfPrivileges attributes: With invalid IPv6 acip element
189 [Documentation] NEGATIVE: Create with invalid ipv6 address, check error message and verify by Retrieve operation.
190 ${attr} = Set Variable
191 ... "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv6":["2001:db8:0:0:0:ff00:42"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp3"
192 ${error} = Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp}
194 Should Start with ${error} Cannot create this resource [400]
195 Should Contain ${error} not a valid Ipv6 address
196 # TODO: verify by retrieve operation
198 3.02.10 ACP U/R: priviliges, selfPrivileges attributes: With invalid IPv6 acip element
199 [Documentation] NEGATIVE: Update with invalid ipv6 address, check error message and verify by Retrieve operation.
200 ... Update resources with/without tested element.
201 [Tags] not-implemented exclude
204 3.03.01 ACP C/R: priviliges, selfPrivileges attributes: With accessControlWindow element
205 [Documentation] Create ACP with accessControlWindow element and verify by Retrieve operation.
206 [Tags] not-implemented exclude
209 3.03.02 ACP U/R: priviliges, selfPrivileges attributes: With accessControlWindow element
210 [Documentation] Update the accessControlWindow element of ACP resources with/without tested element and verify
211 ... by Retrieve operation.
212 [Tags] not-implemented exclude
215 3.03.03 ACP D/R: priviliges, selfPrivileges attributes: With accessControlWindow element
216 [Documentation] Delete ACP with accessControlWindow element and verify by Retrieve operation.
217 [Tags] not-implemented exclude
220 3.03.04 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlWindow element
221 [Documentation] NEGTIVE: Create ACP with invalid accessControlWindow element and check error message and
222 ... verify by Retrieve operation.
223 [Tags] not-implemented exclude
226 3.03.05 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlWindow element
227 [Documentation] Update the invalid value of accessControlWindow element of ACP resources with/without tested
228 ... element and verify by Retrieve operation.
229 [Tags] not-implemented exclude
232 3.03.06 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
233 [Documentation] Create ACP with multiple accessControlWindow elements and verify by Retrieve operation.
234 [Tags] not-implemented exclude
237 3.03.07 ACP U/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
238 [Documentation] Update multiple accessControlWindow elements of ACP resources with/without tested elements and verify
239 ... by Retrieve operation.
240 [Tags] not-implemented exclude
243 3.03.08 ACP D/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
244 [Documentation] Delete ACP with multiple accessControlWindow elements and verify by Retrieve operation.
245 [Tags] not-implemented exclude
248 3.03.09 ACP C/R: priviliges, selfPrivileges attributes: With multiple invalid accessControlWindow elements
249 [Documentation] NEGTIVE: Create ACP with multiple invalid accessControlWindow elements and check error message and
250 ... verify by Retrieve operation.
251 ... Test also combinations of valid and invalid elements.
252 [Tags] not-implemented exclude
255 3.03.10 ACP U/R: priviliges, selfPrivileges attributes: With multiple invalid accessControlWindow elements
256 [Documentation] Update the invalid value of accessControlWindow element of ACP resources with/without tested
257 ... element and verify by Retrieve operation.
258 ... Test also combinations of valid and invalid elements.
259 [Tags] not-implemented exclude
262 3.03.11 ACP C/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
263 [Documentation] Create ACP with accessControlLocationRegions element and verify by Retrieve operation.
264 [Tags] not-implemented exclude
267 3.03.12 ACP U/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
268 [Documentation] Update the accessControlLocationRegions element of ACP resources with/without tested element and verify
269 ... by Retrieve operation.
270 [Tags] not-implemented exclude
273 3.03.13 ACP D/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
274 [Documentation] Delete ACP with accessControlLocationRegions element and verify by Retrieve operation.
275 [Tags] not-implemented exclude
278 3.03.14 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlLocationRegions element
279 [Documentation] NEGTIVE: Create ACP with invalid accessControlLocationRegions element and check error message and
280 ... verify by Retrieve operation.
281 [Tags] not-implemented exclude
284 3.03.15 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlLocationRegions element
285 [Documentation] Update the invalid value of accessControlLocationRegions element of ACP resources with/without tested
286 ... element and verify by Retrieve operation.
287 [Tags] not-implemented exclude
290 3.03.16 ACP C/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
291 [Documentation] Create ACP with accessControlAuthenticationFlag element and verify by Retrieve operation.
292 [Tags] not-implemented exclude
295 3.03.17 ACP U/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
296 [Documentation] Update the accessControlAuthenticationFlag element of ACP resources with/without tested element and verify
297 ... by Retrieve operation.
298 [Tags] not-implemented exclude
301 3.03.18 ACP D/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
302 [Documentation] Delete ACP with accessControlAuthenticationFlag element and verify by Retrieve operation.
303 [Tags] not-implemented exclude
306 3.03.19 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlAuthenticationFlag element
307 [Documentation] NEGTIVE: Create ACP with invalid accessControlAuthenticationFlag element and check error message and
308 ... verify by Retrieve operation.
309 [Tags] not-implemented exclude
312 3.03.20 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlAuthenticationFlag element
313 [Documentation] Update the invalid value of accessControlAuthenticationFlag element of ACP resources with/without tested
314 ... element and verify by Retrieve operation.
315 [Tags] not-implemented exclude
318 3.03.21 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
319 [Documentation] Create ACP with multiple accessControlContext elements and verify by Retrieve operation.
320 [Tags] not-implemented exclude
323 3.03.22 ACP U/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
324 [Documentation] Update ACP with multiple accessControlContext elements and verify by Retrieve operation.
325 [Tags] not-implemented exclude
328 3.03.23 ACP D/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
329 [Documentation] Delete ACP with multiple accessControlContext elements and verify by Retrieve operation.
330 [Tags] not-implemented exclude
333 3.03.24 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlRules elements
334 [Documentation] Create ACP with multiple accessControlRules element and verify by Retrieve operation.
335 [Tags] not-implemented exclude
338 4.01 ACP C/R: With all mandatory and optional common and specific attributes
339 [Tags] not-implemented exclude
342 4.02 ACP U(modify)/R: With all mandatory and optional common and specific attributes
343 [Tags] not-implemented exclude
346 4.03 ACP D/R: With all mandatory and optional common and specific attributes
347 [Tags] not-implemented exclude
350 4.04 ACP Test Create and Update operations with non-existing attributes and elements
351 [Tags] not-implemented exclude
352 # TODO use the approach described in the help file
355 5.00 ACP CRUD with all valid RCN values
356 [Documentation] CRUD operations with all mandatory and optiona common and specific attributes, test all RCN values
357 [Tags] not-implemented exclude
362 Connect And Create Resource
363 [Arguments] ${targetURI} ${resoutceType} ${attr} ${resourceName}=${EMPTY}
364 ${iserver} = Connect To Iotdm ${ODL_SYSTEM_1_IP} ${ODL_RESTCONF_USER} ${ODL_RESTCONF_PASSWORD} http
365 ${r} = Create Resource ${iserver} ${targetURI} ${resoutceType} ${attr} ${resourceName}
366 ${status_code} = Status Code ${r}
367 Should Be Equal As Integers ${status_code} 201
375 ${status_code} = Status Code ${r}
376 Should Be True 199 < ${status_code} < 299
379 Fail "Not implemented"