CSIT-229: ip4-lispgpe-ip4
[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 | | ...
39 | | ... | *Example:*
40 | | ... | \| Given Lisp locator_set data is prepared \| ${nodes['DUT1']} \
41 | | ... | \| ${locator_set_number} \|
42 | | ...
43 | | [Arguments] | ${dut_node} | ${locator_set_number}
44 | | ${locator_set_values}= | Generate Unique Lisp Locator Set Data |
45 | | ...                    | ${dut_node} | ${locator_set_number}
46 | | Set Test Variable | ${locator_set_values}
47
48 | Lisp locator_set data is set
49 | | [Documentation] | Set the lisp locator_set and locator on the VPP node.
50 | | ...
51 | | ... | *Arguments:*
52 | | ... | - dut_node - DUT node. Type: dictionary
53 | | ...
54 | | ... | *Return:*
55 | | ... | - No value returned
56 | | ...
57 | | ... | _NOTE:_ This KW requires following test case variables:
58 | | ... | - locator_set_values - Generated locator_set data from
59 | | ... |                        KW locator_set data is prepared,
60 | | ... |                        which will be set on the VPP node.
61 | | ...
62 | | ... | *Example:*
63 | | ... | \| When Lisp locator_set data is set \| ${nodes['DUT1']} \|
64 | | ...
65 | | [Arguments] | ${dut_node}
66 | | Vpp Set Lisp Locator Set | ${dut_node} | ${locator_set_values}
67
68 | Lisp locator_set is set correctly
69 | | [Documentation] | Test if the locator_set is set correctly on the VPP node.
70 | | ...
71 | | ... | *Arguments:*
72 | | ... | - dut_node - DUT node. Type: dictionary
73 | | ...
74 | | ... | *Return:*
75 | | ... | - No value returned
76 | | ...
77 | | ... | _NOTE:_ This KW requires following test case variables:
78 | | ... | - locator_set_values - Generated locator_set data from
79 | | ... |                        KW locator_set data is prepared,
80 | | ... |                        which were set to VPP node.
81 | | ...
82 | | ... | *Example:*
83 | | ... | \| Then Lisp locator_set is set correctly \| ${nodes['DUT1']} \|
84 | | ...
85 | | [Arguments] | ${dut_node}
86 | | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | local
87 | | Lisp Locator S Should Be Equal
88 | | ... | ${locator_set_values} | ${show_locator_set}
89
90 | Delete all lisp locator_set from VPP
91 | | [Documentation] | Delete all lisp locator_set on the VPP node.
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - dut_node - DUT node. Type: dictionary
95 | | ...
96 | | ... | *Return:*
97 | | ... | - No value returned
98 | | ...
99 | | ... | _NOTE:_ This KW requires following test case variables:
100 | | ... | - locator_set_values - Generated locator_set data from
101 | | ... |                        KW locator_set data is prepared,
102 | | ... |                        which was set on the VPP node.
103 | | ...
104 | | ... | *Example:*
105 | | ... | \| When Delete all lisp locator_set from VPP \
106 | | ... | \| ${nodes['DUT1']} \|
107 | | ...
108 | | [Arguments] | ${dut_node}
109 | | Vpp Unset Lisp Locator Set | ${dut_node} | ${locator_set_values}
110
111 | Lisp locator_set should be unset
112 | | [Documentation] | Test if all locator_set are unset from VPP node.
113 | | ...
114 | | ... | *Arguments:*
115 | | ... | - dut_node - DUT node. Type: dictionary
116 | | ...
117 | | ... | *Return:*
118 | | ... | - No value returned
119 | | ...
120 | | ... | *Example:*
121 | | ... | \| Then Lisp locator_set should be unset \| ${nodes['DUT1']} \|
122 | | ...
123 | | [Arguments] | ${dut_node}
124 | | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | ${EMPTY}
125 | | Lisp Is Empty | ${show_locator_set}
126
127 | Lisp locator_set data use for test reset locator_set are prepared
128 | | [Documentation] | Generate lisp special type of locator_set data.
129 | | ...             | This data will be use for test reset locator_set.
130 | | ...
131 | | ... | *Arguments:*
132 | | ... | - dut_node - DUT node. Type: dictionary
133 | | ... | - locator_set_number - Number how many locator_set data
134 | | ... |                        it will generate. Type: integer
135 | | ...
136 | | ... | *Return:*
137 | | ... | - No value returned
138 | | ...
139 | | ... | _NOTE:_ This KW sets following test case variables:
140 | | ... | - locator_set_values - New generate locator_set data.
141 | | ...
142 | | ... | *Example:*
143 | | ... | \| Given Lisp locator_set data use for test reset locator_set \
144 | | ... |    are prepared \| ${nodes['DUT1']} \| ${locator_set_number} \|
145 | | ...
146 | | [Arguments] | ${dut_node} | ${locator_set_number}
147 | | ${locator_set_values}= | Generate Duplicate Lisp Locator Set Data |
148 | | ...                    | ${dut_node} | ${locator_set_number}
149 | | Set Test Variable | ${locator_set_values}
150
151 | Lisp eid address is set
152 | | [Documentation] | Set the lisp eid address on the VPP node.
153 | | ...
154 | | ... | *Arguments:*
155 | | ... | - dut_node - DUT node. Type: dictionary
156 | | ... | - set_eid - Test eid data. Type: list
157 | | ...
158 | | ... | *Return:*
159 | | ... | - No value returned
160 | | ...
161 | | ... | *Example:*
162 | | ... | \| When Lisp eid address is set \| ${nodes['DUT1']} \| ${eid_table} |\
163 | | ...
164 | | [Arguments] | ${dut_node} | ${set_eid}
165 | | Vpp Set Lisp Eid Table | ${dut_node} | ${set_eid}
166
167 | Lisp eid address is set correctly to eid table
168 | | [Documentation] | Test if the locator_set is set correctly on the VPP node.
169 | | ...
170 | | ... | *Arguments:*
171 | | ... | - dut_node - DUT node. Type: dictionary
172 | | ... | - set_eid - Example eid data, which was set to the VPP node.
173 | | ... |                Type: list
174 | | ...
175 | | ... | *Return:*
176 | | ... | - No value returned
177 | | ...
178 | | ... | _NOTE:_ This KW requires following test case variables:
179 | | ... | - set_eid - Generated eid data, which will be set to the VPP node.
180 | | ...
181 | | ... | *Example:*
182 | | ... | \| Then Lisp eid address is set correctly to eid table \
183 | | ... | \| ${nodes['DUT1']} \| ${eid_table} \|
184 | | ...
185 | | [Arguments] | ${dut_node} | ${set_eid}
186 | | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node}
187 | | Lisp Should Be Equal | ${set_eid} | ${show_eid}
188
189 | Delete all lisp eid address from VPP
190 | | [Documentation] | Delete all lisp eid address from the VPP node.
191 | | ...
192 | | ... | *Arguments:*
193 | | ... | - dut_node - DUT node. Type: dictionary
194 | | ... | - set_eid - Eid data which will be removed from the VPP node.
195 | | ... |             Type: list
196 | | ...
197 | | ... | *Return:*
198 | | ... | - No value returned
199 | | ...
200 | | ... | *Example:*
201 | | ... | \| When Delete all lisp eid address from VPP \
202 | | ... | \| ${nodes['DUT1']} \| ${eid_table} \|
203 | | ...
204 | | [Arguments] | ${dut_node} | ${set_eid}
205 | | Vpp Unset Lisp Eid Table | ${dut_node} | ${set_eid}
206
207 | Lisp eid table should be empty
208 | | [Documentation] | Test if the eid table is empty.
209 | | ...
210 | | ... | *Arguments:*
211 | | ... | - dut_node - DUT node. Type: dictionary
212 | | ...
213 | | ... | *Return:*
214 | | ... | - No value returned
215 | | ...
216 | | ... | *Example:*
217 | | ... | \| Then Lisp eid table should be empty \| ${nodes['DUT1']} \|
218 | | ...
219 | | [Arguments] | ${dut_node}
220 | | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node}
221 | | Lisp Is Empty | ${show_eid}
222
223 | Lisp map resolver address is set
224 | | [Documentation] | Set the lisp map resolver address in the VPP node.
225 | | ...
226 | | ... | *Arguments:*
227 | | ... | - dut_node - DUT node. Type: dictionary
228 | | ... | - set_map_resolver - Map resolver data, which will be set on
229 | | ... |                      the VPP node. Type: list
230 | | ...
231 | | ... | *Return:*
232 | | ... | - No value returned
233 | | ...
234 | | ... | *Example:*
235 | | ... | \| When Lisp map resolver address is set \| ${nodes['DUT1']} \
236 | | ... | \| ${map_resolver} \|
237 | | ...
238 | | [Arguments] | ${dut_node} | ${set_map_resolver}
239 | | Vpp Set Lisp Map Resolver | ${dut_node} | ${set_map_resolver}
240
241 | Lisp map resolver address is set correctly
242 | | [Documentation] | Test if the map resolver address is set correctly
243 | | ...             | on the VPP node.
244 | | ...
245 | | ... | *Arguments:*
246 | | ... | - dut_node - DUT node. Type: dictionary
247 | | ... | - set_map_resolver - Map resolver data, which was set on
248 | | ... |                      the VPP node. Type: list
249 | | ...
250 | | ... | *Return:*
251 | | ... | - No value returned
252 | | ...
253 | | ... | *Example:*
254 | | ... | \| Then Lisp map resolver address is set correctly \
255 | | ... | \| ${nodes['DUT1']} \| ${map_resolver} \|
256 | | ...
257 | | [Arguments] | ${dut_node} | ${set_map_resolver}
258 | | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node}
259 | | Lisp Should Be Equal | ${set_map_resolver} | ${show_map_resolver}
260
261 | Delete all lisp map resolver address from VPP
262 | | [Documentation] | Delete all lisp map resolver address on the VPP node.
263 | | ...
264 | | ... | *Arguments:*
265 | | ... | - dut_node - DUT node. Type: dictionary
266 | | ... | - map_resolver - Map resolver data, which will be remove from
267 | | ... |                  the VPP. Type: list
268 | | ...
269 | | ... | *Return:*
270 | | ... | - No value returned
271 | | ...
272 | | ... | *Example:*
273 | | ... | \| When Delete all lisp map resolver address from VPP \
274 | | ... | \| ${nodes['DUT1']} \| ${map_resolver} \|
275 | | ...
276 | | [Arguments] | ${dut_node} | ${set_map_resolver}
277 | | Vpp Unset Lisp Map Resolver | ${dut_node} | ${set_map_resolver}
278
279 | Lip map resolver address should be empty
280 | | [Documentation] | Test if the map resolver are empty.
281 | | ...
282 | | ... | *Arguments:*
283 | | ... | - dut_node - DUT node. Type: dictionary
284 | | ...
285 | | ... | *Return:*
286 | | ... | - No value returned
287 | | ...
288 | | ... | *Example:*
289 | | ... | \| Then Lip map resolver address should be empty \
290 | | ... | \| ${nodes['DUT1']} \|
291 | | ...
292 | | [Arguments] | ${dut_node}
293 | | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node}
294 | | Lisp Is Empty | ${show_map_resolver}
295
296 | Enable lisp
297 | | [Documentation] | Enable lisp on VPP node.
298 | | ...
299 | | ... | *Arguments:*
300 | | ... | - dut_node - DUT node. Type: dictionary
301 | | ...
302 | | ... | *Return:*
303 | | ... | - No value returned
304 | | ...
305 | | ... | *Example:*
306 | | ... | \| Enable lisp \| ${nodes['DUT1']} \|
307 | | ...
308 | | [Arguments] | ${dut_node}
309 | | Vpp Lisp Enable Disable | ${dut_node} | enable
310
311 | Check if lisp is enabled
312 | | [Documentation] | Check if the lisp is enabled.
313 | | ...
314 | | ... | *Arguments:*
315 | | ... | - dut_node - DUT node. Type: dictionary
316 | | ... | - lisp_status_data - Lisp status data, which was set on
317 | | ... |                      the VPP node. Type: list
318 | | ...
319 | | ... | *Return:*
320 | | ... | - No value returned
321 | | ...
322 | | ... | *Example:*
323 | | ... | \| Check if lisp is enabled \| ${nodes['DUT1']} \
324 | | ... | \| ${lisp_status_data} \|
325 | | ...
326 | | [Arguments] | ${dut_node} | ${lisp_status_data}
327 | | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node}
328 | | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[1]}
329
330 | Disable lisp
331 | | [Documentation] | Disable lisp on VPP node.
332 | | ...
333 | | ... | *Arguments:*
334 | | ... | - dut_node - DUT node. Type: dictionary
335 | | ...
336 | | ... | *Return:*
337 | | ... | - No value returned
338 | | ...
339 | | ... | *Example:*
340 | | ... | \| Disable lisp \| ${nodes['DUT1']} \|
341 | | ...
342 | | [Arguments] | ${dut_node}
343 | | Vpp Lisp Enable Disable | ${dut_node} | disable
344
345 | Check if lisp is disabled
346 | | [Documentation] | Check if lisp is disabled.
347 | | ...
348 | | ... | *Arguments:*
349 | | ... | - dut_node - DUT node. Type: dictionary
350 | | ... | - lisp_status_data - Lisp status data, which was set on
351 | | ... |                      the VPP node. Type: list
352 | | ...
353 | | ... | *Return:*
354 | | ... | - No value returned
355 | | ...
356 | | ... | *Example:*
357 | | ... | \| Check if lisp is disabled \| ${nodes['DUT1']} \
358 | | ... | \| ${lisp_status_data} \|
359 | | ...
360 | | [Arguments] | ${dut_node} | ${lisp_status_data}
361 | | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node}
362 | | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[0]}
363
364 | Enable Lisp Gpe
365 | | [Documentation] | Enable Lisp Gpe on VPP node.
366 | | ...
367 | | ... | *Arguments:*
368 | | ... | - dut_node - DUT node. Type: dictionary
369 | | ...
370 | | ... | *Return:*
371 | | ... | - No value returned
372 | | ...
373 | | ... | *Example:*
374 | | ... | \| Enable Lisp Gpe \| ${nodes['DUT1']} \|
375 | | ...
376 | | [Arguments] | ${dut_node}
377 | | Vpp Lisp Gpe Enable Disable | ${dut_node} | enable
378
379 | Disable Lisp Gpe
380 | | [Documentation] | Disable Lisp Gpe on VPP node.
381 | | ...
382 | | ... | *Arguments:*
383 | | ... | - dut_node - DUT node. Type: dictionary
384 | | ...
385 | | ... | *Return:*
386 | | ... | - No value returned
387 | | ...
388 | | ... | *Example:*
389 | | ... | \| Disable Lisp Gpe \| ${nodes['DUT1']} \|
390 | | ...
391 | | [Arguments] | ${dut_node}
392 | | Vpp Lisp Gpe Enable Disable | ${dut_node} | disable