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