2 Documentation Tests for Container 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
17 TODO Refactor test suite and implement TCs
18 [Documentation] Refactor this test suite and implement next TCs according to 000_ResourceAttributesNotes.txt03.
19 ... Example of changes is in 024_ResourceAttributesAE.robot
20 [Tags] not-implemented exclude
23 1.1 After Created, test whether all the mandatory attribtues are exist.
24 [Documentation] After Created, test whether all the mandatory attribtues are exist.
25 #==================================================
26 # Container Mandatory Attribute Test
27 #==================================================
28 # For Creation, there are no mandatory input attribute
29 ${attr} = Set Variable "rn":"Container1"
30 ${r}= Create Resource With Command ${iserver} InCSE1 ${rt_container} rcn=3 ${attr}
31 ${container} = Location ${r}
32 ${status_code} = Status Code ${r}
33 Should Be Equal As Integers ${status_code} 201
35 Should Contain All Sub Strings ${text} "ri": "rn": "cni" "lt": "pi":
36 ... "st": "ct": "ty":3 "cbs"
37 Should Not Contain Any Sub Strings ${text} "lbl" "creator" "or"
39 2.11 maxNumberofInstance (mni) can be added when create
40 [Documentation] maxNumberofInstance (mni) can be added when create
41 #==================================================
42 # Container Optional Attribute Test (Allowed)
43 #==================================================
45 # update(create)--> update(modified)-->update (delete)
46 ${attr} = Set Variable "mni":3,"rn":"Container2"
47 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
48 ${text} = Check Response and Retrieve Resource ${r}
49 Should Contain ${text} "mni"
51 Delete the Container2-2.1
52 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
54 2.12 maxNumberofInstance (mni) can be added through update (0-1)
55 [Documentation] maxNumberofInstance (mni) can be added through update (0-1)
56 ${attr} = Set Variable "mni":3
57 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
58 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
59 Should Contain ${text} "mni"
61 2.13 maxNumberofInstance (mni) can be modified through update (1-1)
62 [Documentation] maxNumberofInstance (mni) can be modified through update (1-1)
63 ${attr} = Set Variable "mni":5
64 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
65 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
66 Should Contain ${text} "mni":5
67 Should Not Contain ${text} "mni":3
69 2.14 if set to null, maxnumberofInstance (mni) can be deleted through delete(1-0)
70 [Documentation] if set to null, maxnumberofInstance (mni) can be deleted through delete(1-0)
71 ${attr} = Set Variable "mni":null
72 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
73 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
74 Should Not Contain ${text} "mni"
76 2.21 maxByteSize (mbs) can be added when create
77 [Documentation] maxByteSize (mbs) can be added when create
78 ${attr} = Set Variable "mbs":20,"rn":"Container2"
79 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
80 ${text} = Check Response and Retrieve Resource ${r}
81 Should Contain ${text} "mbs"
83 Delete the Container2-2.2
84 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
86 2.22 maxByteSize (mbs) can be added through update (0-1)
87 [Documentation] maxByteSize (mbs) can be added through update (0-1)
88 ${attr} = Set Variable "mbs":20
89 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
90 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
91 Should Contain ${text} "mbs"
93 2.23 maxByteSize (mbs) can be modified through update (1-1)
94 [Documentation] maxByteSize (mbs) can be modified through update (1-1)
95 ${attr} = Set Variable "mbs":25
96 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
97 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
98 Should Contain ${text} "mbs":25
99 Should Not Contain ${text} "mbs":20
101 2.24 if set to null, maxByteSize (mbs) can be deleted through delete(1-0)
102 [Documentation] if set to null, maxByteSize (mbs) can be deleted through delete(1-0)
103 ${attr} = Set Variable "mbs":null
104 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
105 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
106 Should Not Contain ${text} "mbs"
108 2.31 ontologyRef(or) can be added when create
109 [Documentation] ontologyRef(or) can be added when create
110 ${attr} = Set Variable "or":"http://cisco.com","rn":"Container2"
111 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
112 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container2
113 Should Contain ${text} "or"
115 Delete the Container2-2.3
116 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
118 2.32 ontologyRef(or) can be added through update (0-1)
119 [Documentation] ontologyRef(or) can be added through update (0-1)
120 ${attr} = Set Variable "or":"http://cisco.com"
121 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
122 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
123 Should Contain ${text} "or"
125 2.33 ontologyRef(or) can be modified through update (1-1)
126 [Documentation] ontologyRef(or) can be modified through update (1-1)
127 ${attr} = Set Variable "or":"http://iotdm.com"
128 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
129 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
130 Should Contain ${text} "or":"http://iotdm.com"
131 Should Not Contain ${text} "or":"http://cisco.com"
133 2.34 if set to null, ontologyRef(or) can be deleted through delete(1-0)
134 [Documentation] if set to null, ontologyRef(or) can be deleted through delete(1-0)
135 ${attr} = Set Variable "or":null
136 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
137 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
138 Should Not Contain ${text} "or"
140 2.41 labels can be created through update (0-1)
141 [Documentation] labels can be created through update (0-1)
142 ${attr} = Set Variable "lbl":["label1"]
143 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
144 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
145 Should Contain All Sub Strings ${text} lbl label1
147 2.42 labels can be modified (1-1)
148 [Documentation] labels can be modified (1-1)
149 ${attr} = Set Variable "lbl":["label2"]
150 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
151 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
152 Should Not Contain ${text} label1
153 Should Contain All Sub Strings ${text} lbl label2
155 2.43 if set to null, labels should be deleted(1-0)
156 [Documentation] if set to null, labels should be deleted(1-0)
157 ${attr} = Set Variable "lbl":null
158 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
159 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
160 Should Not Contain Any Sub Strings ${text} lbl label1 label2
162 2.44 labels can be created through update (0-n)
163 [Documentation] labels can be created through update (0-n)
164 ${attr} = Set Variable "lbl":["label3","label4","label5"]
165 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
166 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
167 Should Contain All Sub Strings ${text} lbl label3 label4 label5
169 2.45 labels can be modified (n-n)(across)
170 [Documentation] labels can be modified (n-n)(across)
171 ${attr} = Set Variable "lbl":["label4","label5","label6"]
172 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
173 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
174 Should Not Contain Any Sub Strings ${text} label1 label2 label3
175 Should Contain All Sub Strings ${text} lbl label4 label5 label6
177 2.46 labels can be modified (n-n)(not across)
178 [Documentation] labels can be modified (n-n)(not across)
179 ${attr} = Set Variable "lbl":["label7","label8","label9"]
180 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
181 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
182 Should Not Contain Any Sub Strings ${text} label1 label2 label3 label4 label5
184 Should Contain All Sub Strings ${text} lbl label7 label8 label9
186 2.47 if set to null, labels should be deleted(n-0)
187 [Documentation] if set to null, labels should be deleted(n-0)
188 ${attr} = Set Variable "lbl":null
189 ${r} = update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
190 ${text} = Check Response and Retrieve Resource For Update ${r} InCSE1/Container1
191 Should Not Contain Any Sub Strings ${text} label1 label2 label3 label4 label5
192 ... label6 label7 label8 label9 lbl
193 #======================================================
194 # Container Disturbing Attribute Test, Not Allowed Update
195 #======================================================
196 # using non-valid attribtue to create then expext error
198 3.11 Mulitiple maxNrofInstance should return error
199 [Documentation] Mulitiple maxNrofInstance should return error
200 ${attr} = Set Variable "mni":33,"mni":33
201 ${error} = Create Container Expect Cannot Create Error ${attr}
202 Should Contain All Sub Strings ${error} Duplicate key mni
204 3.12 Mulitiple maxByteSize should return error
205 [Documentation] Mulitiple maxByteSize should return error
206 ${attr} = Set Variable "mbs":44,"mbs":44
207 ${error} = Create Container Expect Cannot Create Error ${attr}
208 Should Contain All Sub Strings ${error} Duplicate key mbs
210 3.13 Multiple creator should return error
211 [Documentation] Multiple creator should return error
212 ${attr} = Set Variable "cr":null,"cr":null
213 ${error} = Create Container Expect Cannot Create Error ${attr}
214 Should Contain All Sub Strings ${error} Duplicate key cr
216 3.14 Multiple ontologyRef should return error
217 [Documentation] Multiple ontologyRef should return error
218 ${attr} = Set Variable "or":"http://cisco.com","or":"http://cisco.com"
219 ${error} = Create Container Expect Cannot Create Error ${attr}
220 Should Contain All Sub Strings ${error} Duplicate key or
222 3.14 Multiple label attribute should return error(multiple array)
223 [Documentation] Multiple label attribute should return error(multiple array)
224 ${attr} = Set Variable "lbl":["ODL1"], "lbl":["dsdsd"]
225 ${error} = Create Container Expect Cannot Create Error ${attr}
226 Should Contain All Sub Strings ${error} Duplicate key lbl
227 # 3.2 Input of Integer using String should return error [Should checked by wenxin]
228 #------------------------------------------------------
229 # using non-valid attribute to update then expect error
231 3.31 resourceType cannot be update.
232 [Documentation] when update resourceType, expect error
233 ${attr} = Set Variable "ty":2
234 ${error} = Update Container Expect Cannot Update Error ${attr}
235 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: ty" Error response is not correct
237 3.32 resourceID cannot be update.
238 [Documentation] update resoureceID then expect error
239 ${attr} = Set Variable "ri":"aaa"
240 ${error} = Update Container Expect Cannot Update Error ${attr}
241 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: ri" Error response is not correct
243 3.33 resouceName cannot be update.(write once)
244 [Documentation] update resourceName and expect error
245 ${attr} = Set Variable "rn":"aaa"
246 ${error} = Update Container Expect Cannot Update Error ${attr}
247 Should Contain ${error} "error":"Resource Name cannot be updated: InCSE1/Container1/aaa" Error response is not correct
249 3.34 parentID cannot be update.
250 [Documentation] update parentID and expect error
251 ${attr} = Set Variable "pi":"aaa"
252 ${error} = Update Container Expect Cannot Update Error ${attr}
253 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: pi" Error response is not correct
255 3.35 createTime cannot be update.
256 [Documentation] update createTime and expect error
257 ${attr} = Set Variable "ct":"aaa"
258 ${error} = Update Container Expect Cannot Update Error ${attr}
259 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: ct" Error response is not correct
261 3.36 curerntByteSize cannot be update --- Special, cannot be modified by the user
262 [Documentation] update currentByteSize and expect error
263 ${attr} = Set Variable "cbs":123
264 ${error} = Update Container Expect Cannot Update Error ${attr}
265 Should Contain ${error} "error":"cbs: read-only parameter" Error response is not correct
267 3.37 currentNrofInstance cannot be updated --- Special, cannot be modified by the user
268 [Documentation] update cni and expect error
269 ${attr} = Set Variable "cni":3
270 ${error} = Update Container Expect Cannot Update Error ${attr}
271 Should Contain ${error} "error":"cni: read-only parameter" Error response is not correct
273 3.38 LastMoifiedTime --- Special, cannot be modified by the user
274 [Documentation] update lt and expect error
275 ${attr} = Set Variable "lt":"aaa"
276 ${error} = Update Container Expect Cannot Update Error ${attr}
277 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: lt" Error response is not correct
279 3.39 stateTag --- Special, cannot be modified by the user
280 [Documentation] update st and expect error
281 ${attr} = Set Variable "st":3
282 ${error} = Update Container Expect Cannot Update Error ${attr}
283 Should Contain ${error} "error":"st: read-only parameter" Error response is not correct
285 3.310 creator -- cannot be modified
286 [Documentation] update cr and expect error
287 ${attr} = Set Variable "cr":null
288 ${error} = Update Container Expect Cannot Update Error ${attr}
289 Should Contain ${error} "error":"CREATOR cannot be updated" Error response is not correct
291 3.41 Using AE's M attribute to create
292 [Documentation] use AE attribtue to create Container then expect error
293 ${attr} = Set Variable "api":"ODL","aei":"ODL"
294 ${error} = Update Container Expect Cannot Update Error ${attr}
295 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: aei" Error response is not correct
297 3.42 Using ContentInstance's M attribute to create
298 [Documentation] use contentInstance attribtue to create Container then expect error
299 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"101"
300 ${error} = Update Container Expect Cannot Update Error ${attr}
301 Should Contain ${error} "error":"CONTENT(pc) attribute not recognized: con" Error response is not correct
302 #==================================================
303 # Functional Attribute Test
304 #==================================================
305 # 1. lastModifiedTime
308 # 4. currentNrOfInstances
310 # 6. maxNrOfInstances
315 #-------------- 1. lastModifiedTime -----------
317 4.11 if updated seccessfully, last modified time must be modified.
318 [Documentation] if updated seccessfully, lastModifiedTime must be modified.
319 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container1
320 ${lt1} = Last Modified Time ${oldr}
321 ${attr} = Set Variable "lbl":["aaa"]
323 # We know Beryllium is going to be get rid of all sleep.
324 # But as lastModifiedTime has precision in seconds,
325 # we need to wait 1 second to see different value on update.
326 ${r} = Update Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
327 ${lt2} = Last Modified Time ${r}
328 Should Not Be Equal ${lt1} ${lt2}
330 4.12 childResources create , parent's last modified time update
331 [Documentation] childResources create , parent's lastmodifiedTime update
332 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container1
333 ${lt1} = Last Modified Time ${oldr}
335 # We know Beryllium is going to be get rid of all sleep.
336 # But as lastModifiedTime has precision in seconds,
337 # we need to wait 1 second to see different value on update.
338 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","rn":"conIn1"
339 ${r} = Create Resource ${iserver} InCSE1/Container1 ${rt_contentInstance} ${attr}
340 ${lt2} = Last Modified Time ${r}
341 Should Not Be Equal ${lt1} ${lt2}
342 #-------------- 2 parentID ------------
344 4.21 Check parentID(cse-container)
345 [Documentation] parentID should be InCSE1
346 ${oldr} = Retrieve Resource ${iserver} InCSE1
347 ${CSEID} = Resid ${oldr}
348 ${r} = Retrieve Resource ${iserver} InCSE1/Container1
349 ${pi} = Parent Id ${r}
350 Should Be Equal /InCSE1/${CSEID} ${pi}
352 4.22 Check parentID(cse-container-container)
353 [Documentation] parentID should be correct
357 ${attr} = Set Variable "rn":"Container2"
358 ${r}= Create Resource ${iserver} InCSE1/Container1 ${rt_container} ${attr}
359 ${status_code} = Status Code ${r}
360 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container1
361 ${CSEID} = Resid ${oldr}
362 ${r} = Retrieve Resource ${iserver} InCSE1/Container1/Container2
363 ${pi} = Parent Id ${r}
364 Should Be Equal /InCSE1/${CSEID} ${pi}
366 4.23 Check parentID(cse-AE-container)
367 [Documentation] parentID should be correct
371 ${attr} = Set Variable "api":"ODL","apn":"ODL","rr":true,"rn":"AE1"
372 ${r}= Create Resource ${iserver} InCSE1 ${rt_ae} ${attr}
373 ${attr} = Set Variable "rn":"Container2"
374 ${r}= Create Resource ${iserver} InCSE1/AE1 ${rt_container} ${attr}
375 ${status_code} = Status Code ${r}
376 ${oldr} = Retrieve Resource ${iserver} InCSE1/AE1
377 ${CSEID} = Resid ${oldr}
378 ${r} = Retrieve Resource ${iserver} InCSE1/AE1/Container2
379 ${pi} = Parent Id ${r}
380 Should Be Equal /InCSE1/${CSEID} ${pi}
382 4.24 Check parentID(cse-AE-container-container)
383 [Documentation] parentID should be correct
388 ${attr} = Set Variable "rn":"Container3"
389 ${r}= Create Resource ${iserver} InCSE1/AE1/Container2 ${rt_container} ${attr}
390 ${status_code} = Status Code ${r}
391 ${oldr} = Retrieve Resource ${iserver} InCSE1/AE1/Container2
392 ${CSEID} = Resid ${oldr}
393 ${r} = Retrieve Resource ${iserver} InCSE1/AE1/Container2/Container3
394 ${pi} = Parent Id ${r}
395 Should Be Equal /InCSE1/${CSEID} ${pi}
397 Delete the test AE-4.2
398 ${deleteRes} = Delete Resource ${iserver} InCSE1/AE1
399 #--------------3. stateTag------------
401 4.31 stateTag (when create, check if 0)
402 [Documentation] when create, st should be 0
405 ${attr} = Set Variable "rn":"Container2"
406 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
407 ${container} = Location ${r}
408 ${status_code} = Status Code ${r}
409 ${oldr} = Retrieve Resource ${iserver} ${container}
410 ${st} = State Tag ${oldr}
411 Should Be Equal As Integers 0 ${st}
412 # 4.32 stateTag (when update expirationTime)
413 # 4.33 stateTag (when update accessControlPolicyIDs)
415 4.34 stateTag (when update labels) + last modified time
416 [Documentation] st and lt should be changed
417 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
418 ${oldst} = State Tag ${oldr}
419 ${lt1} = Last Modified Time ${oldr}
420 ${attr} = Set Variable "lbl":["label1"]
422 # We know Beryllium is going to be get rid of all sleep.
423 # But as lastModifiedTime has precision in seconds,
424 # we need to wait 1 second to see different value on update.
425 Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
426 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
427 ${lt2} = Last Modified Time ${r}
428 ${st} = State Tag ${r}
429 ${oldstall} = Create List ${oldst+1} ${oldst+2}
430 Should Contain ${oldstall} ${st}
431 Should Not Be Equal ${lt1} ${lt2}
432 # 4.35 stateTag (when update announceTo)
433 # 4.36 stateTag (when update announceAttribute)
435 4.37 stateTag (when update MaxNrOfInstances) + last modified time
436 [Documentation] st and lt should be changed
437 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
438 ${oldst} = State Tag ${oldr}
439 ${lt1} = Last Modified Time ${oldr}
440 ${attr} = Set Variable "mni":5
442 # We know Beryllium is going to be get rid of all sleep.
443 # But as lastModifiedTime has precision in seconds,
444 # we need to wait 1 second to see different value on update.
445 Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
446 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
447 ${lt2} = Last Modified Time ${r}
448 ${st} = State Tag ${r}
449 ${oldstall} = Create List ${oldst+1} ${oldst+2}
450 Should Contain ${oldstall} ${st}
451 Should Not Be Equal ${lt1} ${lt2}
453 4.38 stateTag (when update MaxByteSize) + last modified time
454 [Documentation] st and lt should be changed
455 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
456 ${oldst} = State Tag ${oldr}
457 ${lt1} = Last Modified Time ${oldr}
458 ${attr} = Set Variable "mbs":30
460 # We know Beryllium is going to be get rid of all sleep.
461 # But as lastModifiedTime has precision in seconds,
462 # we need to wait 1 second to see different value on update.
463 Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
464 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
465 ${lt2} = Last Modified Time ${r}
466 ${st} = State Tag ${r}
467 ${oldstall} = Create List ${oldst+1} ${oldst+2}
468 Should Contain ${oldstall} ${st}
469 Should Not Be Equal ${lt1} ${lt2}
470 # 4.39 stateTag (when update maxInstanceAge)
471 # 4.310 stateTag (when update locationID)
473 4.311 stateTag (when update ontologyRef) + last modified time
474 [Documentation] st and lt should be changed
475 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
476 ${oldst} = State Tag ${oldr}
477 ${lt1} = Last Modified Time ${oldr}
478 ${attr} = Set Variable "or":"http://google.com"
480 # We know Beryllium is going to be get rid of all sleep.
481 # But as lastModifiedTime has precision in seconds,
482 # we need to wait 1 second to see different value on update.
483 Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
484 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
485 ${lt2} = Last Modified Time ${r}
486 ${st} = State Tag ${r}
487 ${oldstall} = Create List ${oldst+1} ${oldst+2}
488 Should Contain ${oldstall} ${st}
489 Should Not Be Equal ${lt1} ${lt2}
491 4.312 when create child container, stateTag will not increase + last modified time should change
492 [Documentation] when create child container, stateTag will not increase + lastModifiedTime should not change
496 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
497 ${oldst} = State Tag ${oldr}
498 ${lt1} = Last Modified Time ${oldr}
499 ${attr} = Set Variable "lbl":["label1"],"rn":"Container3"
501 # We know Beryllium is going to be get rid of all sleep.
502 # But as lastModifiedTime has precision in seconds,
503 # we need to wait 1 second to see different value on update.
504 Create Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
505 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
506 ${lt2} = Last Modified Time ${r}
507 ${st} = State Tag ${r}
508 Should Be Equal As Integers ${oldst} ${st}
509 Should Not Be Equal ${lt1} ${lt2}
511 4.313 * when create child contentInsntance, state should increase + last modified time should change
512 [Documentation] when create child contentInsntance, state should increase + lastModifiedTime shold not change
516 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
517 ${oldst} = State Tag ${oldr}
518 ${lt1} = Last Modified Time ${oldr}
519 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102"
521 # We know Beryllium is going to be get rid of all sleep.
522 # But as lastModifiedTime has precision in seconds,
523 # we need to wait 1 second to see different value on update.
524 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
525 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
526 ${lt2} = Last Modified Time ${r}
527 ${st} = State Tag ${r}
528 ${oldstall} = Create List ${oldst+1} ${oldst+2}
529 Should Contain ${oldstall} ${st}
530 Should Not Be Equal ${lt1} ${lt2}
532 4.314 stateTag should not be updated when update child container
533 [Documentation] stateTag should not be updated when update child container
537 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
538 ${oldst} = State Tag ${oldr}
539 ${lt1} = Last Modified Time ${oldr}
540 ${attr} = Set Variable "lbl":["label45"]
542 # We know Beryllium is going to be get rid of all sleep.
543 # But as lastModifiedTime has precision in seconds,
544 # we need to wait 1 second to see different value on update.
545 Update Resource ${iserver} InCSE1/Container2/Container3 ${rt_container} ${attr}
546 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
547 ${lt2} = Last Modified Time ${r}
548 ${st} = State Tag ${r}
549 Should Be Equal As Integers ${oldst} ${st}
550 Should Be Equal ${lt1} ${lt2}
552 Delete the Container2-4.3
553 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
554 #------------ 4. currentNrofInstance ------
556 4.41 when container create, cni should be 0
557 [Documentation] when container create, cni should be 0
558 ${attr} = Set Variable "rn":"Container2", "mni": 5
559 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
560 ${container} = Location ${r}
561 ${status_code} = Status Code ${r}
562 ${oldr} = Retrieve Resource ${iserver} ${container}
563 ${cni} = Current Number Of Instances ${oldr}
564 Should Be Equal As Integers 0 ${cni}
566 4.42 when conInstance create, parent container's cni should + 1
567 [Documentation] when conInstance create, parent container's cni should + 1.
568 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
569 ${oldcni} = Current Number Of Instances ${oldr}
570 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102"
571 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
572 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
573 ${cni} = Current Number Of Instances ${r}
574 Should Be Equal As Integers ${oldcni+1} ${cni}
576 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
577 ${oldcni} = Current Number Of Instances ${oldr}
578 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","rn":"contentIn1"
579 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
580 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
581 ${cni} = Current Number Of Instances ${r}
582 Should Be Equal As Integers ${oldcni+1} ${cni}
584 4.43 when conInstance delete, parent container's cni should - 1
585 [Documentation] Delete the conIn created in 4.42, when conInstance delete, parent container's cni should - 1
586 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
587 ${oldcni} = Current Number Of Instances ${oldr}
588 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102"
589 Delete Resource ${iserver} InCSE1/Container2/contentIn1
590 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
591 ${cni} = Current Number Of Instances ${r}
592 Should Be Equal As Integers ${oldcni-1} ${cni}
594 Delete the Container2-4.4
595 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
596 # ------------- 5. currentByteSize -----------
598 4.51 when container create, cbs should be 0
599 [Documentation] when container create, cbs should be 0
600 ${attr} = Set Variable "rn":"Container2", "mni": 5
601 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
602 ${container} = Location ${r}
603 ${status_code} = Status Code ${r}
604 ${oldr} = Retrieve Resource ${iserver} ${container}
605 ${cbs} = Current Byte Size ${oldr}
606 Should Be Equal As Integers 0 ${cbs}
608 4.52 when conInstance create, parent container's cbs should + cs
609 [Documentation] when conInstance create, parent container's cbs should + cs
610 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
611 ${oldcbs} = Current Byte Size ${oldr}
612 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102CSS"
613 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
614 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
615 ${cbs} = Current Byte Size ${r}
616 Should Be Equal As Integers ${oldcbs+6} ${cbs}
618 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
619 ${oldcbs} = Current Byte Size ${oldr}
620 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"xxx%%!@","rn":"contentIn1"
621 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
622 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
623 ${cbs} = Current Byte Size ${r}
624 Should Be Equal As Integers ${oldcbs+7} ${cbs}
626 4.53 when conInstance delete, parent container's cbs should - cs
627 [Documentation] Delete the conIn created in 4.52, when conInstance delete, parent container's cbs should - cs
628 ${oldr} = Retrieve Resource ${iserver} InCSE1/Container2
629 ${oldcbs} = Current Byte Size ${oldr}
630 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102"
631 Delete Resource ${iserver} InCSE1/Container2/contentIn1
632 ${r} = Retrieve Resource ${iserver} InCSE1/Container2
633 ${cbs} = Current Byte Size ${r}
634 Should Be Equal As Integers ${oldcbs-7} ${cbs}
636 Delete the Container2-4.5
637 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
638 # ------------- 6. maxNrOfInstances ----------
640 4.61 if maxNrOfInstance = 1 , can create 1 contentInstance
641 [Documentation] if maxNrOfInstance = 1 , can create 1 contentInstance
642 ${attr} = Set Variable "mni":1,"rn":"Container2"
643 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
644 ${container} = Location ${r}
645 ${status_code} = Status Code ${r}
646 ${oldr} = Retrieve Resource ${iserver} ${container}
647 ${mni} = Max Number Of Instances ${oldr}
648 Should Be Equal As Integers 1 ${mni}
649 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102CSS"
650 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
652 4.62 if maxNrOfInstance = 1 , when create 2 contentInstance, the first one should be deleted
653 [Documentation] if maxNrOfInstance = 1 , cannot create 2 contentInstance
654 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102CSS"
656 ${rr} = Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
657 Check Response and Retrieve Resource ${rr}
658 ${rr} = Retrieve resource ${iserver} InCSE1/Container2
659 ${chr} = Child Resource ${rr}
660 ${cbs} = Current Byte Size ${rr}
661 ${cni} = Current Number Of Instances ${rr}
662 Should Be Equal As Integers ${cni} 1
663 ${childNumber} = Get Length ${chr}
664 Should Be Equal As Integers ${childNumber} 1
666 4.63 if update to 3 , when create 4 or more contentInstance, the current number instance should be 3
667 [Documentation] if update to 3 , cannot create 4 contentInstance
668 ${attr} = Set Variable "mni":3
669 ${r}= Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
670 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102CSS"
672 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
673 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
674 #Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
675 ${rr}= Retrieve resource ${iserver} InCSE1/Container2
676 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
677 ${mni} = Max Number Of Instances ${rr}
678 ${chr} = Child Resource ${rr}
679 Should Be Equal As Integers ${mni} 3
681 4.64 what if alread have 4, then set mni to 1
682 [Documentation] if alread have 4, then set mni to 1, will delete 3 children
683 ${attr} = Set Variable "mni":1
684 ${r}= Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
685 ${rr}= Retrieve resource ${iserver} InCSE1/Container2
686 ${chr} = Child Resource ${rr}
687 ${mni} = Max Number Of Instances ${rr}
688 ${cni} = Current Number Of Instances ${rr}
689 Should Be Equal As Integers ${cni} 1
691 Delete the Container2-4.6
692 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
693 # ------------- 7. maxByteSize -------
695 4.71 if maxByteSize = 5 , can create contentInstance with contentSize 5
696 [Documentation] if maxByteSize = 5 , can create contentInstance with contentSize 5
697 ${attr} = Set Variable "mbs":5,"rn":"Container2", "mni": 5
698 ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr}
699 ${container} = Location ${r}
700 ${status_code} = Status Code ${r}
701 ${oldr} = Retrieve Resource ${iserver} ${container}
702 ${mbs} = Max Byte Size ${oldr}
703 Should Be Equal As Integers 5 ${mbs}
705 4.72 if maxByteSize = 5 , cannot create contentInstance with contenSize 8
706 [Documentation] if maxByteSize = 5 , cannot create contentInstance with contenSize 8
707 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102C120c"
709 ${error} = Run Keyword And Expect Error Cannot create this resource [400]* Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance}
712 4.73 if update to 20 , cannot create another contentInstance
713 [Documentation] if update to 20 , cannot create another contentInstance
714 ${attr} = Set Variable "mbs":20
715 ${r}= Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
716 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102CS"
718 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
719 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
720 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
721 Create Resource ${iserver} InCSE1/Container2 ${rt_contentInstance} ${attr}
722 ${rr}= Retrieve resource ${iserver} InCSE1/Container2
723 ${cbs} = Current Byte Size ${rr}
724 ${chr} = Child Resource ${rr}
725 ${cni} = Current Number Of Instances ${rr}
726 Should Be Equal As Integers ${cni} 4
727 ${childNumber} = Get Length ${chr}
728 Should Be Equal As Integers ${childNumber} 4
730 4.74 if already have 20, then set mbs to 5,will delete contentInstance until mbs less than 5.
731 [Documentation] what if already have 20, then set mbs to 5, will delete contentInstance until mbs less than 5.
732 ${attr} = Set Variable "mbs":5
733 ${r}= Update Resource ${iserver} InCSE1/Container2 ${rt_container} ${attr}
734 ${rr}= Retrieve resource ${iserver} InCSE1/Container2
736 ${chr} = Child Resource ${rr}
737 ${cbs} = Current Byte Size ${rr}
738 ${cni} = Current Number Of Instances ${rr}
739 Should Be Equal As Integers ${cni} 1
740 ${childNumber} = Get Length ${chr}
741 Should Be Equal As Integers ${childNumber} 1
743 Delete the Container2-4.7
744 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container2
746 4.81 creator -- value must be null
747 [Documentation] creator -- value must be null
748 ${attr} = Set Variable "cr":"VALUE"
749 ${error} = Run Keyword And Expect Error Cannot create this resource [400]* Create Resource ${iserver} InCSE1/Container1 ${rt_container}
751 Should Contain All Sub Strings ${error} error cr
752 #==================================================
754 #==================================================
756 Delete the test Container1
757 [Documentation] Delete the test Container1
758 ${deleteRes} = Delete Resource ${iserver} InCSE1/Container1
761 Check Response and Retrieve Resource
763 ${con} = Location ${r}
764 ${status_code} = Status Code ${r}
765 Should Be True 199 < ${status_code} < 299
766 ${rr} = Retrieve Resource ${iserver} ${con}
770 Check Response and Retrieve Resource For Update
771 [Arguments] ${r} ${location}
772 ${status_code} = Status Code ${r}
773 Should Be True 199 < ${status_code} < 299
774 ${rr} = Retrieve Resource ${iserver} ${location}
778 Create Container Expect Cannot Create Error
780 [Documentation] create Container Under InCSE1 and expect error
781 ${error} = Run Keyword And Expect Error Cannot create this resource [400]* Create Resource ${iserver} InCSE1 ${rt_container}
785 Update Container Expect Cannot Update Error
787 [Documentation] update Container Under InCSE1 and expect error
788 ${error} = Run Keyword And Expect Error Cannot update this resource [400]* Update Resource ${iserver} InCSE1/Container1 ${rt_container}
793 Fail "Not implemented"