c8f072b8cd87683c121926860734e45993d616c7
[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/shared/testing_path.robot
24 | Resource | resources/libraries/robot/ip/ip6.robot
25 | Variables | resources/test_data/honeycomb/interface_ip.py
26 | ...
27 | Force Tags | HC_FUNC
28 | ...
29 | Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
30 | ...
31 | Suite Teardown | Tear Down Honeycomb Functional Test Suite | ${node}
32 | ...
33 | Documentation | *Honeycomb interface management test suite.*
34
35 *** Test Cases ***
36 | TC01: Honeycomb configures and reads interface state
37 | | [Documentation] | Check if Honeycomb API can modify the admin state of\
38 | | ... | VPP interfaces.
39 | | ...
40 | | Given Interface state from Honeycomb should be
41 | | ... | ${node} | ${interface} | down
42 | | And Interface state from VAT should be | ${node} | ${interface} | down
43 | | When Honeycomb configures interface state | ${node} | ${interface} | up
44 | | Then Interface state from Honeycomb should be
45 | | ... | ${node} | ${interface} | up
46 | | And Interface state from VAT should be | ${node} | ${interface} | up
47 | | When Honeycomb configures interface state | ${node} | ${interface} | down
48 | | Then Interface state from Honeycomb should be
49 | | ... | ${node} | ${interface} | down
50 | | And Interface state from VAT should be | ${node} | ${interface} | down
51
52 | TC02: Honeycomb modifies interface IPv4 address with netmask
53 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\
54 | | ... | with address and netmask provided.
55 | | ...
56 | | Given IPv4 address from Honeycomb should be empty | ${node} | ${interface}
57 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
58 | | When Honeycomb sets interface IPv4 address | ${node} | ${interface}
59 | | ... | ${ipv4_address} | ${ipv4_mask}
60 | | Then IPv4 address from Honeycomb should be
61 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
62 | | And IPv4 address from VAT should be
63 | | ... | ${node} | ${interface} | ${ipv4_address}
64 | | ... | ${ipv4_prefix} | ${ipv4_mask}
65
66 | TC03: Honeycomb removes IPv4 address from interface
67 | | [Documentation] | Check if Honeycomb API can remove configured ipv4\
68 | | ... | addresses from interface.
69 | | ...
70 | | Given IPv4 address from Honeycomb should be
71 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
72 | | And IPv4 address from VAT should be
73 | | ... | ${node} | ${interface} | ${ipv4_address}
74 | | ... | ${ipv4_prefix} | ${ipv4_mask}
75 | | When Honeycomb removes interface IPv4 addresses | ${node} | ${interface}
76 | | Then IPv4 address from Honeycomb should be empty | ${node} | ${interface}
77 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
78
79 | TC04: Honeycomb modifies interface IPv4 address with prefix
80 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\
81 | | ... | with address and prefix provided.
82 | | ...
83 | | [Teardown] | Honeycomb removes interface IPv4 addresses | ${node}
84 | | ... | ${interface}
85 | | ...
86 | | Given IPv4 address from Honeycomb should be empty | ${node} | ${interface}
87 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
88 | | When Honeycomb sets interface IPv4 address with prefix
89 | | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix}
90 | | Then IPv4 address from Honeycomb should be
91 | | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix}
92 | | And IPv4 address from VAT should be
93 | | ... | ${node} | ${interface} | ${ipv4_address2}
94 | | ... | ${ipv4_prefix} | ${ipv4_mask}
95
96 | TC05: Honeycomb modifies IPv4 neighbor table
97 | | [Documentation] | Check if Honeycomb API can add and remove ARP entries.
98 | | ...
99 | | [Teardown] | Honeycomb clears all interface IPv4 neighbors
100 | | ... | ${node} | ${interface}
101 | | ...
102 | | Given IPv4 neighbor from Honeycomb should be empty
103 | | ... | ${node} | ${interface}
104 | | When Honeycomb adds interface IPv4 neighbor
105 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
106 | | Then IPv4 neighbor from Honeycomb should be
107 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
108
109 | TC06: Honeycomb modifies interface configuration - IPv6
110 | | [Documentation] | Check if Honeycomb API can configure interfaces for ipv6.
111 | | ...
112 | | [Teardown] | Honeycomb removes interface IPv6 addresses | ${node}
113 | | ... | ${interface}
114 | | ...
115 | | Given IPv6 address from Honeycomb should be empty
116 | | ... | ${node} | ${interface}
117 | | And IPv6 address from VAT should be empty
118 | | ... | ${node} | ${interface}
119 | | When Honeycomb sets interface IPv6 address
120 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
121 | | Then IPv6 address from Honeycomb should contain
122 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
123 | | And IPv6 address from VAT should contain
124 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
125
126 | TC07: Honeycomb modifies IPv6 neighbor table
127 | | [Documentation] | Check if Honeycomb API can add and remove ARP entries.
128 | | ...
129 | | [Teardown] | Honeycomb clears all interface IPv6 neighbors
130 | | ... | ${node} | ${interface}
131 | | ...
132 | | Given IPv6 neighbor from Honeycomb should be empty
133 | | ... | ${node} | ${interface}
134 | | When Honeycomb adds interface IPv6 neighbor
135 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
136 | | Then IPv6 neighbor from Honeycomb should be
137 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
138
139 | TC08: Honeycomb modifies interface configuration - MTU
140 | | [Documentation] | Check if Honeycomb API can configure interface\
141 | | ... | MTU value.
142 | | ...
143 | | When Honeycomb sets interface ethernet configuration
144 | | ... | ${node} | ${interface} | ${ethernet}
145 | | Then Interface ethernet Operational Data From Honeycomb Should Be
146 | | ... | ${node} | ${interface} | ${ethernet}
147 | | And Interface ethernet Operational Data From VAT Should Be
148 | | ... | ${node} | ${interface} | ${ethernet['mtu']}
149
150 | TC09: Honeycomb modifies interface configuration - vrf
151 | | [Documentation] | Check if Honeycomb API can configure interface\
152 | | ... | vrf ID.
153 | | ...
154 # HC2VPP-331: Honeycomb fails to assign VRF to interface
155 | | [Tags] | EXPECTED_FAILING
156 | | ...
157 | | [Teardown] | Honeycomb sets interface VRF ID
158 | | ... | ${node} | ${interface} | ${0} | ipv4
159 | | ...
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} | ${dut_to_tg_if1} | ${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} | ${dut_to_tg_if1} | ${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 can configure unnumbered interface
226 | | [Documentation] | Check if Honeycomb can configure an unnumbered interface\
227 | | ... | on a physical interface, borrowing the IP address of another physical\
228 | | ... | interface.
229 | | ...
230 # HC2VPP-330: Honeycomb fails to configure interface as unnumbered
231 | | [Tags] | EXPECTED_FAILING
232 | | ...
233 | | Given Honeycomb sets interface IPv4 address | ${node}
234 | | ... | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
235 | | When Honeycomb adds unnumbered configuration to interface
236 | | ... | ${node} | ${interface} | ${interface2}
237 | | Then Wait until Keyword succeeds | 10s | 2s
238 | | ... | IPv4 address from Honeycomb should be
239 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
240 | | And IPv4 address from VAT should be
241 | | ... | ${node} | ${interface2} | ${ipv4_address}
242 | | ... | ${ipv4_prefix} | ${ipv4_mask}
243 | | And IPv4 address from Honeycomb should be
244 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
245 | | And IPv4 address from VAT should be
246 | | ... | ${node} | ${interface} | ${ipv4_address}
247 | | ... | ${ipv4_prefix} | ${ipv4_mask}
248
249 | TC12: Honeycomb removes interface unnumbered configuration
250 | | [Documentation] | Check if Honeycomb can remove unnumbered configuration\
251 | | ... | from an interface.
252 | | ...
253 # HC2VPP-330: Honeycomb fails to configure interface as unnumbered
254 | | [Tags] | EXPECTED_FAILING
255 | | ...
256 | | Given IPv4 address from Honeycomb should be
257 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
258 | | And IPv4 address from VAT should be
259 | | ... | ${node} | ${interface2} | ${ipv4_address}
260 | | ... | ${ipv4_prefix} | ${ipv4_mask}
261 | | And IPv4 address from Honeycomb should be
262 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
263 | | And IPv4 address from VAT should be
264 | | ... | ${node} | ${interface} | ${ipv4_address}
265 | | ... | ${ipv4_prefix} | ${ipv4_mask}
266 | | When Honeycomb removes unnumbered configuration from interface
267 | | ... | ${node} | ${interface}
268 | | Then Wait until Keyword succeeds | 10s | 2s
269 | | ... | IPv4 address from Honeycomb should be
270 | | ... | ${node} | ${interface2} | ${ipv4_address} | ${ipv4_prefix}
271 | | And IPv4 address from VAT should be
272 | | ... | ${node} | ${interface2} | ${ipv4_address}
273 | | ... | ${ipv4_prefix} | ${ipv4_mask}
274 | | And IPv4 address from Honeycomb should be empty | ${node} | ${interface}
275 | | And ipv4 address from VAT should be empty | ${node} | ${interface}
276
277 | TC13: Honeycomb fails to configure two IPv4 addresses from the same subnet
278 | | [Documentation] | Check if Honeycomb can configure two IPv4 addresses in\
279 | | ... | the same subnet onto a single interface. It should not be possible.
280 | | ...
281 | | [Teardown] | Honeycomb removes interface IPv4 addresses | ${node}
282 | | ... | ${interface}
283 | | ...
284 | | [Tags] | EXPECTED_FAILING
285 | | ...
286 # VPP API does not configure the second address, but returns success. VPP-649
287 | | When Honeycomb sets interface IPv4 address with prefix
288 | | ... | ${node} | ${interface} | 192.168.0.1 | ${9}
289 | | Then Honeycomb fails to add interface IPv4 address
290 | | ... | ${node} | ${interface} | 192.168.0.2 | ${9}
291 | | And Honeycomb fails to add interface IPv4 address
292 | | ... | ${node} | ${interface} | 192.232.0.2 | ${9}
293
294 | TC14: Honeycomb fails to configure two IPv6 addresses from the same subnet
295 | | [Documentation] | Check if Honeycomb can configure two IPv6 addresses in\
296 | | ... | the same subnet onto a single interface. It should not be possible.
297 | | ...
298 | | [Tags] | EXPECTED_FAILING
299 | | ...
300 # VPP API does not configure the second address, but returns success. VPP-649
301 | | [Teardown] | Honeycomb removes interface IPv6 addresses | ${node}
302 | | ... | ${interface}
303 | | When Honeycomb sets interface IPv6 address
304 | | ... | ${node} | ${interface} | 10::FF10 | ${64}
305 | | Then Honeycomb fails to add interface IPv6 address
306 | | ... | ${node} | ${interface} | 10::FF11 | ${64}
307 | | And Honeycomb fails to add interface IPv6 address
308 | | ... | ${node} | ${interface} | 10::FFFF | ${64}
309
310 *** Keywords ***
311 | Multiple IP Address Test Teardown
312 | | [Arguments] | ${node} | ${interface}
313 | | Honeycomb removes interface IPv4 addresses | ${node} | ${interface}
314 | | Honeycomb removes interface IPv6 addresses | ${node} | ${interface}
315 | | Honeycomb clears all interface IPv4 neighbors | ${node} | ${interface}
316 | | Honeycomb clears all interface IPv6 neighbors | ${node} | ${interface}