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