1485a405a6fe58225a0c3555ebc887f3e1a660d5
[csit.git] / resources / libraries / robot / overlay / 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/shared/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 | Generate LISP locator_set data
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 Generate LISP locator_set data \| ${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 | Configure LISP locator_set data
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, which will be set on the VPP node.
64 | | ...
65 | | ... | *Example:*
66 | | ... | \| When Configure LISP locator_set data \| ${nodes['DUT1']} \|
67 | | ...
68 | | [Arguments] | ${dut_node}
69 | | Vpp Set Lisp Locator Set | ${dut_node} | ${locator_set_values}
70
71 | LISP locator_set shpuld be configured correctly
72 | | [Documentation] | Test if the locator_set is set correctly on the VPP node.
73 | | ...
74 | | ... | *Arguments:*
75 | | ... | - dut_node - DUT node. Type: dictionary
76 | | ...
77 | | ... | *Return:*
78 | | ... | - No value returned
79 | | ...
80 | | ... | _NOTE:_ This KW requires following test case variables:
81 | | ... | - locator_set_values_vat - Generated locator_set data from
82 | | ... | KW locator_set data is prepared, which are expected from VPP via VAT.
83 | | ...
84 | | ... | *Example:*
85 | | ... | \| Then LISP locator_set shpuld be configured correctly \
86 | | ... | \| ${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, which was set on the VPP node.
105 | | ...
106 | | ... | *Example:*
107 | | ... | \| When Delete all LISP locator_set from VPP \
108 | | ... | \| ${nodes['DUT1']} \|
109 | | ...
110 | | [Arguments] | ${dut_node}
111 | | Vpp Unset Lisp Locator Set | ${dut_node} | ${locator_set_values}
112
113 | LISP locator_set should be unset
114 | | [Documentation] | Test if all locator_set are unset from VPP node.
115 | | ...
116 | | ... | *Arguments:*
117 | | ... | - dut_node - DUT node. Type: dictionary
118 | | ...
119 | | ... | *Return:*
120 | | ... | - No value returned
121 | | ...
122 | | ... | *Example:*
123 | | ... | \| Then LISP locator_set should be unset \| ${nodes['DUT1']} \|
124 | | ...
125 | | [Arguments] | ${dut_node}
126 | | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | ${EMPTY}
127 | | Lisp Is Empty | ${show_locator_set}
128
129 | Lisp locator_set data use for test reset locator_set are prepared
130 | | [Documentation] | Generate lisp special type of locator_set data.
131 | | ... | This data will be use for test reset locator_set.
132 | | ...
133 | | ... | *Arguments:*
134 | | ... | - dut_node - DUT node. Type: dictionary
135 | | ... | - locator_set_number - Number how many locator_set data
136 | | ... | it will generate. Type: integer
137 | | ...
138 | | ... | *Return:*
139 | | ... | - No value returned
140 | | ...
141 | | ... | _NOTE:_ This KW sets following test case variables:
142 | | ... | - locator_set_values - New generate locator_set data.
143 | | ... | - locator_set_values_vat - New generated locator_set data expected\
144 | | ... | from VAT.
145 | | ...
146 | | ... | *Example:*
147 | | ... | \| Given Lisp locator_set data use for test reset locator_set \
148 | | ... | are prepared \| ${nodes['DUT1']} \| ${locator_set_number} \|
149 | | ...
150 | | [Arguments] | ${dut_node} | ${locator_set_number}
151 | | ${locator_set_values} | ${locator_set_values_vat}=
152 | | ... | Generate Duplicate Lisp Locator Set Data
153 | | ... | ${dut_node} | ${locator_set_number}
154 | | Set Test Variable | ${locator_set_values}
155 | | Set Test Variable | ${locator_set_values_vat}
156
157 | Configure LISP eid address
158 | | [Documentation] | Set the lisp eid address on the VPP node.
159 | | ...
160 | | ... | *Arguments:*
161 | | ... | - dut_node - DUT node. Type: dictionary
162 | | ... | - set_eid - Test eid data. Type: list
163 | | ...
164 | | ... | *Return:*
165 | | ... | - No value returned
166 | | ...
167 | | ... | *Example:*
168 | | ... | \| When Configure LISP eid address \| ${nodes['DUT1']} \
169 | | ... | \| ${eid_table} \|
170 | | ...
171 | | [Arguments] | ${dut_node} | ${set_eid}
172 | | Vpp Set Lisp Eid Table | ${dut_node} | ${set_eid}
173
174 | LISP eid address should be 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 should be 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 | Configure LISP map resolver address
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 Configure LISP map resolver address \| ${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 should be configured 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 should be configured 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 | LISP 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 LISP 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 | LISP should be 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 | | ... | \| LISP should be 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 | LISP Should be disabled
353 | | [Documentation] | LISP Should be 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 | | ... | \| LISP Should be 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