HC Test: disable TC12 from BGP suite untill HC2VPP-267 is resolved
[csit.git] / tests / vpp / func / honeycomb / mgmt-cfg-bgp-apihc-func.robot
1 # Copyright (c) 2017 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 *** Variables ***
15 # Interface to run tests on.
16 | ${interface}= | ${node['interfaces']['port1']['name']}
17 | ${dut1_to_tg_ip}= | 192.168.0.1
18 | ${tg_to_dut1_ip}= | 192.168.0.2
19 | ${dut1_to_dut2_ip}= | 192.168.1.1
20 | ${dut2_to_dut1_ip}= | 192.168.1.2
21 | ${bgp_port}= | ${179}
22 | ${bgp_as_number}= | ${37}
23 | ${prefix}= | ${24}
24
25 *** Settings ***
26 | Library | resources.libraries.python.honeycomb.IPv6Management
27 | Resource | resources/libraries/robot/shared/default.robot
28 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
29 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
30 | Resource | resources/libraries/robot/honeycomb/bgp.robot
31 | Resource | resources/libraries/robot/honeycomb/routing.robot
32 | Resource | resources/libraries/robot/shared/testing_path.robot
33 | Resource | resources/libraries/robot/honeycomb/ipv6_control.robot
34 | Variables | resources/test_data/honeycomb/bgp.py
35 | ...
36 | Suite Setup | Run Keywords
37 | ... | Enable Honeycomb Feature | ${node} | BGP | AND
38 | ... | Configure BGP Module | ${node} | ${dut1_to_tg_ip}
39 | ... | ${bgp_port} | ${bgp_as_number} | AND
40 | ... | Set Up Honeycomb Functional Test Suite | ${node}
41 | ...
42 | Suite Teardown | Run Keywords
43 | ... | Tear Down Honeycomb Functional Test Suite | ${nodes['DUT1']} | AND
44 | ... | Stop Honeycomb service on DUTs | ${nodes['DUT2']} | AND
45 | ... | Unconfigure IPv4 Management Interfaces | AND
46 | ... | Disable Honeycomb Feature | ${node} | BGP | AND
47 | ... | Disable Honeycomb Feature | ${nodes['DUT2']} | BGP
48 | ...
49 # HONEYCOMB-409: BGP configuration via ODL is currently not fully supported
50 | Force Tags | HC_FUNC | HC_REST_ONLY
51 | ...
52 | Documentation | *Honeycomb BGP management test suite.*
53
54 *** Test Cases ***
55 | TC01: Honeycomb configures BGP peer - Internal
56 | | [Documentation] | Check if Honeycomb can configure an internal BGP peer.
57 | | ...
58 | | When Honeycomb adds BGP peer
59 | | ... | ${node} | ${address_internal} | ${peer_internal}
60 | | Then BGP peer from Honeycomb should be
61 | | ... | ${node} | ${address_internal} | ${peer_internal}
62
63 | TC02: Honeycomb removes peer configuration
64 | | [Documentation] | Check if Honeycomb can remove a configured BGP peer.
65 | | ...
66 | | Given BGP peer from Honeycomb should be
67 | | ... | ${node} | ${address_internal} | ${peer_internal}
68 | | When Honeycomb removes BGP peer | ${node} | ${address_internal}
69 | | Then No BGP peers should be configured | ${node}
70
71 | TC03: Honeycomb updates existing BGP peer - Internal
72 | | [Documentation] | Check if Honeycomb can update an existing BGP peer.
73 | | ...
74 | | [Teardown] | Honeycomb removes BGP peer | ${node} | ${address_internal}
75 | | ...
76 | | Given No BGP peers should be configured | ${node}
77 | | When Honeycomb adds BGP peer
78 | | ... | ${node} | ${address_internal} | ${peer_internal}
79 | | And Honeycomb adds BGP peer
80 | | ... | ${node} | ${address_internal} | ${peer_internal_update}
81 | | Then BGP peer from Honeycomb should be
82 | | ... | ${node} | ${address_internal} | ${peer_internal_update}
83
84 | TC04: Honeycomb configures BGP peer - Application
85 | | [Documentation] | Check if Honeycomb can configure an application BGP peer.
86 | | ...
87 | | [Teardown] | Honeycomb removes BGP peer | ${node} | ${address_application}
88 | | ...
89 | | Given No BGP peers should be configured | ${node}
90 | | When Honeycomb adds BGP peer
91 | | ... | ${node} | ${address_application} | ${peer_application}
92 | | Then BGP peer from Honeycomb should be
93 | | ... | ${node} | ${address_application} | ${peer_application}
94
95 | TC05: Honeycomb configures a second BGP peer
96 | | [Documentation] | Check if Honeycomb can configure more than one BGP peer.
97 | | ...
98 | | [Teardown] | Run Keywords
99 | | ... | Honeycomb removes BGP peer | ${node} | ${address_internal} | AND
100 | | ... | Honeycomb removes BGP peer | ${node} | ${address_internal2}
101 | | ...
102 | | Given No BGP peers should be configured | ${node}
103 | | When Honeycomb adds BGP peer
104 | | ... | ${node} | ${address_internal} | ${peer_internal}
105 | | And Honeycomb adds BGP peer
106 | | ... | ${node} | ${address_internal2} | ${peer_internal2}
107 | | Then BGP peer from Honeycomb should be
108 | | ... | ${node} | ${address_internal} | ${peer_internal}
109 | | And BGP peer from Honeycomb should be
110 | | ... | ${node} | ${address_internal2} | ${peer_internal2}
111
112 | TC06: Honeycomb configures IPv4 route using BGP
113 | | [Documentation] | Check if Honeycomb can configure a BGP route under a peer.
114 | | ...
115 | | Given Honeycomb adds BGP peer
116 | | ... | ${node} | ${address_internal} | ${peer_internal}
117 | | When Honeycomb configures BGP route
118 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
119 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
120 | | Then BGP Route from Honeycomb should be
121 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
122 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
123
124 | TC07: Honeycomb removes IPv4 route configuration
125 | | [Documentation] | Check if Honeycomb can remove a configured BGP route.
126 | | ...
127 | | Given BGP peer from Honeycomb should be
128 | | ... | ${node} | ${address_internal} | ${peer_internal}
129 | | And BGP Route from Honeycomb should be
130 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
131 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
132 | | When Honeycomb removes BGP route | ${node} | ${address_internal}
133 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
134 | | Then No BGP Routes Should be Configured
135 | | ... | ${node} | ${address_internal} | ipv4
136
137 | TC08: Honeycomb updates existing IPv4 route using BGP
138 | | [Documentation] | Check if Honeycomb can update an existing BGP route.
139 | | ...
140 | | [Teardown] | Honeycomb removes BGP route | ${node} | ${address_internal}
141 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
142 | | ...
143 | | Given BGP peer from Honeycomb should be
144 | | ... | ${node} | ${address_internal} | ${peer_internal}
145 | | And No BGP Routes Should be Configured
146 | | ... | ${node} | ${address_internal} | ipv4
147 | | When Honeycomb configures BGP route
148 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
149 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
150 | | And Honeycomb configures BGP route
151 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_update}
152 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
153 | | Then BGP Route from Honeycomb should be
154 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_update}
155 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
156
157 | TC09: Honeycomb configures a second IPv4 route
158 | | [Documentation] | Check if Honeycomb can configure more than one BGP route.
159 | | ...
160 | | [Teardown] | Run Keywords
161 | | ... | Honeycomb removes BGP route | ${node} | ${address_internal}
162 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4 | AND
163 | | ... | Honeycomb removes BGP route | ${node} | ${address_internal}
164 | | ... | ${route_address_ipv4_2} | ${route_id_ipv4_2} | ipv4 | AND
165 | | ... | Honeycomb removes BGP peer | ${node} | ${address_internal}
166 | | ...
167 | | Given BGP peer from Honeycomb should be
168 | | ... | ${node} | ${address_internal} | ${peer_internal}
169 | | When Honeycomb configures BGP route
170 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
171 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
172 | | And Honeycomb configures BGP route
173 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_2}
174 | | ... | ${route_address_ipv4_2} | ${route_id_ipv4_2} | ipv4
175 | | Then BGP Route from Honeycomb should be
176 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
177 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
178 | | And BGP Route from Honeycomb should be
179 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_2}
180 | | ... | ${route_address_ipv4_2} | ${route_id_ipv4_2} | ipv4
181
182 | TC10: Honeycomb sends BGP OPEN messages to configured peer
183 | | [Documentation]
184 | | ... | [top] TG-DUT1-TG.
185 | | ... | [enc] Eth-IPv4-TCP-BGP.
186 | | ... | [cfg] On DUT1 give Honeycomb control over the data-plane interface
187 | | ... | connected to TG. Configure a BGP peer with the address of TG.
188 | | ... | [ver] Open a TCP listener on TG on the BGP port and listen for BGP
189 | | ... | OPEN message. On receive, verify message fields.
190 | | ...
191 | | [Setup] | Run Keywords
192 | | ... | Configure BGP Module | ${node} | ${dut1_to_dut2_ip}
193 | | ... | ${bgp_port} | ${bgp_as_number} | AND
194 | | ... | Configure IPv4 Management Interface
195 | | [Teardown] | Honeycomb removes BGP peer | ${dut1_node} | ${address_internal}
196 | | When Honeycomb adds BGP peer
197 | | ... | ${dut1_node} | ${address_internal} | ${peer_internal}
198 | | Then Receive BGP OPEN message
199 | | ... | ${tg_node} | ${tg_to_dut1_ip} | ${dut1_to_dut2_ip}
200 | | ... | ${bgp_port} | ${bgp_as_number} | ${holdtime_internal}
201
202 | TC11: Honeycomb shows connected peer in operational data
203 | | [Documentation]
204 | | ... | [top] TG-DUT1-DUT2-TG.
205 | | ... | [enc] Eth-IPv4-TCP-BGP.
206 | | ... | [cfg] On DUT1 and DUT2 give Honeycomb control over the data-plane
207 | | ... | interfaces connecting DUT1 ad DUT2. Configure BGP peers on DUT1
208 | | ... | and DUT2 with each other's IP address.
209 | | ... | [ver] Using Restconf, verify that Honeycomb on each DUT has the
210 | | ... | other DUT's entry in operational data.
211 | | ...
212 | | When Honeycomb adds BGP peer
213 | | ... | ${dut1_node} | ${dut2_to_dut1_ip} | ${dut2_peer}
214 | | And Honeycomb adds BGP peer
215 | | ... | ${dut2_node} | ${dut1_to_dut2_ip} | ${dut1_peer}
216 | | Sleep | 5s | Wait for BGP connection. Retry timer is 5 seconds.
217 | | Then Peer operational data from Honeycomb should be
218 | | ... | ${dut1_node} | ${dut2_to_dut1_ip}
219 | | And Peer operational data from Honeycomb should be
220 | | ... | ${dut2_node} | ${dut1_to_dut2_ip}
221
222 | TC12: Honeycomb sends IPv4 BGP route to connected peer
223 | | [Documentation]
224 | | ... | [top] TG-DUT1-DUT2-TG.
225 | | ... | [enc] Eth-IPv4-TCP-BGP.
226 | | ... | [cfg] On DUT1 and DUT2 give Honeycomb control over the data-plane
227 | | ... | interfaces connecting DUT1 ad DUT2. Configure BGP peers on DUT1
228 | | ... | and DUT2 with each other's IP address. On DUT2 configure a static
229 | | ... | IPv4 route using Honeycomb's BGP module.
230 | | ... | [ver] Verify that the route is present in BGP
231 | | ... | local RIB and VPP's routing table on each DUT.
232 | | ...
233 # HC2VPP-267: Adding IPv4 route via BGP crashes VPP
234 | | [Tags] | EXPECTED_FAILING
235 | | Given Peer operational data from Honeycomb should be
236 | | ... | ${dut1_node} | ${dut2_to_dut1_ip}
237 | | And Peer operational data from Honeycomb should be
238 | | ... | ${dut2_node} | ${dut1_to_dut2_ip}
239 | | When Honeycomb adds BGP peer
240 | | ... | ${dut2_node} | ${address_application} | ${peer_application}
241 | | And Honeycomb configures BGP route
242 | | ... | ${dut2_node} | ${address_application} | ${dut1_route}
243 | | ... | ${dut1_route_address} | ${dut1_route_id} | ipv4
244 | | And Sleep | 5s | Wait for route advertisement. Retry timer is 5 seconds.
245 | | Then Routing data from Honeycomb should contain
246 | | ... | ${dut1_node} | learned-protocol-0 | ipv4 | ${route_operational}
247 | | And Routing data from Honeycomb should contain
248 | | ... | ${dut2_node} | learned-protocol-0 | ipv4 | ${route_operational}
249 | | And BGP Loc-RIB table should include | ${dut1_node} | ${rib_operational}
250 | | And BGP Loc-RIB table should include | ${dut2_node} | ${rib_operational}
251
252 | TC13: Honeycomb sends IPv6 BGP route to connected peer
253 | | [Documentation]
254 | | ... | [top] TG-DUT1-DUT2-TG.
255 | | ... | [enc] Eth-IPv4-TCP-BGP.
256 | | ... | [cfg] On DUT1 and DUT2 give Honeycomb control over the data-plane
257 | | ... | interfaces connecting DUT1 ad DUT2. Configure BGP peers on DUT1
258 | | ... | and DUT2 with each other's IP address. On DUT2 configure a static
259 | | ... | IPv6 route using Honeycomb's BGP module.
260 | | ... | [ver] Verify that the route is present in BGP
261 | | ... | local RIB and VPP's routing table on each DUT.
262 | | ...
263 # HONEYCOMB-403: Missing writers for IPv6 BGP route
264 | | [Tags] | EXPECTED_FAILING
265 | | Given Peer operational data from Honeycomb should be
266 | | ... | ${dut1_node} | ${dut2_to_dut1_ip}
267 | | And Peer operational data from Honeycomb should be
268 | | ... | ${dut2_node} | ${dut1_to_dut2_ip}
269 | | And Honeycomb adds BGP peer
270 | | ... | ${dut2_node} | ${address_application} | ${peer_application}
271 | | And Honeycomb configures BGP route
272 | | ... | ${dut2_node} | ${address_application} | ${dut1_route_ip6}
273 | | ... | ${dut1_route_ip6_address} | ${dut1_route_ip6_id} | ipv6
274 | | And Sleep | 5s | Wait for route advertisement. Retry timer is 5 seconds.
275 | | Then Routing data from Honeycomb should contain
276 | | ... | ${dut1_node} | learned-protocol-0 | ipv6 | ${route_ip6_operational}
277 | | And Routing data from Honeycomb should contain
278 | | ... | ${dut2_node} | learned-protocol-0 | ipv6 | ${route_ip6_operational}
279 | | And BGP Loc-RIB table should include | ${dut1_node} | ${rib_ip6_operational}
280 | | And BGP Loc-RIB table should include | ${dut2_node} | ${rib_ip6_operational}
281
282 #TODO: Add tests once implemented in HC:
283 # IPv6 neighbor, L2VPN, L3VPN, linkstate, route reflector, and more
284
285 *** Keywords ***
286 | Configure IPv4 Management Interface
287 | | [Documentation] | Change one of VPP's data-plane interfaces on DUT into\
288 | | ... | a control-plane interface that Honeycomb can listen on. Setup IP\
289 | | ... | addresses on the link, create suite variables for traffic trests, set
290 | | ... | static ARP entries, then restart VPP and Honeycomb to apply changes.
291 | | ...
292 | | Configure path in 3-node circular topology
293 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
294 | | ${interface}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
295 | | Set Suite Variable | ${interface}
296 | | Set Suite Variable | ${tg_node}
297 | | Set Suite Variable | ${dut1_node}
298 | | Set Suite Variable | ${dut2_node}
299 | | Set Suite Variable | ${dut1_to_tg}
300 | | Stop VPP service on DUT | ${dut1_node}
301 | | Stop VPP service on DUT | ${dut2_node}
302 | | Stop Honeycomb Service on DUTs | ${dut1_node}
303 | | Stop Honeycomb Service on DUTs | ${dut2_node}
304 | | Convert data-plane interface to control-plane
305 | | ... | ${dut1_node} | ${dut1_to_tg}
306 | | Convert data-plane interface to control-plane
307 | | ... | ${dut1_node} | ${dut1_to_dut2}
308 | | Convert data-plane interface to control-plane
309 | | ... | ${dut2_node} | ${dut2_to_dut1}
310 | | Sleep | 5sec | Wait until OS reclaims the interfaces.
311 | | ${tg_to_dut1_name}= | Get Interface Name by MAC
312 | | ... | ${tg_node} | ${tg_to_dut1_mac}
313 | | ${dut1_to_tg_name}= | Get Interface Name by MAC
314 | | ... | ${dut1_node} | ${dut1_to_tg_mac}
315 | | ${dut1_to_dut2_name}= | Get Interface Name by MAC
316 | | ... | ${dut1_node} | ${dut1_to_dut2_mac}
317 | | ${dut2_to_dut1_name}= | Get Interface Name by MAC
318 | | ... | ${dut2_node} | ${dut2_to_dut1_mac}
319 | | Set Suite Variable | ${dut1_to_tg_name}
320 | | Set Suite Variable | ${tg_to_dut1_name}
321 | | Set Suite Variable | ${dut1_to_dut2_name}
322 | | Set Suite Variable | ${dut2_to_dut1_name}
323 | | Set management interface address
324 | | ... | ${tg_node} | ${tg_to_dut1_name}
325 | | ... | ${tg_to_dut1_ip} | ${prefix}
326 | | Set management interface address
327 | | ... | ${dut1_node} | ${dut1_to_tg_name}
328 | | ... | ${dut1_to_tg_ip} | ${prefix}
329 | | Set management interface address
330 | | ... | ${dut1_node} | ${dut1_to_dut2_name}
331 | | ... | ${dut1_to_dut2_ip} | ${prefix}
332 | | Set management interface address
333 | | ... | ${dut2_node} | ${dut2_to_dut1_name}
334 | | ... | ${dut2_to_dut1_ip} | ${prefix}
335 | | Set Static ARP | ${tg_node} | ${dut1_to_tg_ip} | ${dut1_to_tg_mac}
336 | | Set Static ARP | ${dut1_node} | ${tg_to_dut1_ip} | ${tg_to_dut1_mac}
337 | | Set Static ARP | ${dut1_node} | ${dut2_to_dut1_ip} | ${dut2_to_dut1_mac}
338 | | Set Static ARP | ${dut2_node} | ${dut1_to_dut2_ip} | ${dut1_to_dut2_mac}
339 | | Enable Honeycomb Feature | ${dut2_node} | BGP
340 | | Configure BGP Module | ${dut1_node} | ${dut1_to_dut2_ip}
341 | | ... | ${bgp_port} | ${bgp_as_number}
342 | | Configure BGP Module | ${dut2_node} | ${dut2_to_dut1_ip}
343 | | ... | ${bgp_port} | ${bgp_as_number}
344 | | Start VPP service on DUT | ${dut1_node}
345 | | Start VPP service on DUT | ${dut2_node}
346 | | Configure Honeycomb service on DUTs | ${dut1_node}
347 | | Set Up Honeycomb Functional Test Suite | ${dut2_node}
348
349 | Unconfigure IPv4 Management Interfaces
350 | | [Documentation] | Remove all IP addresses from the interface.
351 | | ...
352 | | Clear Interface Configuration | ${tg_node} | ${tg_to_dut1_name}
353 | | Clear Interface Configuration | ${dut1_node} | ${dut1_to_tg_name}
354 | | Clear Interface Configuration | ${dut1_node} | ${dut1_to_dut2_name}
355 | | Clear Interface Configuration | ${dut2_node} | ${dut2_to_dut1_name}
356
357 | Set BGP Suite Variables
358 | | Configure path in 3-node circular topology
359 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
360 | | Set Suite Variable | ${interface}
361 | | Set Suite Variable | ${tg_node}
362 | | Set Suite Variable | ${dut1_node}
363 | | Set Suite Variable | ${dut2_node}
364 | | Set Suite Variable | ${dut1_to_tg}
365 | | Set Suite Variable | ${dut1_to_tg_name}
366 | | Set Suite Variable | ${tg_to_dut1_name}
367 | | Set Suite Variable | ${dut1_to_dut2_name}
368 | | Set Suite Variable | ${dut2_to_dut1_name}