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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 | Library | resources.libraries.python.InterfaceUtil
16 | Library | resources.libraries.python.NodePath
19 | Path for 2-node testing is set
20 | | [Documentation] | Compute path for testing on two given nodes in circular
21 | | ... | topology and set corresponding test case variables.
23 | | ... | *Arguments:*
24 | | ... | - ${tg_node} - TG node. Type: dictionary
25 | | ... | - ${dut_node} - DUT node. Type: dictionary
26 | | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node
27 | | ... | parameter in circular topology. Type: dictionary
30 | | ... | - No value returned
32 | | ... | _NOTE:_ This KW sets following test case variables:
33 | | ... | - ${tg_node} - TG node.
34 | | ... | - ${tg_to_dut_if1} - 1st TG interface towards DUT.
35 | | ... | - ${tg_to_dut_if2} - 2nd TG interface towards DUT.
36 | | ... | - ${dut_node} - DUT node.
37 | | ... | - ${dut_to_tg_if1} - 1st DUT interface towards TG.
38 | | ... | - ${dut_to_tg_if2} - 2nd DUT interface towards TG.
39 | | ... | - ${tg_to_dut_if1_mac}
40 | | ... | - ${tg_to_dut_if2_mac}
41 | | ... | - ${dut_to_tg_if1_mac}
42 | | ... | - ${dut_to_tg_if2_mac}
46 | | ... | \| Given Path for 2-node testing is set \| ${nodes['TG']} \
47 | | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \|
49 | | [Arguments] | ${tg_node} | ${dut_node} | ${tg2_node}
50 | | Should Be Equal | ${tg_node} | ${tg2_node}
51 | | Append Nodes | ${tg_node} | ${dut_node} | ${tg_node}
52 | | Compute Path | always_same_link=${FALSE}
53 | | ${tg_to_dut_if1} | ${tmp}= | First Interface
54 | | ${tg_to_dut_if2} | ${tmp}= | Last Interface
55 | | ${dut_to_tg_if1} | ${tmp}= | First Ingress Interface
56 | | ${dut_to_tg_if2} | ${tmp}= | Last Egress Interface
57 | | ${tg_to_dut_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if1}
58 | | ${tg_to_dut_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if2}
59 | | ${dut_to_tg_if1_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if1}
60 | | ${dut_to_tg_if2_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if2}
61 | | Set Test Variable | ${tg_to_dut_if1}
62 | | Set Test Variable | ${tg_to_dut_if2}
63 | | Set Test Variable | ${dut_to_tg_if1}
64 | | Set Test Variable | ${dut_to_tg_if2}
65 | | Set Test Variable | ${tg_to_dut_if1_mac}
66 | | Set Test Variable | ${tg_to_dut_if2_mac}
67 | | Set Test Variable | ${dut_to_tg_if1_mac}
68 | | Set Test Variable | ${dut_to_tg_if2_mac}
69 | | Set Test Variable | ${tg_node}
70 | | Set Test Variable | ${dut_node}
72 | Interfaces in 2-node path are up
73 | | [Documentation] | Set UP state on interfaces in 2-node path on nodes and
74 | | ... | wait for all interfaces are ready. Requires more than
75 | | ... | one link between nodes.
77 | | ... | *Arguments:*
78 | | ... | - No arguments.
81 | | ... | - No value returned.
83 | | ... | _NOTE:_ This KW uses test variables sets in
84 | | ... | "Path for 2-node testing is set" KW.
88 | | ... | \| Given Path for 2-node testing is set \| ${nodes['TG']} \
89 | | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \|
90 | | ... | \| And Interfaces in 2-node path are up \|
92 | | Set Interface State | ${tg_node} | ${tg_to_dut_if1} | up
93 | | Set Interface State | ${tg_node} | ${tg_to_dut_if2} | up
94 | | Set Interface State | ${dut_node} | ${dut_to_tg_if1} | up
95 | | Set Interface State | ${dut_node} | ${dut_to_tg_if2} | up
96 | | Vpp Node Interfaces Ready Wait | ${dut_node}
98 | Path for 3-node testing is set
99 | | [Documentation] | Compute path for testing on three given nodes in circular
100 | | ... | topology and set corresponding test case variables.
102 | | ... | *Arguments:*
103 | | ... | - ${tg_node} - TG node. Type: dictionary
104 | | ... | - ${dut1_node} - DUT1 node. Type: dictionary
105 | | ... | - ${dut2_node} - DUT2 node. Type: dictionary
106 | | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node
107 | | ... | parameter in circular topology. Type: dictionary
110 | | ... | - No value returned
112 | | ... | _NOTE:_ This KW sets following test case variables:
113 | | ... | - ${tg_node} - TG node.
114 | | ... | - ${tg_to_dut1} - TG interface towards DUT1.
115 | | ... | - ${tg_to_dut2} - TG interface towards DUT2.
116 | | ... | - ${dut1_node} - DUT1 node.
117 | | ... | - ${dut1_to_tg} - DUT1 interface towards TG.
118 | | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2.
119 | | ... | - ${dut2_node} - DUT2 node.
120 | | ... | - ${dut2_to_tg} - DUT2 interface towards TG.
121 | | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1.
122 | | ... | - ${tg_to_dut1_mac}
123 | | ... | - ${tg_to_dut2_mac}
124 | | ... | - ${dut1_to_tg_mac}
125 | | ... | - ${dut1_to_dut2_mac}
126 | | ... | - ${dut2_to_tg_mac}
127 | | ... | - ${dut2_to_dut1_mac}
131 | | ... | \| Given Path for 3-node testing is set \| ${nodes['TG']} \
132 | | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \|
134 | | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node}
135 | | Should Be Equal | ${tg_node} | ${tg2_node}
136 | | Append Nodes | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node}
138 | | ${tg_to_dut1} | ${tmp}= | Next Interface
139 | | ${dut1_to_tg} | ${tmp}= | Next Interface
140 | | ${dut1_to_dut2} | ${tmp}= | Next Interface
141 | | ${dut2_to_dut1} | ${tmp}= | Next Interface
142 | | ${dut2_to_tg} | ${tmp}= | Next Interface
143 | | ${tg_to_dut2} | ${tmp}= | Next Interface
144 | | ${tg_to_dut1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1}
145 | | ${tg_to_dut2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2}
146 | | ${dut1_to_tg_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_tg}
147 | | ${dut1_to_dut2_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_dut2}
148 | | ${dut2_to_tg_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_tg}
149 | | ${dut2_to_dut1_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_dut1}
150 | | Set Test Variable | ${tg_to_dut1}
151 | | Set Test Variable | ${dut1_to_tg}
152 | | Set Test Variable | ${tg_to_dut2}
153 | | Set Test Variable | ${dut2_to_tg}
154 | | Set Test Variable | ${dut1_to_dut2}
155 | | Set Test Variable | ${dut2_to_dut1}
156 | | Set Test Variable | ${tg_to_dut1_mac}
157 | | Set Test Variable | ${tg_to_dut2_mac}
158 | | Set Test Variable | ${dut1_to_tg_mac}
159 | | Set Test Variable | ${dut1_to_dut2_mac}
160 | | Set Test Variable | ${dut2_to_tg_mac}
161 | | Set Test Variable | ${dut2_to_dut1_mac}
162 | | Set Test Variable | ${tg_node}
163 | | Set Test Variable | ${dut1_node}
164 | | Set Test Variable | ${dut2_node}
166 | Interfaces in 3-node path are up
168 | | ... | Set UP state on interfaces in 3-node path on nodes and \
169 | | ... | wait until all interfaces are ready.
171 | | ... | *Arguments:*
172 | | ... | - No arguments.
175 | | ... | - No value returned.
177 | | ... | _NOTE:_ This KW uses test variables sets in
178 | | ... | "Path for 3-node testing is set" KW.
182 | | ... | \| Given Path for 3-node testing is set \| ${nodes['TG']} \
183 | | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \|
184 | | ... | \| And Interfaces in 3-node path are up \|
186 | | Set Interface State | ${tg_node} | ${tg_to_dut1} | up
187 | | Set Interface State | ${tg_node} | ${tg_to_dut2} | up
188 | | Set Interface State | ${dut1_node} | ${dut1_to_tg} | up
189 | | Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up
190 | | Set Interface State | ${dut2_node} | ${dut2_to_tg} | up
191 | | Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up
192 | | Vpp Node Interfaces Ready Wait | ${dut1_node}
193 | | Vpp Node Interfaces Ready Wait | ${dut2_node}
195 | Path for Double-Link 3-node testing is set
197 | | ... | Compute path for testing on three given nodes in circular \
198 | | ... | topology with double link and set corresponding \
199 | | ... | test case variables.
201 | | ... | *Arguments:*
202 | | ... | - ${tg_node} - TG node. Type: dictionary
203 | | ... | - ${dut1_node} - DUT1 node. Type: dictionary
204 | | ... | - ${dut2_node} - DUT2 node. Type: dictionary
205 | | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node
206 | | ... | parameter in circular topology. Type: dictionary
209 | | ... | - No value returned.
211 | | ... | _NOTE:_ This KW sets following test case variables:
212 | | ... | - ${tg_node} - TG node.
213 | | ... | - ${tg_to_dut1_if1} - TG interface towards DUT1 interface 1.
214 | | ... | - ${tg_to_dut1_if2} - TG interface towards DUT1 interface 2.
215 | | ... | - ${tg_to_dut1_mac_if1} - TG towards DUT1 MAC address interface 1.
216 | | ... | - ${tg_to_dut1_mac_if2} - TG towards DUT1 MAC address interface 2.
217 | | ... | - ${tg_to_dut2_if1} - TG interface towards DUT2 interface 1.
218 | | ... | - ${tg_to_dut2_if2} - TG interface towards DUT2 interface 2.
219 | | ... | - ${tg_to_dut2_mac_if1} - TG towards DUT2 MAC address interface 1.
220 | | ... | - ${tg_to_dut2_mac_if2} - TG towards DUT2 MAC address interface 2.
221 | | ... | - ${dut1_node} - DUT1 node.
222 | | ... | - ${dut1_to_tg_if1} - DUT1 interface towards TG interface 1.
223 | | ... | - ${dut1_to_tg_if2} - DUT1 interface towards TG interface 2.
224 | | ... | - ${dut1_to_tg_mac_if1} - DUT1 towards TG MAC address interface 1.
225 | | ... | - ${dut1_to_tg_mac_if2} - DUT1 towards TG MAC address interface 2.
226 | | ... | - ${dut1_to_dut2_if1} - DUT1 interface towards DUT2 interface 1.
227 | | ... | - ${dut1_to_dut2_if2} - DUT1 interface towards DUT2 interface 2.
228 | | ... | - ${dut1_to_dut2_mac_if1} - DUT1 towards DUT2 MAC address interface 1.
229 | | ... | - ${dut1_to_dut2_mac_if2} - DUT1 towards DUT2 MAC address interface 2.
230 | | ... | - ${dut2_node} - DUT2 node.
231 | | ... | - ${dut2_to_tg_if1} - DUT2 interface towards TG interface 1.
232 | | ... | - ${dut2_to_tg_if2} - DUT2 interface towards TG interface 2.
233 | | ... | - ${dut2_to_tg_mac_if1} - DUT2 towards TG MAC address interface 1.
234 | | ... | - ${dut2_to_tg_mac_if2} - DUT2 towards TG MAC address interface 2.
235 | | ... | - ${dut2_to_dut1_if1} - DUT2 interface towards DUT1 interface 1.
236 | | ... | - ${dut2_to_dut1_if2} - DUT2 interface towards DUT1 interface 2.
237 | | ... | - ${dut2_to_dut1_mac_if1} - DUT2 towards DUT1 MAC address interface 1.
238 | | ... | - ${dut2_to_dut1_mac_if2} - DUT2 towards DUT1 MAC address interface 2.
242 | | ... | \| Path for Double-Link 3-node testing is set \| ${nodes['TG']} \
243 | | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \|
245 | | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node}
246 | | Should Be Equal | ${tg_node} | ${tg2_node}
247 | | # Compute path TG - DUT1 with two links in between
248 | | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node}
249 | | Compute Path | always_same_link=${FALSE}
250 | | ${tg_to_dut1_if1} | ${tmp}= | First Interface
251 | | ${tg_to_dut1_if2} | ${tmp}= | Last Interface
252 | | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface
253 | | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface
254 | | # Compute path TG - DUT2 with two links in between
256 | | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node}
257 | | Compute Path | always_same_link=${FALSE}
258 | | ${tg_to_dut2_if1} | ${tmp}= | First Interface
259 | | ${tg_to_dut2_if2} | ${tmp}= | Last Interface
260 | | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface
261 | | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface
262 | | # Compute path DUT1 - DUT2 with one link in between
264 | | Append Nodes | ${dut1_node} | ${dut2_node} | ${dut1_node}
265 | | Compute Path | always_same_link=${FALSE}
266 | | ${dut1_to_dut2_if1} | ${tmp}= | First Interface
267 | | ${dut1_to_dut2_if2} | ${tmp}= | Last Interface
268 | | ${dut2_to_dut1_if1} | ${tmp}= | First Ingress Interface
269 | | ${dut2_to_dut1_if2} | ${tmp}= | Last Egress Interface
270 | | # Set test variables
271 | | Set Test Variable | ${tg_to_dut1_if1}
272 | | Set Test Variable | ${tg_to_dut1_if2}
273 | | Set Test Variable | ${tg_to_dut2_if1}
274 | | Set Test Variable | ${tg_to_dut2_if2}
275 | | Set Test Variable | ${dut1_to_tg_if1}
276 | | Set Test Variable | ${dut1_to_tg_if2}
277 | | Set Test Variable | ${dut2_to_tg_if1}
278 | | Set Test Variable | ${dut2_to_tg_if2}
279 | | Set Test Variable | ${dut1_to_dut2_if1}
280 | | Set Test Variable | ${dut1_to_dut2_if2}
281 | | Set Test Variable | ${dut2_to_dut1_if1}
282 | | Set Test Variable | ${dut2_to_dut1_if2}
283 | | Set Test Variable | ${tg_node}
284 | | Set Test Variable | ${dut1_node}
285 | | Set Test Variable | ${dut2_node}
286 | | # Set Mac Addresses
287 | | ${tg_to_dut1_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if1}
288 | | ${tg_to_dut1_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if2}
289 | | ${tg_to_dut2_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if1}
290 | | ${tg_to_dut2_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if2}
291 | | ${dut1_to_tg_if1_mac}= | Get interface mac | ${dut1_node}
292 | | ... | ${dut1_to_tg_if1}
293 | | ${dut1_to_tg_if2_mac}= | Get interface mac | ${dut1_node}
294 | | ... | ${dut1_to_tg_if2}
295 | | ${dut1_to_dut2_if1_mac}= | Get interface mac | ${dut1_node}
296 | | ... | ${dut1_to_dut2_if1}
297 | | ${dut1_to_dut2_if2_mac}= | Get interface mac | ${dut1_node}
298 | | ... | ${dut1_to_dut2_if2}
299 | | ${dut2_to_tg_if1_mac}= | Get interface mac | ${dut2_node}
300 | | ... | ${dut2_to_tg_if1}
301 | | ${dut2_to_tg_if2_mac}= | Get interface mac | ${dut2_node}
302 | | ... | ${dut2_to_tg_if2}
303 | | ${dut2_to_dut1_if1_mac}= | Get interface mac | ${dut2_node}
304 | | ... | ${dut2_to_dut1_if1}
305 | | ${dut2_to_dut1_if2_mac}= | Get interface mac | ${dut2_node}
306 | | ... | ${dut2_to_dut1_if2}
307 | | Set Test Variable | ${tg_to_dut1_if1_mac}
308 | | Set Test Variable | ${tg_to_dut1_if2_mac}
309 | | Set Test Variable | ${tg_to_dut2_if1_mac}
310 | | Set Test Variable | ${tg_to_dut2_if2_mac}
311 | | Set Test Variable | ${dut1_to_tg_if1_mac}
312 | | Set Test Variable | ${dut1_to_tg_if2_mac}
313 | | Set Test Variable | ${dut1_to_dut2_if1_mac}
314 | | Set Test Variable | ${dut1_to_dut2_if2_mac}
315 | | Set Test Variable | ${dut2_to_tg_if1_mac}
316 | | Set Test Variable | ${dut2_to_tg_if2_mac}
317 | | Set Test Variable | ${dut2_to_dut1_if1_mac}
318 | | Set Test Variable | ${dut2_to_dut1_if2_mac}
320 | Interfaces in Double-Link 3-node path are UP
322 | | ... | Set UP state on interfaces in 3-node double link path \
323 | | ... | wait until all interfaces are ready.
325 | | ... | *Arguments:*
326 | | ... | - No arguments.
329 | | ... | - No value returned.
331 | | ... | _NOTE:_ This KW uses test variables sets in
332 | | ... | "Path for Double-Link 3-node testing is set" KW.
336 | | ... | \| Path for Double-Link 3-node testing is set \| ${nodes['TG']} \
337 | | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \|
338 | | ... | \| Interfaces in Double-Link 3-node testing are UP \|
340 | | Set Interface State | ${tg_node} | ${tg_to_dut1_if1} | up
341 | | Set Interface State | ${tg_node} | ${tg_to_dut1_if2} | up
342 | | Set Interface State | ${tg_node} | ${tg_to_dut2_if1} | up
343 | | Set Interface State | ${tg_node} | ${tg_to_dut2_if2} | up
344 | | Set Interface State | ${dut1_node} | ${dut1_to_tg_if1} | up
345 | | Set Interface State | ${dut1_node} | ${dut1_to_tg_if2} | up
346 | | Set Interface State | ${dut2_node} | ${dut2_to_tg_if1} | up
347 | | Set Interface State | ${dut2_node} | ${dut2_to_tg_if2} | up
348 | | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if1} | up
349 | | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if2} | up
350 | | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if1} | up
351 | | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if2} | up
352 | | Vpp Node Interfaces Ready Wait | ${dut1_node}
353 | | Vpp Node Interfaces Ready Wait | ${dut2_node}