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