e7fe2eb94e49f506887f64eb1457ac0e9d75e5d3
[csit.git] / tests / func / honeycomb / mgmt-cfg-spanrx-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 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/honeycomb/port_mirroring.robot
17 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
18 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
19 | Resource | resources/libraries/robot/honeycomb/sub_interface.robot
20 | Resource | resources/libraries/robot/testing_path.robot
21 | Resource | resources/libraries/robot/telemetry/span.robot
22 | Variables | resources/test_data/honeycomb/span.py
23 | ... | ${node['interfaces']['port1']['name']}
24 | ... | ${node['interfaces']['port3']['name']}
25 | ... | local0
26 | Variables | resources/test_data/honeycomb/sub_interfaces.py
27 | ...
28 | Force Tags | HC_FUNC
29 | ...
30 | Suite Setup | Add Interface local0 To Topology | ${node}
31 | ...
32 | Suite Teardown | Restart Honeycomb and VPP | ${node}
33 | ...
34 | Documentation | *Honeycomb port mirroring test suite.*
35
36 *** Test Cases ***
37 | TC01: Honeycomb can configure SPAN on an interface - receive
38 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
39 | | ... | against VPP SPAN dump in state receive.
40 | | ...
41 | | When Honeycomb configures SPAN on interface
42 | | ... | ${node} | ${interface1} | ${settings_receive}
43 | | Then Interface SPAN Operational Data from Honeycomb should be
44 | | ... | ${node} | ${interface1} | ${settings_receive}
45
46 | TC02: Honeycomb can configure SPAN on an interface - transmit
47 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
48 | | ... | against VPP SPAN dump in state transmit.
49 | | ...
50 | | When Honeycomb configures SPAN on interface
51 | | ... | ${node} | ${interface1} | ${settings_transmit}
52 | | Then Interface SPAN Operational Data from Honeycomb should be
53 | | ... | ${node} | ${interface1} | ${settings_transmit}
54
55 | TC03: Honeycomb can configure SPAN on an interface - both
56 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
57 | | ... | against VPP SPAN dump in state both.
58 | | ...
59 | | When Honeycomb configures SPAN on interface
60 | | ... | ${node} | ${interface1} | ${settings_both}
61 | | Then Interface SPAN Operational Data from Honeycomb should be
62 | | ... | ${node} | ${interface1} | ${settings_both}
63
64 | TC04: Honeycomb can configure SPAN on an interface with two source interfaces
65 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
66 | | ... | against VPP SPAN dump in state both.
67 | | ...
68 | | When Honeycomb configures SPAN on interface
69 | | ... | ${node} | ${interface1} | ${settings_both} | ${settings_if2}
70 | | Then Interface SPAN Operational Data from Honeycomb should be
71 | | ... | ${node} | ${interface1} | ${settings_both} | ${settings_if2}
72
73 | TC05: Honeycomb can disable SPAN on interface
74 | | [Documentation] | Honeycomb removes existing SPAN configuration
75 | | ... | from interface.
76 | | ...
77 | | Given Interface SPAN Operational Data from Honeycomb should be
78 | | ... | ${node} | ${interface1} | ${settings_both} | ${settings_if2}
79 | | When Honeycomb removes interface SPAN configuration
80 | | ... | ${node} | ${interface1}
81 | | Then Interface SPAN Operational Data from Honeycomb should be empty
82 | | ... | ${node} | ${interface1}
83
84 | TC06: Honeycomb can configure SPAN with two destination interfaces from the same source
85 | | [Documentation] | Honeycomb configures SPAN on two interfaces and verifies
86 | | ... | against VPP SPAN dump.
87 | | ...
88 | | [Teardown] | Run Keywords
89 | | ... | Honeycomb removes interface SPAN configuration
90 | | ... | ${node} | ${interface1} | AND
91 | | ... | Honeycomb removes interface SPAN configuration
92 | | ... | ${node} | ${interface2}
93 | | ...
94 | | When Honeycomb configures SPAN on interface
95 | | ... | ${node} | ${interface1} | ${settings_if2}
96 | | And Honeycomb configures SPAN on interface
97 | | ... | ${node} | ${interface2} | ${settings_if2}
98 | | Then Interface SPAN Operational Data from Honeycomb should be
99 | | ... | ${node} | ${interface1} | ${settings_if2}
100 | | Then Interface SPAN Operational Data from Honeycomb should be
101 | | ... | ${node} | ${interface2} | ${settings_if2}
102
103 | TC07: DUT mirrors IPv4 packets from one interface to another
104 | | [Documentation]
105 | | ... | [Top] TG=DUT1
106 | | ... | [Cfg] (using Honeycomb) On DUT1 configure IPv4 address and set SPAN\
107 | | ... | mirroring from one DUT interface to the other.
108 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
109 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
110 | | ... | on the second interface.
111 | | ...
112 | | [Teardown] | Run Keywords
113 | | ... | Show Packet Trace on All DUTs | ${nodes} | AND
114 | | ... | Honeycomb clears all interface IPv4 neighbors
115 | | ... | ${dut_node} | ${dut_to_tg_if1} | AND
116 | | ... | Honeycomb removes interface IPv4 addresses
117 | | ... | ${dut_node} | ${dut_to_tg_if1} | AND
118 | | ... | Honeycomb removes interface SPAN configuration
119 | | ... | ${node} | ${dut_to_tg_if2}
120 | | ...
121 | | Given Configure path in 2-node circular topology
122 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
123 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1}
124 | | ... | up
125 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2}
126 | | ... | up
127 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
128 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix}
129 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
130 | | ... | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_mac}
131 | | ${settings_5}= | create dictionary | state=both
132 | | ... | iface-ref=${dut_to_tg_if1}
133 | | And InterfaceCLI.All Vpp Interfaces Ready Wait | ${nodes}
134 | | When Honeycomb configures SPAN on interface
135 | | ... | ${node} | ${dut_to_tg_if2} | ${settings_5}
136 | | Then Send Packet And Check Received Copies | ${tg_node}
137 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
138 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2}
139 | | ... | ${tg_to_dut_if1_ip} | ${dut_to_tg_if1_ip} | ICMP
140
141 | TC08: Honeycomb can configure SPAN on a sub-interface - receive
142 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
143 | | ... | against VPP SPAN dump in state receive.
144 | | ...
145 | | Given Honeycomb creates sub-interface | ${node} | ${interface1}
146 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
147 | | When Honeycomb Configures SPAN on sub-interface
148 | | ... | ${node} | ${interface1} | ${1} | ${settings_receive}
149 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
150 | | ... | ${node} | ${interface1} | ${1} | ${settings_receive}
151
152 | TC09: Honeycomb can configure SPAN on a sub-interface - transmit
153 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
154 | | ... | against VPP SPAN dump in state transmit.
155 | | ...
156 | | Given Sub-interface state from Honeycomb should be
157 | | ... | ${node} | ${interface1} | ${1} | down | up
158 | | When Honeycomb Configures SPAN on sub-interface
159 | | ... | ${node} | ${interface1} | ${1} | ${settings_transmit}
160 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
161 | | ... | ${node} | ${interface1} | ${1} | ${settings_transmit}
162
163 | TC10: Honeycomb can configure SPAN on a sub-interface - both
164 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
165 | | ... | against VPP SPAN dump in state both.
166 | | ...
167 | | Given Sub-interface state from Honeycomb should be
168 | | ... | ${node} | ${interface1} | ${1} | down | up
169 | | When Honeycomb Configures SPAN on sub-interface
170 | | ... | ${node} | ${interface1} | ${1} | ${settings_both}
171 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
172 | | ... | ${node} | ${interface1} | ${1} | ${settings_both}
173
174 | TC11: Honeycomb can configure SPAN on a sub-interface with two source interfaces
175 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
176 | | ... | against VPP SPAN dump in state both.
177 | | ...
178 | | Given Sub-interface state from Honeycomb should be
179 | | ... | ${node} | ${interface1} | ${1} | down | up
180 | | When Honeycomb Configures SPAN on sub-interface
181 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
182 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
183 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
184
185 | TC12: Honeycomb can disable SPAN on interface
186 | | [Documentation] | Honeycomb removes existing SPAN configuration
187 | | ... | from sub-interface.
188 | | ...
189 | | Given Sub-interface state from Honeycomb should be
190 | | ... | ${node} | ${interface1} | ${1} | down | up
191 | | Given sub-Interface SPAN Operational Data from Honeycomb should be
192 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
193 | | When Honeycomb removes sub-interface SPAN configuration
194 | | ... | ${node} | ${interface1} | ${1}
195 | | Then sub-Interface SPAN Operational Data from Honeycomb should be empty
196 | | ... | ${node} | ${interface1} | ${1}
197
198 | TC13: Honeycomb can configure SPAN with two destination sub-interfaces from the same source
199 | | [Documentation] | Honeycomb configures SPAN on two sub-interfaces
200 | | ... | and verifies against VPP SPAN dump.
201 | | ...
202 | | [Teardown] | Run Keywords
203 | | ... | Honeycomb removes sub-interface SPAN configuration
204 | | ... | ${node} | ${interface1} | ${1} | AND
205 | | ... | Honeycomb removes sub-interface SPAN configuration
206 | | ... | ${node} | ${interface2} | ${1}
207 | | ...
208 | | Given Honeycomb creates sub-interface | ${node} | ${interface2}
209 | | ... | ${sub_if_2_match} | ${sub_if_2_tags} | ${sub_if_2_settings}
210 | | When Honeycomb Configures SPAN on sub-interface
211 | | ... | ${node} | ${interface1} | ${1} | ${settings_if2}
212 | | And Honeycomb Configures SPAN on sub-interface
213 | | ... | ${node} | ${interface2} | ${1} | ${settings_if2}
214 | | Then Sub-Interface SPAN Operational Data from Honeycomb should be
215 | | ... | ${node} | ${interface1} | ${1} | ${settings_if2}
216 | | Then Sub-Interface SPAN Operational Data from Honeycomb should be
217 | | ... | ${node} | ${interface2} | ${1} | ${settings_if2}
218
219 | TC14: DUT mirrors IPv4 packets from one interface to another
220 | | [Documentation]
221 | | ... | [Top] TG=DUT1
222 | | ... | [Cfg] (using Honeycomb) On DUT1 configure IPv4 address and set SPAN\
223 | | ... | mirroring from one DUT interface to a sub-interface on the other\
224 | | ... | interface.
225 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
226 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
227 | | ... | on the sub-interface.
228 | | ...
229 | | [Teardown] | Show Packet Trace on All DUTs | ${nodes}
230 | | ...
231 | | Given Configure path in 2-node circular topology
232 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
233 | | And Sub-interface state from Honeycomb should be
234 | | ... | ${dut_node} | ${interface1} | ${1} | down | up
235 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1}
236 | | ... | up
237 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2}
238 | | ... | up
239 | | And Honeycomb sets the sub-interface up
240 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${1}
241 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
242 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix}
243 | | And And Honeycomb adds interface IPv4 neighbor
244 | | ... | ${dut_node} | ${dut_to_tg_if2}
245 | | ... | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_mac}
246 | | ${settings_5}= | create dictionary | state=both
247 | | ... | iface-ref=${dut_to_tg_if2}
248 | | And InterfaceCLI.All Vpp Interfaces Ready Wait | ${nodes}
249 | | When Honeycomb Configures SPAN on sub-interface
250 | | ... | ${node} | ${dut_to_tg_if1} | ${1} | ${settings_5}
251 | | Then Send Packet And Check Received Copies | ${tg_node}
252 | | ... | ${tg_to_dut_if2} | ${tg_to_dut_if2_mac}
253 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1}
254 | | ... | ${tg_to_dut_if2_ip} | ${dut_to_tg_if2_ip} | ICMP