2 Suite Setup Connect And Create The Tree
3 Suite Teardown Kill The Tree ${ODL_SYSTEM_IP} InCSE1 admin admin
4 Library ../../../libraries/criotdm.py
8 ${httphost} ${ODL_SYSTEM_IP}
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 "api":"jb","apn":"jb2","or":"http://hey/you","rr":true
26 : FOR ${rcn} IN \ 1 2 3
28 \ ${r} = Create Resource With Command ${iserver} InCSE1 ${rt_ae} rcn=${rcn}
31 1.2 rcn is illegal in create
32 [Documentation] rcn=4, 5, 6, 7 is illegal
33 ${attr} = Set Variable "api":"jb","apn":"jb2","or":"http://hey/you","rr":true
34 : FOR ${rcn} IN 4 5 6 7
35 \ ${error} = Run Keyword And Expect Error * Create Resource With Command ${iserver} InCSE1
36 \ ... ${rt_ae} rcn=${rcn} ${attr}
37 \ Should Start with ${error} Cannot create this resource [400]
38 \ Should Contain ${error} rcn
40 2.1 rcn is legal in update
41 [Documentation] rcn=1, 0/ null is legal
42 ${attr} = Set Variable "or":"http://hey/you"
43 : FOR ${rcn} IN \ 0 1 5
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, 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=2, 3, 4, 5, 6, 7 is illegal
74 ${attr} = Set Variable "or":"http://hey/you"
75 : FOR ${rcn} IN 2 3 4 7
76 \ ${error} = Run Keyword And Expect Error * Delete Resource With Command ${iserver} InCSE1/AE1
78 \ Should Start with ${error} Cannot delete this resource [400]
79 \ Should Contain ${error} rcn
82 Kill The Tree ${ODL_SYSTEM_IP} InCSE1 admin admin
83 #==================================================
85 #==================================================
88 Connect And Create The Tree
91 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&crb=20160612T033748Z
92 ${count} = Get Length ${r.json()['m2m:ae']['ch']}
93 Should Be Equal As Integers ${count} 2
96 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&cra=20150612T033748Z
97 ${count} = Get Length ${r.json()['m2m:ae']['ch']}
98 Should Be Equal As Integers ${count} 2
101 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&ms=20150612T033748Z
102 ${count} = Get Length ${r.json()['m2m:ae']['ch']}
103 Should Be Equal As Integers ${count} 2
106 ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=4&us=20160612T033748Z
107 ${count} = Get Length ${r.json()['m2m:ae']['ch']}
108 Should Be Equal As Integers ${count} 2
111 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&sts=3
112 ${count} = Get Length ${r.json()['ch']}
113 Should Be Equal As Integers ${count} 5
116 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&stb=1
118 ${count} = Get Length ${r.json()['m2m:cnt']['ch']}
119 Should Be Equal As Integers ${count} 2
124 ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&sts=3&lbl=contentInstanceUnderContainerContainer
125 ${count} = Get Length ${r.json()['ch']}
126 Should Be Equal As Integers ${count} 2
130 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3
131 ${count} = Get Length ${r.json()['ch']}
132 Should Be Equal As Integers ${count} 3
135 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3&sza=5
136 ${count} = Get Length ${r.json()['ch']}
137 Should Be Equal As Integers ${count} 2
140 ${r} = Retrieve Resource With Command ${iserver} InCSE1 rcn=4&rty=3&szb=5
141 ${count} = Get Length ${r.json()['ch']}
142 Should Be Equal As Integers ${count} 1
144 2.1 And Test - labels
146 ${r} = Retrieve Resource With Command ${iserver} InCSE1 fu=1&rcn=4&sts=4&lbl=contentInstanceUnderContainerContainer&lbl=underCSE
147 ${count} = Get Length ${r.json()}
148 Should Be Equal As Integers ${count} 6
151 Connect And Create The Tree
152 [Documentation] Create a tree that contain AE/ container / contentInstance in different layers
153 ${iserver} = Connect To Iotdm ${httphost} ${httpuser} ${httppass} http
154 ${attr} = Set Variable "api":"jb","apn":"jb2","or":"http://hey/you","rr":true
155 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr},"rn":"AE1"
156 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr},"rn":"AE2"
157 Create Resource ${iserver} InCSE1 ${rt_ae} ${attr},"rn":"AE3"
158 Create Resource ${iserver} InCSE1/AE1 ${rt_container} "rn":"Container1"
159 Create Resource ${iserver} InCSE1/AE1 ${rt_container} "rn":"Container2"
160 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underCSE"]
161 Create Resource ${iserver} InCSE1 ${rt_container} ${attr},"rn":"Container3"
162 Create Resource ${iserver} InCSE1 ${rt_container} ${attr},"rn":"Container4"
163 Create Resource ${iserver} InCSE1 ${rt_container} ${attr},"rn":"Container5"
164 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underAEContainer"]
165 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_container} ${attr},"rn":"Container6"
166 ${attr} = Set Variable "cr":null,"mni":5,"mbs":150,"or":"http://hey/you","lbl":["underCSEContainer"]
167 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr},"rn":"Container7"
168 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr},"rn":"Container8"
169 Create Resource ${iserver} InCSE1/Container3 ${rt_container} ${attr},"rn":"Container9"
170 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderAEContainer"]
171 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_contentInstance} ${attr},"rn":"conIn1"
172 Create Resource ${iserver} InCSE1/AE1/Container1 ${rt_contentInstance} ${attr},"rn":"conIn2"
173 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderContainerContainer"]
174 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr},"rn":"conIn3"
175 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr},"rn":"conIn4"
176 Create Resource ${iserver} InCSE1/Container3 ${rt_contentInstance} ${attr},"rn":"conIn5"
177 ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"102","lbl":["contentInstanceUnderContainer"]
178 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr},"rn":"conIn6"
179 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr},"rn":"conIn7"
180 Create Resource ${iserver} InCSE1/Container4 ${rt_contentInstance} ${attr},"rn":"conIn8"