2 Documentation Tests for Access Control Policy (ACP) resource attributes
3 Suite Setup IOTDM Basic Suite Setup ${ODL_SYSTEM_1_IP} ${ODL_RESTCONF_USER} ${ODL_RESTCONF_PASSWORD}
4 Suite Teardown Kill The Tree ${ODL_SYSTEM_1_IP} InCSE1 admin admin
5 Resource ../../../libraries/SubStrings.robot
6 Library ../../../libraries/IoTDM/criotdm.py
8 Resource ../../../variables/Variables.robot
9 Resource ../../../libraries/IoTDM/IoTDMKeywords.robot
14 ${rt_contentInstance} 4
18 1.0.0 Test whether default ACP exist
19 Modify Headers Origin ${iserver} admin
20 ${r} = Retrieve Resource ${iserver} InCSE1/_defaultACP
23 ${status_code} = Status Code ${r}
24 Should Be True 199 < ${status_code} < 299
26 1.0.1 ACP C/R resource with mandatory common and specific attributes only
27 [Documentation] After Created, test whether all the mandatory attribtues exist.
28 ${attr} = Set Variable "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"
29 ${r}= Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
30 ${status_code} = Status Code ${r}
31 Should Be Equal As Integers ${status_code} 201
32 ${text} = Convert To String ${r.text}
33 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
35 1.0.2 ACP D/R: resource with mandatory common and specific attributes only
36 [Tags] not-implemented exclude
39 2 ACP common attributes
40 [Documentation] (TODO remove when implemented), next TCs verifies particular common attribute of ACP.
41 [Tags] not-implemented exclude
44 2.01 ACP common attribute: resourceName
45 [Tags] not-implemented exclude
48 2.02 ACP common attribute: resourceType
49 [Tags] not-implemented exclude
52 2.03 ACP common attribute: resourceID
53 [Tags] not-implemented exclude
56 2.04 ACP common attribute: parentID
57 [Tags] not-implemented exclude
60 2.05 ACP common attribute: expirationTime
61 [Tags] not-implemented exclude
64 2.06 ACP common attribute: labels
65 [Tags] not-implemented exclude
68 2.07 ACP common attribute: creationTime
69 [Tags] not-implemented exclude
72 2.08 ACP common attribute: lastModifiedTime
73 [Tags] not-implemented exclude
76 2.09 ACP common attribute: announceTo
77 [Tags] not-implemented exclude
80 2.10 ACP common attribute: announcedAttribute
81 [Tags] not-implemented exclude
84 3 ACP specific attributes
85 [Documentation] (TODO remove when implemented), next TCs verifies particular specific attribute of ACP.
86 [Tags] not-implemented exclude
89 3.01 ACP specific attributes: priviliges, selfPrivileges
90 [Tags] not-implemented exclude
91 # TODO TCs here should implement all sub-cases as described in the help file
92 # TODO next TC definities just shows subset of TCs and how it could be done
95 3.01.01 ACP U/R: priviliges attribute: Update priviliges attribute only
96 [Documentation] Update only priviliges attribute of ACP and verify by Retrieve operation.
97 [Tags] not-implemented exclude
100 3.01.02 ACP U/R: selfPriviliges attribute: Update selfPriviliges attribute only
101 [Documentation] Update only selfPriviliges attribute of ACP and verify by Retrieve operation.
102 [Tags] not-implemented exclude
105 3.01.03 ACP U/R: priviliges attribute: Delete priviliges attribute only
106 [Documentation] NEGATIVE: Use Update operation to set priviliges attribute to null. Verify error message and
107 ... verify original ACP resource by Retrieve operation.
108 [Tags] not-implemented exclude
111 3.01.04 ACP U/R: selfPriviliges attribute: Delete selfPriviliges attribute only
112 [Documentation] NEGATIVE: Use Update operation to set selfPriviliges attribute to null. Verify error message and
113 ... verify original ACP resource by Retrieve operation.
114 [Tags] not-implemented exclude
117 3.02 ACP elements of specific attributes: priviliges, selfPrivileges
118 [Tags] not-implemented exclude
119 # TODO TCs here should implement all sub-cases as described in the help file
120 # TODO next TC definities just shows subset of TCs and how it could be done
123 3.02.01 ACP C/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
124 [Documentation] After Created, test whether all the mandatory elements exist.
125 ${attr} = Set Variable "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"
126 ${r}= Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
127 ${status_code} = Status Code ${r}
128 Should Be Equal As Integers ${status_code} 201
129 ${text} = Convert To String ${r.text}
130 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
132 3.02.02 ACP U/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
133 [Documentation] After Updated, test whether all the mandatory elements exist.
134 ... Update resources with/without tested element.
135 [Tags] not-implemented exclude
138 3.02.03 ACP D/R: priviliges, selfPrivileges attributes: With valid IPv4 acip element
139 [Documentation] After Deleted, verify by Retrieve operation. Delete resources with/without tested element.
140 [Tags] not-implemented exclude
143 3.02.04 ACP C/R: priviliges, selfPrivileges attributes: With invalid IPv4 acip element
144 [Documentation] NEGATIVE: Create with invalid ipv4 address, check error message and verify by Retrieve operation.
145 ${attr} = Set Variable "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"
146 ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp}
148 Should Start with ${error} Cannot create this resource [400]
149 Should Contain ${error} not a valid Ipv4 address
150 # TODO Verify by Retrieve no operation
152 3.02.05 ACP U/R: priviliges, selfPrivileges attributes: With invalid IPv4 acip element
153 [Documentation] NEGATIVE: Update with invalid ipv4 address, check error message and verify by Retrieve operation.
154 ... Update resources with/without tested element.
155 [Tags] not-implemented exclude
158 3.02.06 ACP C/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
159 [Documentation] After Created, test whether all the mandatory elements exist.
160 ${attr} = Set Variable "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"
161 ${r}= Create Resource ${iserver} InCSE1 ${rt_acp} ${attr}
162 ${status_code} = Status Code ${r}
163 Should Be Equal As Integers ${status_code} 201
164 ${text} = Convert To String ${r.text}
165 Should Contain All Sub Strings ${text} "ct": "lt": "ty" "ri": "pi":
166 # TODO verify by Retrieve operation
168 3.02.07 ACP U/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
169 [Documentation] After Updated, test whether all the mandatory elements exist. Update ACP resources with/without
171 [Tags] not-implemented exclude
174 3.02.08 ACP D/R: priviliges, selfPrivileges attributes: With valid IPv6 acip element
175 [Documentation] After Deleted, test whether all the mandatory elements exist. Delete ACP resources with/without
177 [Tags] not-implemented exclude
180 3.02.09 ACP C/R: priviliges, selfPrivileges attributes: With invalid IPv6 acip element
181 [Documentation] NEGATIVE: Create with invalid ipv6 address, check error message and verify by Retrieve operation.
182 ${attr} = Set Variable "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"
183 ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp}
185 Should Start with ${error} Cannot create this resource [400]
186 Should Contain ${error} not a valid Ipv6 address
187 # TODO: verify by retrieve operation
189 3.02.10 ACP U/R: priviliges, selfPrivileges attributes: With invalid IPv6 acip element
190 [Documentation] NEGATIVE: Update with invalid ipv6 address, check error message and verify by Retrieve operation.
191 ... Update resources with/without tested element.
192 [Tags] not-implemented exclude
195 3.03.01 ACP C/R: priviliges, selfPrivileges attributes: With accessControlWindow element
196 [Documentation] Create ACP with accessControlWindow element and verify by Retrieve operation.
197 [Tags] not-implemented exclude
200 3.03.02 ACP U/R: priviliges, selfPrivileges attributes: With accessControlWindow element
201 [Documentation] Update the accessControlWindow element of ACP resources with/without tested element and verify
202 ... by Retrieve operation.
203 [Tags] not-implemented exclude
206 3.03.03 ACP D/R: priviliges, selfPrivileges attributes: With accessControlWindow element
207 [Documentation] Delete ACP with accessControlWindow element and verify by Retrieve operation.
208 [Tags] not-implemented exclude
211 3.03.04 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlWindow element
212 [Documentation] NEGTIVE: Create ACP with invalid accessControlWindow element and check error message and
213 ... verify by Retrieve operation.
214 [Tags] not-implemented exclude
217 3.03.05 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlWindow element
218 [Documentation] Update the invalid value of accessControlWindow element of ACP resources with/without tested
219 ... element and verify by Retrieve operation.
220 [Tags] not-implemented exclude
223 3.03.06 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
224 [Documentation] Create ACP with multiple accessControlWindow elements and verify by Retrieve operation.
225 [Tags] not-implemented exclude
228 3.03.07 ACP U/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
229 [Documentation] Update multiple accessControlWindow elements of ACP resources with/without tested elements and verify
230 ... by Retrieve operation.
231 [Tags] not-implemented exclude
234 3.03.08 ACP D/R: priviliges, selfPrivileges attributes: With multiple accessControlWindow elements
235 [Documentation] Delete ACP with multiple accessControlWindow elements and verify by Retrieve operation.
236 [Tags] not-implemented exclude
239 3.03.09 ACP C/R: priviliges, selfPrivileges attributes: With multiple invalid accessControlWindow elements
240 [Documentation] NEGTIVE: Create ACP with multiple invalid accessControlWindow elements and check error message and
241 ... verify by Retrieve operation.
242 ... Test also combinations of valid and invalid elements.
243 [Tags] not-implemented exclude
246 3.03.10 ACP U/R: priviliges, selfPrivileges attributes: With multiple invalid accessControlWindow elements
247 [Documentation] Update the invalid value of accessControlWindow element of ACP resources with/without tested
248 ... element and verify by Retrieve operation.
249 ... Test also combinations of valid and invalid elements.
250 [Tags] not-implemented exclude
253 3.03.11 ACP C/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
254 [Documentation] Create ACP with accessControlLocationRegions element and verify by Retrieve operation.
255 [Tags] not-implemented exclude
258 3.03.12 ACP U/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
259 [Documentation] Update the accessControlLocationRegions element of ACP resources with/without tested element and verify
260 ... by Retrieve operation.
261 [Tags] not-implemented exclude
264 3.03.13 ACP D/R: priviliges, selfPrivileges attributes: With accessControlLocationRegions element
265 [Documentation] Delete ACP with accessControlLocationRegions element and verify by Retrieve operation.
266 [Tags] not-implemented exclude
269 3.03.14 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlLocationRegions element
270 [Documentation] NEGTIVE: Create ACP with invalid accessControlLocationRegions element and check error message and
271 ... verify by Retrieve operation.
272 [Tags] not-implemented exclude
275 3.03.15 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlLocationRegions element
276 [Documentation] Update the invalid value of accessControlLocationRegions element of ACP resources with/without tested
277 ... element and verify by Retrieve operation.
278 [Tags] not-implemented exclude
281 3.03.16 ACP C/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
282 [Documentation] Create ACP with accessControlAuthenticationFlag element and verify by Retrieve operation.
283 [Tags] not-implemented exclude
286 3.03.17 ACP U/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
287 [Documentation] Update the accessControlAuthenticationFlag element of ACP resources with/without tested element and verify
288 ... by Retrieve operation.
289 [Tags] not-implemented exclude
292 3.03.18 ACP D/R: priviliges, selfPrivileges attributes: With accessControlAuthenticationFlag element
293 [Documentation] Delete ACP with accessControlAuthenticationFlag element and verify by Retrieve operation.
294 [Tags] not-implemented exclude
297 3.03.19 ACP C/R: priviliges, selfPrivileges attributes: With invalid accessControlAuthenticationFlag element
298 [Documentation] NEGTIVE: Create ACP with invalid accessControlAuthenticationFlag element and check error message and
299 ... verify by Retrieve operation.
300 [Tags] not-implemented exclude
303 3.03.20 ACP U/R: priviliges, selfPrivileges attributes: With invalid accessControlAuthenticationFlag element
304 [Documentation] Update the invalid value of accessControlAuthenticationFlag element of ACP resources with/without tested
305 ... element and verify by Retrieve operation.
306 [Tags] not-implemented exclude
309 3.03.21 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
310 [Documentation] Create ACP with multiple accessControlContext elements and verify by Retrieve operation.
311 [Tags] not-implemented exclude
314 3.03.22 ACP U/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
315 [Documentation] Update ACP with multiple accessControlContext elements and verify by Retrieve operation.
316 [Tags] not-implemented exclude
319 3.03.23 ACP D/R: priviliges, selfPrivileges attributes: With multiple accessControlContext (acco) elements
320 [Documentation] Delete ACP with multiple accessControlContext elements and verify by Retrieve operation.
321 [Tags] not-implemented exclude
324 3.03.24 ACP C/R: priviliges, selfPrivileges attributes: With multiple accessControlRules elements
325 [Documentation] Create ACP with multiple accessControlRules element and verify by Retrieve operation.
326 [Tags] not-implemented exclude
329 4.01 ACP C/R: With all mandatory and optional common and specific attributes
330 [Tags] not-implemented exclude
333 4.02 ACP U(modify)/R: With all mandatory and optional common and specific attributes
334 [Tags] not-implemented exclude
337 4.03 ACP D/R: With all mandatory and optional common and specific attributes
338 [Tags] not-implemented exclude
341 4.04 ACP Test Create and Update operations with non-existing attributes and elements
342 [Tags] not-implemented exclude
343 # TODO use the approach described in the help file
346 5.00 ACP CRUD with all valid RCN values
347 [Documentation] CRUD operations with all mandatory and optiona common and specific attributes, test all RCN values
348 [Tags] not-implemented exclude
352 Connect And Create Resource
353 [Arguments] ${targetURI} ${resoutceType} ${attr} ${resourceName}=${EMPTY}
354 ${iserver} = Connect To Iotdm ${ODL_SYSTEM_1_IP} ${ODL_RESTCONF_USER} ${ODL_RESTCONF_PASSWORD} http
355 ${r} = Create Resource ${iserver} ${targetURI} ${resoutceType} ${attr} ${resourceName}
356 ${status_code} = Status Code ${r}
357 Should Be Equal As Integers ${status_code} 201
365 ${status_code} = Status Code ${r}
366 Should Be True 199 < ${status_code} < 299
369 Fail "Not implemented"