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