2 Suite Setup Connect And Create The Tree
3 Suite Teardown Kill The Tree ${CONTROLLER} InCSE1 admin admin
4 Library ../../../libraries/criotdm.py
8 ${httphost} ${CONTROLLER}
13 ${rt_contentInstance} 4
17 ${iserver} = Connect To Iotdm ${httphost} ${httpuser} ${httppass} http
18 Set Suite Variable ${iserver}
19 #==================================================
20 # ResultContent(rcn) Test
21 #==================================================
23 1.1 rcn is legal in create
24 [Documentation] rcn=1, 2, 3, 0 is legal
25 ${attr} = Set Variable "aei":"ODL","api":"jb","apn":"jb2","or":"http://hey/you"
26 : FOR ${rcn} IN \ 1 2 3
28 \ ${r} = Create Resource With Command ${iserver} InCSE1 ${rt_ae} rcn=${rcn}
30 #add check reponse here in the next step, seperate them
32 1.2 rcn is illegal in create
33 [Documentation] rcn=4, 5, 6, 7 is illegal
34 ${attr} = Set Variable "aei":"ODL","api":"jb","apn":"jb2","or":"http://hey/you"
35 : FOR ${rcn} IN 4 5 6 7
36 \ ${error} = Run Keyword And Expect Error * Create Resource With Command ${iserver} InCSE1
37 \ ... ${rt_ae} rcn=${rcn} ${attr}
38 \ Should Start with ${error} Cannot create this resource [400]
39 \ Should Contain ${error} rcn
41 2.1 rcn is legal in update
42 [Documentation] rcn=1, 4, 0/ null is legal
43 ${attr} = Set Variable "or":"http://hey/you"
44 : FOR ${rcn} IN \ 0 1 4
45 \ ${r} = Update Resource With Command ${iserver} InCSE1/AE1 ${rt_ae} rcn=${rcn}
48 2.2 rcn is illegal in update
49 [Documentation] rcn=2, 3, 5, 6, 7 is illegal
50 ${attr} = Set Variable "or":"http://hey/you"
51 : FOR ${rcn} IN 2 3 4 7
52 \ ${error} = Run Keyword And Expect Error * Update Resource With Command ${iserver} InCSE1/AE1
53 \ ... ${rt_ae} rcn=${rcn} ${attr}
54 \ Should Start with ${error} Cannot update this resource [400]
55 \ Should Contain ${error} rcn
57 3.1 rcn is legal in retrieve
58 [Documentation] rcn=1, 4, 5, 6 null is legal
59 : FOR ${rcn} IN \ 1 4 5
61 \ ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=${rcn}
62 # when rcn=7 can be retrieved
64 3.2 rcn is illegal in retrieve
65 [Documentation] rcn=0, 2, 3 is illegal
67 \ ${error} = Run Keyword And Expect Error * Retrieve Resource With Command ${iserver} InCSE1/AE1
69 \ Should Start with ${error} Cannot retrieve this resource [400]
70 \ Should Contain ${error} rcn
72 4.2 rcn is illegal in delete
73 [Documentation] rcn=4, 5, 6, 7 is illegal
74 ${attr} = Set Variable "or":"http://hey/you"
75 : FOR ${rcn} IN 2 3 4 5
77 \ ${error} = Run Keyword And Expect Error * Delete Resource With Command ${iserver} InCSE1/AE1
79 \ Should Start with ${error} Cannot delete this resource [400]
80 \ Should Contain ${error} rcn
83 Kill The Tree ${CONTROLLER} InCSE1 admin admin
84 #==================================================
86 #==================================================
89 Connect And Create The Tree
92 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&crb=20160612T033748Z
93 ${count} = Get Length ${r.json()['ch']}
94 Should Be Equal As Integers ${count} 2
97 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&cra=20150612T033748Z
98 ${count} = Get Length ${r.json()['ch']}
99 Should Be Equal As Integers ${count} 2
102 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&ms=20150612T033748Z
103 ${count} = Get Length ${r.json()['ch']}
104 Should Be Equal As Integers ${count} 2
107 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&us=20160612T033748Z
108 ${count} = Get Length ${r.json()['ch']}
109 Should Be Equal As Integers ${count} 2
112 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&sts=3
113 ${count} = Get Length ${r.json()['ch']}
114 ${s} = Set Variable ${r.json()['ch']}
115 Should Be Equal As Integers ${count} 5
118 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&stb=1
119 ${count} = Get Length ${r.json()['ch']}
120 Should Be Equal As Integers ${count} 2
125 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&sts=3&lbl=contentInstanceUnderContainerContainer
126 ${count} = Get Length ${r.json()['ch']}
127 Should Be Equal As Integers ${count} 2
131 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3
132 ${count} = Get Length ${r.json()['ch']}
133 Should Be Equal As Integers ${count} 3
136 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3&sza=5
137 ${count} = Get Length ${r.json()['ch']}
138 Should Be Equal As Integers ${count} 2
141 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3&szb=5
142 ${count} = Get Length ${r.json()['ch']}
143 Should Be Equal As Integers ${count} 1
146 # ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3&lim=2
147 # ${count} = Get Length ${r.json()['ch']}
148 # Should Be Equal As Integers ${count} 2
151 # different conditions shall use the "AND" logical operation;
152 # same conditions shall use the "OR" logical operation.
155 Connect And Create The Tree
156 [Documentation] Create a tree that contain AE/ container / contentInstance in different layers
157 ${iserver} = Connect To Iotdm ${httphost} ${httpuser} ${httppass} http
158 ${attr} = Set Variable "aei":"ODL","api":"jb","apn":"jb2","or":"http://hey/you"
159 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr} AE1
160 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr} AE2
161 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr} AE3
162 ${attr} = Set Variable
163 Create Resource ${iserver} InCSE1/AE1 ${rt_container} ${attr} Container1
164 Create Resource ${iserver} InCSE1/AE1 ${rt_container} ${attr} Container2
165 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underCSE"]
166 Create Resource ${iserver} InCSE1 ${rt_container} ${attr} Container3
167 Create Resource ${iserver} InCSE1 ${rt_container} ${attr} Container4
168 Create Resource ${iserver} InCSE1 ${rt_container} ${attr} Container5
169 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underAEContainer"]
170 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_container} ${attr} Container6
171 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underCSEContainer"]
172 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr} Container7
173 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr} Container8
174 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr} Container9
175 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderAEContainer"]
176 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_contentInstance} ${attr} conIn1
177 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_contentInstance} ${attr} conIn2
178 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderContainerContainer"]
179 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr} conIn3
180 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr} conIn4
181 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr} conIn5
182 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderContainer"]
183 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr} conIn6
184 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr} conIn7
185 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr} conIn8