50fd656346da267229f5f7a639b22c275f04be93
[csit.git] / tests / honeycomb / func / mgmt-cfg-intip4-intip6-apihc-apivat-func.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 *** Variables ***
15 # Interface to run tests on.
16 | ${interface}= | ${node['interfaces']['port1']['name']}
17 | ${interface2}= | ${node['interfaces']['port3']['name']}
18
19 *** Settings ***
20 | Resource | resources/libraries/robot/shared/default.robot
21 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
22 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
23 | Resource | resources/libraries/robot/honeycomb/fib.robot
24 | Resource | resources/libraries/robot/shared/testing_path.robot
25 | Resource | resources/libraries/robot/ip/ip6.robot
26 | Variables | resources/test_data/honeycomb/interface_ip.py
27 | ...
28 | Force Tags | HC_FUNC
29 | ...
30 | Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
31 | ...
32 | Suite Teardown | Tear Down Honeycomb Functional Test Suite | ${node}
33 | ...
34 | Documentation | *Honeycomb interface management test suite.*
35
36 *** Test Cases ***
37 | TC01: Honeycomb configures and reads interface state
38 | | [Documentation] | Check if Honeycomb API can modify the admin state of\
39 | | ... | VPP interfaces.
40 | | ...
41 | | Given Interface state from Honeycomb should be
42 | | ... | ${node} | ${interface} | down
43 | | And Interface state from VAT should be | ${node} | ${interface} | down
44 | | When Honeycomb configures interface state | ${node} | ${interface} | up
45 | | Then Interface state from Honeycomb should be
46 | | ... | ${node} | ${interface} | up
47 | | And Interface state from VAT should be | ${node} | ${interface} | up
48 | | When Honeycomb configures interface state | ${node} | ${interface} | down
49 | | Then Interface state from Honeycomb should be
50 | | ... | ${node} | ${interface} | down
51 | | And Interface state from VAT should be | ${node} | ${interface} | down
52
53 | TC02: Honeycomb modifies interface IPv4 address with netmask
54 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\
55 | | ... | with address and netmask provided.
56 | | ...
57 | | Given IPv4 address from Honeycomb should be empty | ${node} | ${interface}
58 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
59 | | When Honeycomb sets interface IPv4 address | ${node} | ${interface}
60 | | ... | ${ipv4_address} | ${ipv4_mask}
61 | | Then IPv4 address from Honeycomb should be
62 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
63 | | And IPv4 address from VAT should be
64 | | ... | ${node} | ${interface} | ${ipv4_address}
65 | | ... | ${ipv4_prefix} | ${ipv4_mask}
66
67 | TC03: Honeycomb removes IPv4 address from interface
68 | | [Documentation] | Check if Honeycomb API can remove configured ipv4\
69 | | ... | addresses from interface.
70 | | ...
71 | | Given IPv4 address from Honeycomb should be
72 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
73 | | And IPv4 address from VAT should be
74 | | ... | ${node} | ${interface} | ${ipv4_address}
75 | | ... | ${ipv4_prefix} | ${ipv4_mask}
76 | | When Honeycomb removes interface IPv4 addresses | ${node} | ${interface}
77 | | Then IPv4 address from Honeycomb should be empty | ${node} | ${interface}
78 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
79
80 | TC04: Honeycomb modifies interface IPv4 address with prefix
81 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\
82 | | ... | with address and prefix provided.
83 | | ...
84 | | [Teardown] | Honeycomb removes interface IPv4 addresses | ${node}
85 | | ... | ${interface}
86 | | ...
87 | | Given IPv4 address from Honeycomb should be empty | ${node} | ${interface}
88 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
89 | | When Honeycomb sets interface IPv4 address with prefix
90 | | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix}
91 | | Then IPv4 address from Honeycomb should be
92 | | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix}
93 | | And IPv4 address from VAT should be
94 | | ... | ${node} | ${interface} | ${ipv4_address2}
95 | | ... | ${ipv4_prefix} | ${ipv4_mask}
96
97 | TC05: Honeycomb modifies IPv4 neighbor table
98 | | [Documentation] | Check if Honeycomb API can add and remove ARP entries.
99 | | ...
100 | | [Teardown] | Honeycomb clears all interface IPv4 neighbors
101 | | ... | ${node} | ${interface}
102 | | ...
103 | | Given IPv4 neighbor from Honeycomb should be empty
104 | | ... | ${node} | ${interface}
105 | | When Honeycomb adds interface IPv4 neighbor
106 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
107 | | Then IPv4 neighbor from Honeycomb should be
108 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
109
110 | TC06: Honeycomb modifies interface configuration - IPv6
111 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv6.
112 | | ...
113 | | [Teardown] | Honeycomb removes interface IPv6 addresses | ${node}
114 | | ... | ${interface}
115 | | ...
116 | | Given IPv6 address from Honeycomb should be empty
117 | | ... | ${node} | ${interface}
118 | | And IPv6 address from VAT should be empty
119 | | ... | ${node} | ${interface}
120 | | When Honeycomb sets interface IPv6 address
121 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
122 | | Then IPv6 address from Honeycomb should contain
123 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
124 | | And IPv6 address from VAT should contain
125 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
126
127 | TC07: Honeycomb modifies IPv6 neighbor table
128 | | [Documentation] | Check if Honeycomb API can add and remove ARP entries.
129 | | ...
130 | | [Teardown] | Honeycomb clears all interface IPv6 neighbors
131 | | ... | ${node} | ${interface}
132 | | ...
133 | | Given IPv6 neighbor from Honeycomb should be empty
134 | | ... | ${node} | ${interface}
135 | | When Honeycomb adds interface IPv6 neighbor
136 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
137 | | Then IPv6 neighbor from Honeycomb should be
138 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
139
140 | TC08: Honeycomb modifies interface configuration - MTU
141 | | [Documentation] | Check if Honeycomb API can configure interface\
142 | | ... | MTU value.
143 | | ...
144 | | When Honeycomb sets interface ethernet configuration
145 | | ... | ${node} | ${interface} | ${ethernet}
146 | | Then Interface ethernet Operational Data From Honeycomb Should Be
147 | | ... | ${node} | ${interface} | ${ethernet}
148 | | And Interface ethernet Operational Data From VAT Should Be
149 | | ... | ${node} | ${interface} | ${ethernet['mtu']}
150
151 | TC09: Honeycomb modifies interface configuration - vrf
152 | | [Documentation] | Check if Honeycomb API can configure interface\
153 | | ... | vrf ID.
154 | | ...
155 | | [Teardown] | Honeycomb interface VRF Test Teardown | ${node} | ${interface}
156 | | ...
157 | | Honeycomb configures FIB table | ${node} | ipv4 | ${1}
158 | | When Honeycomb sets interface VRF ID
159 | | ... | ${node} | ${interface} | ${1} | ipv4
160 | | Then Interface VRF ID from Honeycomb should be
161 | | ... | ${node} | ${interface} | ${1} | ipv4
162 | | And Interface VRF ID from VAT should be
163 | | ... | ${node} | ${interface} | ${1}
164
165 | TC10: Honeycomb can configure multiple IP addresses on one interface
166 | | [Documentation] | [Top] TG=DUT1=TG.
167 | | ... | [Enc] Eth-IPv4-ICMP; Eth-IPv6-ICMPv6
168 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set two IPv4 addresses\
169 | | ... | and two IPv6 addresses on first interfaces to TG and add ARP entries\
170 | | ... | for each address.
171 | | ... | [Ver] Send ICMP packets from TG to DUT, using different sets\
172 | | ... | of source and destination IP addresses. Receive an ICMP reply\
173 | | ... | for every packet sent.
174 | | ...
175 | | [Teardown] | Multiple IP Address Test Teardown | ${node} | ${dut_to_tg_if1}
176 | | Given Configure path in 2-node circular topology
177 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
178 | | When Honeycomb sets interface IPv4 address with prefix
179 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv4_address} | ${ipv4_prefix}
180 | | And Honeycomb adds interface IPv4 address
181 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv4_address2} | ${ipv4_prefix}
182 | | And Honeycomb sets interface IPv6 address
183 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv6_address} | ${ipv6_prefix}
184 | | And Honeycomb adds interface IPv6 address
185 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv6_address2} | ${ipv6_prefix}
186 | | Then IPv4 address from Honeycomb should be
187 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv4_address} | ${ipv4_prefix}
188 | | And IPv4 address from VAT should be
189 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv4_address}
190 | | ... | ${ipv4_prefix} | ${ipv4_mask}
191 | | And IPv6 address from Honeycomb should contain
192 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv6_address} | ${ipv6_prefix}
193 | | And IPv6 address from VAT should contain
194 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${ipv6_address} | ${ipv6_prefix}
195 | | And Honeycomb configures interface state
196 | | ... | ${dut_node} | ${dut_to_tg_if1} | up
197 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
198 | | ... | ${ipv4_neighbor} | ${neighbor_mac}
199 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
200 | | ... | ${ipv4_neighbor2} | ${neighbor_mac2}
201 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
202 | | ... | ${ipv6_neighbor} | ${neighbor_mac}
203 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
204 | | ... | ${ipv6_neighbor2} | ${neighbor_mac2}
205 | | And Suppress ICMPv6 router advertisement message | ${nodes}
206 | | Then Ping and Verify IP address | ${nodes['TG']}
207 | | ... | ${ipv4_neighbor} | ${ipv4_address}
208 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
209 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac}
210 | | And Ping and Verify IP address | ${nodes['TG']}
211 | | ... | ${ipv4_neighbor2} | ${ipv4_address2}
212 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
213 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac}
214 | | And Ping and Verify IP address | ${nodes['TG']}
215 | | ... | ${ipv6_neighbor} | ${ipv6_address}
216 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
217 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac}
218 | | And Ping and Verify IP address | ${nodes['TG']}
219 | | ... | ${ipv6_neighbor2} | ${ipv6_address2}
220 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
221 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac}
222
223 | TC11: Honeycomb fails to configure two IPv4 addresses from the same subnet
224 | | [Documentation] | Check if Honeycomb can configure two IPv4 addresses in\
225 | | ... | the same subnet onto a single interface. It should not be possible.
226 | | ...
227 | | [Teardown] | Honeycomb removes interface IPv4 addresses | ${node}
228 | | ... | ${interface}
229 | | ...
230 | | When Honeycomb sets interface IPv4 address with prefix
231 | | ... | ${node} | ${interface} | 192.168.0.1 | ${9}
232 | | Then Honeycomb fails to add interface IPv4 address
233 | | ... | ${node} | ${interface} | 192.168.0.2 | ${9}
234 | | And Honeycomb fails to add interface IPv4 address
235 | | ... | ${node} | ${interface} | 192.232.0.2 | ${9}
236
237 | TC12: Honeycomb fails to configure two IPv6 addresses from the same subnet
238 | | [Documentation] | Check if Honeycomb can configure two IPv6 addresses in\
239 | | ... | the same subnet onto a single interface. It should not be possible.
240 | | ...
241 | | [Teardown] | Honeycomb removes interface IPv6 addresses | ${node}
242 | | ... | ${interface}
243 | | When Honeycomb sets interface IPv6 address
244 | | ... | ${node} | ${interface} | 10::FF10 | ${64}
245 | | Then Honeycomb fails to add interface IPv6 address
246 | | ... | ${node} | ${interface} | 10::FF11 | ${64}
247 | | And Honeycomb fails to add interface IPv6 address
248 | | ... | ${node} | ${interface} | 10::FFFF | ${64}
249
250 | TC13: Honeycomb can configure unnumbered interface
251 | | [Documentation] | Check if Honeycomb can configure an unnumbered interface\
252 | | ... | on a physical interface, borrowing the IP address of another physical\
253 | | ... | interface.
254 | | ...
255 # CSIT-1210: Adapt HC unnumbered interface tests to VPP 18.07 api changes
256 | | [Tags] | EXPECTED_FAILING
257 | | ...
258 | | Given Honeycomb sets interface IPv4 address | ${node}
259 | | ... | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
260 | | When Honeycomb adds unnumbered configuration to interface
261 | | ... | ${node} | ${interface} | ${interface2}
262 | | Then Wait until Keyword succeeds | 10s | 2s
263 | | ... | IPv4 address from Honeycomb should be
264 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
265 | | And IPv4 address from VAT should be
266 | | ... | ${node} | ${interface2} | ${ipv4_address}
267 | | ... | ${ipv4_prefix} | ${ipv4_mask}
268 | | And IPv4 address from Honeycomb should be
269 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
270 | | And IPv4 address from VAT should be
271 | | ... | ${node} | ${interface} | ${ipv4_address}
272 | | ... | ${ipv4_prefix} | ${ipv4_mask}
273
274 | TC14: Honeycomb removes interface unnumbered configuration
275 | | [Documentation] | Check if Honeycomb can remove unnumbered configuration\
276 | | ... | from an interface.
277 | | ...
278 # CSIT-1210: Adapt HC unnumbered interface tests to VPP 18.07 api changes
279 | | [Tags] | EXPECTED_FAILING
280 | | ...
281 | | Given IPv4 address from Honeycomb should be
282 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
283 | | And IPv4 address from VAT should be
284 | | ... | ${node} | ${interface2} | ${ipv4_address}
285 | | ... | ${ipv4_prefix} | ${ipv4_mask}
286 | | And IPv4 address from Honeycomb should be
287 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
288 | | And IPv4 address from VAT should be
289 | | ... | ${node} | ${interface} | ${ipv4_address}
290 | | ... | ${ipv4_prefix} | ${ipv4_mask}
291 | | When Honeycomb removes unnumbered configuration from interface
292 | | ... | ${node} | ${interface}
293 | | Then Wait until Keyword succeeds | 10s | 2s
294 | | ... | IPv4 address from Honeycomb should be
295 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
296 | | And IPv4 address from VAT should be
297 | | ... | ${node} | ${interface2} | ${ipv4_address}
298 | | ... | ${ipv4_prefix} | ${ipv4_mask}
299 | | And IPv4 address from Honeycomb should be empty | ${node} | ${interface}
300 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
301
302 *** Keywords ***
303 | Multiple IP Address Test Teardown
304 | | [Arguments] | ${node} | ${interface}
305 | | Honeycomb removes interface IPv4 addresses | ${node} | ${interface}
306 | | Honeycomb removes interface IPv6 addresses | ${node} | ${interface}
307 | | Honeycomb clears all interface IPv4 neighbors | ${node} | ${interface}
308 | | Honeycomb clears all interface IPv6 neighbors | ${node} | ${interface}
309
310 | Honeycomb interface VRF Test Teardown
311 | | [Arguments] | ${node} | ${interface}
312 | | Honeycomb sets interface VRF ID | ${node} | ${interface} | ${0} | ipv4
313 | | Honeycomb removes FIB configuration | ${node} | ipv4 | ${1}