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