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