HC Test: reenable TC12 from BGP suite
[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 | | Given Peer operational data from Honeycomb should be
234 | | ... | ${dut1_node} | ${dut2_to_dut1_ip}
235 | | And Peer operational data from Honeycomb should be
236 | | ... | ${dut2_node} | ${dut1_to_dut2_ip}
237 | | When Honeycomb adds BGP peer
238 | | ... | ${dut2_node} | ${address_application} | ${peer_application}
239 | | And Honeycomb configures BGP route
240 | | ... | ${dut2_node} | ${address_application} | ${dut1_route}
241 | | ... | ${dut1_route_address} | ${dut1_route_id} | ipv4
242 | | And Sleep | 5s | Wait for route advertisement. Retry timer is 5 seconds.
243 | | Then Routing data from Honeycomb should contain
244 | | ... | ${dut1_node} | learned-protocol-0 | ipv4 | ${route_operational}
245 | | And Routing data from Honeycomb should contain
246 | | ... | ${dut2_node} | learned-protocol-0 | ipv4 | ${route_operational}
247 | | And BGP Loc-RIB table should include | ${dut1_node} | ${rib_operational}
248 | | And BGP Loc-RIB table should include | ${dut2_node} | ${rib_operational}
249
250 | TC13: Honeycomb sends IPv6 BGP route to connected peer
251 | | [Documentation]
252 | | ... | [top] TG-DUT1-DUT2-TG.
253 | | ... | [enc] Eth-IPv4-TCP-BGP.
254 | | ... | [cfg] On DUT1 and DUT2 give Honeycomb control over the data-plane
255 | | ... | interfaces connecting DUT1 ad DUT2. Configure BGP peers on DUT1
256 | | ... | and DUT2 with each other's IP address. On DUT2 configure a static
257 | | ... | IPv6 route using Honeycomb's BGP module.
258 | | ... | [ver] Verify that the route is present in BGP
259 | | ... | local RIB and VPP's routing table on each DUT.
260 | | ...
261 # HONEYCOMB-403: Missing writers for IPv6 BGP route
262 | | [Tags] | EXPECTED_FAILING
263 | | Given Peer operational data from Honeycomb should be
264 | | ... | ${dut1_node} | ${dut2_to_dut1_ip}
265 | | And Peer operational data from Honeycomb should be
266 | | ... | ${dut2_node} | ${dut1_to_dut2_ip}
267 | | And Honeycomb adds BGP peer
268 | | ... | ${dut2_node} | ${address_application} | ${peer_application}
269 | | And Honeycomb configures BGP route
270 | | ... | ${dut2_node} | ${address_application} | ${dut1_route_ip6}
271 | | ... | ${dut1_route_ip6_address} | ${dut1_route_ip6_id} | ipv6
272 | | And Sleep | 5s | Wait for route advertisement. Retry timer is 5 seconds.
273 | | Then Routing data from Honeycomb should contain
274 | | ... | ${dut1_node} | learned-protocol-0 | ipv6 | ${route_ip6_operational}
275 | | And Routing data from Honeycomb should contain
276 | | ... | ${dut2_node} | learned-protocol-0 | ipv6 | ${route_ip6_operational}
277 | | And BGP Loc-RIB table should include | ${dut1_node} | ${rib_ip6_operational}
278 | | And BGP Loc-RIB table should include | ${dut2_node} | ${rib_ip6_operational}
279
280 #TODO: Add tests once implemented in HC:
281 # IPv6 neighbor, L2VPN, L3VPN, linkstate, route reflector, and more
282
283 *** Keywords ***
284 | Configure IPv4 Management Interface
285 | | [Documentation] | Change one of VPP's data-plane interfaces on DUT into\
286 | | ... | a control-plane interface that Honeycomb can listen on. Setup IP\
287 | | ... | addresses on the link, create suite variables for traffic trests, set
288 | | ... | static ARP entries, then restart VPP and Honeycomb to apply changes.
289 | | ...
290 | | Configure path in 3-node circular topology
291 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
292 | | ${interface}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
293 | | Set Suite Variable | ${interface}
294 | | Set Suite Variable | ${tg_node}
295 | | Set Suite Variable | ${dut1_node}
296 | | Set Suite Variable | ${dut2_node}
297 | | Set Suite Variable | ${dut1_to_tg}
298 | | Stop VPP service on DUT | ${dut1_node}
299 | | Stop VPP service on DUT | ${dut2_node}
300 | | Stop Honeycomb Service on DUTs | ${dut1_node}
301 | | Stop Honeycomb Service on DUTs | ${dut2_node}
302 | | Convert data-plane interface to control-plane
303 | | ... | ${dut1_node} | ${dut1_to_tg}
304 | | Convert data-plane interface to control-plane
305 | | ... | ${dut1_node} | ${dut1_to_dut2}
306 | | Convert data-plane interface to control-plane
307 | | ... | ${dut2_node} | ${dut2_to_dut1}
308 | | Sleep | 5sec | Wait until OS reclaims the interfaces.
309 | | ${tg_to_dut1_name}= | Get Interface Name by MAC
310 | | ... | ${tg_node} | ${tg_to_dut1_mac}
311 | | ${dut1_to_tg_name}= | Get Interface Name by MAC
312 | | ... | ${dut1_node} | ${dut1_to_tg_mac}
313 | | ${dut1_to_dut2_name}= | Get Interface Name by MAC
314 | | ... | ${dut1_node} | ${dut1_to_dut2_mac}
315 | | ${dut2_to_dut1_name}= | Get Interface Name by MAC
316 | | ... | ${dut2_node} | ${dut2_to_dut1_mac}
317 | | Set Suite Variable | ${dut1_to_tg_name}
318 | | Set Suite Variable | ${tg_to_dut1_name}
319 | | Set Suite Variable | ${dut1_to_dut2_name}
320 | | Set Suite Variable | ${dut2_to_dut1_name}
321 | | Set management interface address
322 | | ... | ${tg_node} | ${tg_to_dut1_name}
323 | | ... | ${tg_to_dut1_ip} | ${prefix}
324 | | Set management interface address
325 | | ... | ${dut1_node} | ${dut1_to_tg_name}
326 | | ... | ${dut1_to_tg_ip} | ${prefix}
327 | | Set management interface address
328 | | ... | ${dut1_node} | ${dut1_to_dut2_name}
329 | | ... | ${dut1_to_dut2_ip} | ${prefix}
330 | | Set management interface address
331 | | ... | ${dut2_node} | ${dut2_to_dut1_name}
332 | | ... | ${dut2_to_dut1_ip} | ${prefix}
333 | | Set Static ARP | ${tg_node} | ${dut1_to_tg_ip} | ${dut1_to_tg_mac}
334 | | Set Static ARP | ${dut1_node} | ${tg_to_dut1_ip} | ${tg_to_dut1_mac}
335 | | Set Static ARP | ${dut1_node} | ${dut2_to_dut1_ip} | ${dut2_to_dut1_mac}
336 | | Set Static ARP | ${dut2_node} | ${dut1_to_dut2_ip} | ${dut1_to_dut2_mac}
337 | | Enable Honeycomb Feature | ${dut2_node} | BGP
338 | | Configure BGP Module | ${dut1_node} | ${dut1_to_dut2_ip}
339 | | ... | ${bgp_port} | ${bgp_as_number}
340 | | Configure BGP Module | ${dut2_node} | ${dut2_to_dut1_ip}
341 | | ... | ${bgp_port} | ${bgp_as_number}
342 | | Start VPP service on DUT | ${dut1_node}
343 | | Start VPP service on DUT | ${dut2_node}
344 | | Configure Honeycomb service on DUTs | ${dut1_node}
345 | | Set Up Honeycomb Functional Test Suite | ${dut2_node}
346
347 | Unconfigure IPv4 Management Interfaces
348 | | [Documentation] | Remove all IP addresses from the interface.
349 | | ...
350 | | Clear Interface Configuration | ${tg_node} | ${tg_to_dut1_name}
351 | | Clear Interface Configuration | ${dut1_node} | ${dut1_to_tg_name}
352 | | Clear Interface Configuration | ${dut1_node} | ${dut1_to_dut2_name}
353 | | Clear Interface Configuration | ${dut2_node} | ${dut2_to_dut1_name}
354
355 | Set BGP Suite Variables
356 | | Configure path in 3-node circular topology
357 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
358 | | Set Suite Variable | ${interface}
359 | | Set Suite Variable | ${tg_node}
360 | | Set Suite Variable | ${dut1_node}
361 | | Set Suite Variable | ${dut2_node}
362 | | Set Suite Variable | ${dut1_to_tg}
363 | | Set Suite Variable | ${dut1_to_tg_name}
364 | | Set Suite Variable | ${tg_to_dut1_name}
365 | | Set Suite Variable | ${dut1_to_dut2_name}
366 | | Set Suite Variable | ${dut2_to_dut1_name}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.