a8b59e0feefd25c34078dd7864af84b5e1b38b4d
[csit.git] / resources / libraries / robot / lisp / lisp_api.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/interfaces.robot
16 | Library  | resources.libraries.python.NodePath
17 | Library  | resources.libraries.python.LispSetup.LispStatus
18 | Library  | resources.libraries.python.LispSetup.LispSetup
19 | Library  | resources.libraries.python.LispSetup.LispGpeStatus
20 | Library  | resources.libraries.python.LispUtil
21
22 *** Keywords ***
23
24 | Lisp locator_set data is prepared
25 | | [Documentation] | Generate lisp locator_set data for test
26 | | ...             | the lisp locator_set and locator API.
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - dut_node - DUT node. Type: dictionary
30 | | ... | - locator_set_number - Number how many locator_set data
31 | | ... |                        will be generated. Type: integer
32 | | ...
33 | | ... | *Return:*
34 | | ... | - No value returned
35 | | ...
36 | | ... | _NOTE:_ This KW sets following test case variables:
37 | | ... | - locator_set_values - New generated locator_set data.
38 | | ... | - locator_set_values_vat - New generated locator_set data expected\
39 | | ... | from VAT.
40 | | ...
41 | | ... | *Example:*
42 | | ... | \| Given Lisp locator_set data is prepared \| ${nodes['DUT1']} \
43 | | ... | \| ${locator_set_number} \|
44 | | ...
45 | | [Arguments] | ${dut_node} | ${locator_set_number}
46 | | ${locator_set_values} | ${locator_set_values_vat}=
47 | | ... | Generate Unique Lisp Locator Set Data
48 | | ... | ${dut_node} | ${locator_set_number}
49 | | Set Test Variable | ${locator_set_values}
50 | | Set Test Variable | ${locator_set_values_vat}
51
52 | Lisp locator_set data is set
53 | | [Documentation] | Set the lisp locator_set and locator on the VPP node.
54 | | ...
55 | | ... | *Arguments:*
56 | | ... | - dut_node - DUT node. Type: dictionary
57 | | ...
58 | | ... | *Return:*
59 | | ... | - No value returned
60 | | ...
61 | | ... | _NOTE:_ This KW requires following test case variables:
62 | | ... | - locator_set_values - Generated locator_set data from
63 | | ... |                        KW locator_set data is prepared,
64 | | ... |                        which will be set on the VPP node.
65 | | ...
66 | | ... | *Example:*
67 | | ... | \| When Lisp locator_set data is set \| ${nodes['DUT1']} \|
68 | | ...
69 | | [Arguments] | ${dut_node}
70 | | Vpp Set Lisp Locator Set | ${dut_node} | ${locator_set_values}
71
72 | Lisp locator_set is set correctly
73 | | [Documentation] | Test if the locator_set is set correctly on the VPP node.
74 | | ...
75 | | ... | *Arguments:*
76 | | ... | - dut_node - DUT node. Type: dictionary
77 | | ...
78 | | ... | *Return:*
79 | | ... | - No value returned
80 | | ...
81 | | ... | _NOTE:_ This KW requires following test case variables:
82 | | ... | - locator_set_values_vat - Generated locator_set data from
83 | | ... | KW locator_set data is prepared, which are expected from VPP via VAT.
84 | | ...
85 | | ... | *Example:*
86 | | ... | \| Then Lisp locator_set is set correctly \| ${nodes['DUT1']} \|
87 | | ...
88 | | [Arguments] | ${dut_node}
89 | | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | local
90 | | Lisp Locator S Should Be Equal
91 | | ... | ${locator_set_values_vat} | ${show_locator_set}
92
93 | Delete all lisp locator_set from VPP
94 | | [Documentation] | Delete all lisp locator_set on the VPP node.
95 | | ...
96 | | ... | *Arguments:*
97 | | ... | - dut_node - DUT node. Type: dictionary
98 | | ...
99 | | ... | *Return:*
100 | | ... | - No value returned
101 | | ...
102 | | ... | _NOTE:_ This KW requires following test case variables:
103 | | ... | - locator_set_values - Generated locator_set data from
104 | | ... |                        KW locator_set data is prepared,
105 | | ... |                        which was set on the VPP node.
106 | | ...
107 | | ... | *Example:*
108 | | ... | \| When Delete all lisp locator_set from VPP \
109 | | ... | \| ${nodes['DUT1']} \|
110 | | ...
111 | | [Arguments] | ${dut_node}
112 | | Vpp Unset Lisp Locator Set | ${dut_node} | ${locator_set_values}
113
114 | Lisp locator_set should be unset
115 | | [Documentation] | Test if all locator_set are unset from VPP node.
116 | | ...
117 | | ... | *Arguments:*
118 | | ... | - dut_node - DUT node. Type: dictionary
119 | | ...
120 | | ... | *Return:*
121 | | ... | - No value returned
122 | | ...
123 | | ... | *Example:*
124 | | ... | \| Then Lisp locator_set should be unset \| ${nodes['DUT1']} \|
125 | | ...
126 | | [Arguments] | ${dut_node}
127 | | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | ${EMPTY}
128 | | Lisp Is Empty | ${show_locator_set}
129
130 | Lisp locator_set data use for test reset locator_set are prepared
131 | | [Documentation] | Generate lisp special type of locator_set data.
132 | | ...             | This data will be use for test reset locator_set.
133 | | ...
134 | | ... | *Arguments:*
135 | | ... | - dut_node - DUT node. Type: dictionary
136 | | ... | - locator_set_number - Number how many locator_set data
137 | | ... |                        it will generate. Type: integer
138 | | ...
139 | | ... | *Return:*
140 | | ... | - No value returned
141 | | ...
142 | | ... | _NOTE:_ This KW sets following test case variables:
143 | | ... | - locator_set_values - New generate locator_set data.
144 | | ... | - locator_set_values_vat - New generated locator_set data expected\
145 | | ... | from VAT.
146 | | ...
147 | | ... | *Example:*
148 | | ... | \| Given Lisp locator_set data use for test reset locator_set \
149 | | ... |    are prepared \| ${nodes['DUT1']} \| ${locator_set_number} \|
150 | | ...
151 | | [Arguments] | ${dut_node} | ${locator_set_number}
152 | | ${locator_set_values} | ${locator_set_values_vat}=
153 | | ... | Generate Duplicate Lisp Locator Set Data
154 | | ... | ${dut_node} | ${locator_set_number}
155 | | Set Test Variable | ${locator_set_values}
156 | | Set Test Variable | ${locator_set_values_vat}
157
158 | Lisp eid address is set
159 | | [Documentation] | Set the lisp eid address on the VPP node.
160 | | ...
161 | | ... | *Arguments:*
162 | | ... | - dut_node - DUT node. Type: dictionary
163 | | ... | - set_eid - Test eid data. Type: list
164 | | ...
165 | | ... | *Return:*
166 | | ... | - No value returned
167 | | ...
168 | | ... | *Example:*
169 | | ... | \| When Lisp eid address is set \| ${nodes['DUT1']} \| ${eid_table} |\
170 | | ...
171 | | [Arguments] | ${dut_node} | ${set_eid}
172 | | Vpp Set Lisp Eid Table | ${dut_node} | ${set_eid}
173
174 | Lisp eid address is set correctly to eid table
175 | | [Documentation] | Test if the locator_set is set correctly on the VPP node.
176 | | ...
177 | | ... | *Arguments:*
178 | | ... | - dut_node - DUT node. Type: dictionary
179 | | ... | - set_eid - Example eid data, which was set to the VPP node.
180 | | ... |                Type: list
181 | | ...
182 | | ... | *Return:*
183 | | ... | - No value returned
184 | | ...
185 | | ... | _NOTE:_ This KW requires following test case variables:
186 | | ... | - set_eid - Generated eid data, which will be set to the VPP node.
187 | | ...
188 | | ... | *Example:*
189 | | ... | \| Then Lisp eid address is set correctly to eid table \
190 | | ... | \| ${nodes['DUT1']} \| ${eid_table} \|
191 | | ...
192 | | [Arguments] | ${dut_node} | ${set_eid}
193 | | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node}
194 | | Lisp Should Be Equal | ${set_eid} | ${show_eid}
195
196 | Delete all lisp eid address from VPP
197 | | [Documentation] | Delete all lisp eid address from the VPP node.
198 | | ...
199 | | ... | *Arguments:*
200 | | ... | - dut_node - DUT node. Type: dictionary
201 | | ... | - set_eid - Eid data which will be removed from the VPP node.
202 | | ... |             Type: list
203 | | ...
204 | | ... | *Return:*
205 | | ... | - No value returned
206 | | ...
207 | | ... | *Example:*
208 | | ... | \| When Delete all lisp eid address from VPP \
209 | | ... | \| ${nodes['DUT1']} \| ${eid_table} \|
210 | | ...
211 | | [Arguments] | ${dut_node} | ${set_eid}
212 | | Vpp Unset Lisp Eid Table | ${dut_node} | ${set_eid}
213
214 | Lisp eid table should be empty
215 | | [Documentation] | Test if the eid table is empty.
216 | | ...
217 | | ... | *Arguments:*
218 | | ... | - dut_node - DUT node. Type: dictionary
219 | | ...
220 | | ... | *Return:*
221 | | ... | - No value returned
222 | | ...
223 | | ... | *Example:*
224 | | ... | \| Then Lisp eid table should be empty \| ${nodes['DUT1']} \|
225 | | ...
226 | | [Arguments] | ${dut_node}
227 | | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node}
228 | | Lisp Is Empty | ${show_eid}
229
230 | Lisp map resolver address is set
231 | | [Documentation] | Set the lisp map resolver address in the VPP node.
232 | | ...
233 | | ... | *Arguments:*
234 | | ... | - dut_node - DUT node. Type: dictionary
235 | | ... | - set_map_resolver - Map resolver data, which will be set on
236 | | ... |                      the VPP node. Type: list
237 | | ...
238 | | ... | *Return:*
239 | | ... | - No value returned
240 | | ...
241 | | ... | *Example:*
242 | | ... | \| When Lisp map resolver address is set \| ${nodes['DUT1']} \
243 | | ... | \| ${map_resolver} \|
244 | | ...
245 | | [Arguments] | ${dut_node} | ${set_map_resolver}
246 | | Vpp Set Lisp Map Resolver | ${dut_node} | ${set_map_resolver}
247
248 | Lisp map resolver address is set correctly
249 | | [Documentation] | Test if the map resolver address is set correctly
250 | | ...             | on the VPP node.
251 | | ...
252 | | ... | *Arguments:*
253 | | ... | - dut_node - DUT node. Type: dictionary
254 | | ... | - set_map_resolver - Map resolver data, which was set on
255 | | ... |                      the VPP node. Type: list
256 | | ...
257 | | ... | *Return:*
258 | | ... | - No value returned
259 | | ...
260 | | ... | *Example:*
261 | | ... | \| Then Lisp map resolver address is set correctly \
262 | | ... | \| ${nodes['DUT1']} \| ${map_resolver} \|
263 | | ...
264 | | [Arguments] | ${dut_node} | ${set_map_resolver}
265 | | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node}
266 | | Lisp Should Be Equal | ${set_map_resolver} | ${show_map_resolver}
267
268 | Delete all lisp map resolver address from VPP
269 | | [Documentation] | Delete all lisp map resolver address on the VPP node.
270 | | ...
271 | | ... | *Arguments:*
272 | | ... | - dut_node - DUT node. Type: dictionary
273 | | ... | - map_resolver - Map resolver data, which will be remove from
274 | | ... |                  the VPP. Type: list
275 | | ...
276 | | ... | *Return:*
277 | | ... | - No value returned
278 | | ...
279 | | ... | *Example:*
280 | | ... | \| When Delete all lisp map resolver address from VPP \
281 | | ... | \| ${nodes['DUT1']} \| ${map_resolver} \|
282 | | ...
283 | | [Arguments] | ${dut_node} | ${set_map_resolver}
284 | | Vpp Unset Lisp Map Resolver | ${dut_node} | ${set_map_resolver}
285
286 | Lip map resolver address should be empty
287 | | [Documentation] | Test if the map resolver are empty.
288 | | ...
289 | | ... | *Arguments:*
290 | | ... | - dut_node - DUT node. Type: dictionary
291 | | ...
292 | | ... | *Return:*
293 | | ... | - No value returned
294 | | ...
295 | | ... | *Example:*
296 | | ... | \| Then Lip map resolver address should be empty \
297 | | ... | \| ${nodes['DUT1']} \|
298 | | ...
299 | | [Arguments] | ${dut_node}
300 | | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node}
301 | | Lisp Is Empty | ${show_map_resolver}
302
303 | Enable lisp
304 | | [Documentation] | Enable lisp on VPP node.
305 | | ...
306 | | ... | *Arguments:*
307 | | ... | - dut_node - DUT node. Type: dictionary
308 | | ...
309 | | ... | *Return:*
310 | | ... | - No value returned
311 | | ...
312 | | ... | *Example:*
313 | | ... | \| Enable lisp \| ${nodes['DUT1']} \|
314 | | ...
315 | | [Arguments] | ${dut_node}
316 | | Vpp Lisp Enable Disable | ${dut_node} | enable
317
318 | Check if lisp is enabled
319 | | [Documentation] | Check if the lisp is enabled.
320 | | ...
321 | | ... | *Arguments:*
322 | | ... | - dut_node - DUT node. Type: dictionary
323 | | ... | - lisp_status_data - Lisp status data, which was set on
324 | | ... |                      the VPP node. Type: list
325 | | ...
326 | | ... | *Return:*
327 | | ... | - No value returned
328 | | ...
329 | | ... | *Example:*
330 | | ... | \| Check if lisp is enabled \| ${nodes['DUT1']} \
331 | | ... | \| ${lisp_status_data} \|
332 | | ...
333 | | [Arguments] | ${dut_node} | ${lisp_status_data}
334 | | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node}
335 | | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[1]}
336
337 | Disable lisp
338 | | [Documentation] | Disable lisp on VPP node.
339 | | ...
340 | | ... | *Arguments:*
341 | | ... | - dut_node - DUT node. Type: dictionary
342 | | ...
343 | | ... | *Return:*
344 | | ... | - No value returned
345 | | ...
346 | | ... | *Example:*
347 | | ... | \| Disable lisp \| ${nodes['DUT1']} \|
348 | | ...
349 | | [Arguments] | ${dut_node}
350 | | Vpp Lisp Enable Disable | ${dut_node} | disable
351
352 | Check if lisp is disabled
353 | | [Documentation] | Check if lisp is disabled.
354 | | ...
355 | | ... | *Arguments:*
356 | | ... | - dut_node - DUT node. Type: dictionary
357 | | ... | - lisp_status_data - Lisp status data, which was set on
358 | | ... |                      the VPP node. Type: list
359 | | ...
360 | | ... | *Return:*
361 | | ... | - No value returned
362 | | ...
363 | | ... | *Example:*
364 | | ... | \| Check if lisp is disabled \| ${nodes['DUT1']} \
365 | | ... | \| ${lisp_status_data} \|
366 | | ...
367 | | [Arguments] | ${dut_node} | ${lisp_status_data}
368 | | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node}
369 | | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[0]}
370
371 | Enable Lisp Gpe
372 | | [Documentation] | Enable Lisp Gpe on VPP node.
373 | | ...
374 | | ... | *Arguments:*
375 | | ... | - dut_node - DUT node. Type: dictionary
376 | | ...
377 | | ... | *Return:*
378 | | ... | - No value returned
379 | | ...
380 | | ... | *Example:*
381 | | ... | \| Enable Lisp Gpe \| ${nodes['DUT1']} \|
382 | | ...
383 | | [Arguments] | ${dut_node}
384 | | Vpp Lisp Gpe Enable Disable | ${dut_node} | enable
385
386 | Disable Lisp Gpe
387 | | [Documentation] | Disable Lisp Gpe on VPP node.
388 | | ...
389 | | ... | *Arguments:*
390 | | ... | - dut_node - DUT node. Type: dictionary
391 | | ...
392 | | ... | *Return:*
393 | | ... | - No value returned
394 | | ...
395 | | ... | *Example:*
396 | | ... | \| Disable Lisp Gpe \| ${nodes['DUT1']} \|
397 | | ...
398 | | [Arguments] | ${dut_node}
399 | | Vpp Lisp Gpe Enable Disable | ${dut_node} | disable