Improve test tag string parsing
[csit.git] / tests / honeycomb / func / 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/shared/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/shared/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 | | [Documentation]
107 | | ... | [Top] TG=DUT1
108 | | ... | [Cfg] (using Honeycomb) On DUT1 configure IPv4 address and set SPAN\
109 | | ... | mirroring from one DUT interface to the other.
110 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
111 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
112 | | ... | on the second interface.
113 | | ...
114 | | [Teardown] | Run Keywords
115 | | ... | Show Packet Trace on All DUTs | ${nodes} | AND
116 | | ... | Honeycomb clears all interface IPv4 neighbors
117 | | ... | ${dut_node} | ${dut_to_tg_if1} | AND
118 | | ... | Honeycomb removes interface IPv4 addresses
119 | | ... | ${dut_node} | ${dut_to_tg_if1} | AND
120 | | ... | Honeycomb removes interface SPAN configuration
121 | | ... | ${node} | ${dut_to_tg_if2}
122 | | ...
123 | | Given Configure path in 2-node circular topology
124 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
125 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1}
126 | | ... | up
127 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2}
128 | | ... | up
129 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
130 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix}
131 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
132 | | ... | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_mac}
133 | | ${settings_5}= | create dictionary | state=both
134 | | ... | iface-ref=${dut_to_tg_if1}
135 | | And All Vpp Interfaces Ready Wait | ${nodes}
136 | | When Honeycomb configures SPAN on interface
137 | | ... | ${node} | ${dut_to_tg_if2} | ${settings_5}
138 | | Then Send Packet And Check Received Copies | ${tg_node}
139 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
140 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2}
141 | | ... | ${tg_to_dut_if1_ip} | ${dut_to_tg_if1_ip} | ICMP
142
143 | TC08: Honeycomb can configure SPAN on a sub-interface - receive
144 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
145 | | ... | against VPP SPAN dump in state receive.
146 | | ...
147 | | Given Honeycomb creates sub-interface | ${node} | ${interface1}
148 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
149 | | When Honeycomb Configures SPAN on sub-interface
150 | | ... | ${node} | ${interface1} | ${1} | ${settings_receive}
151 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
152 | | ... | ${node} | ${interface1} | ${1} | ${settings_receive}
153
154 | TC09: Honeycomb can configure SPAN on a sub-interface - transmit
155 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
156 | | ... | against VPP SPAN dump in state transmit.
157 | | ...
158 | | Given Sub-interface state from Honeycomb should be
159 | | ... | ${node} | ${interface1} | ${1} | down | up
160 | | When Honeycomb Configures SPAN on sub-interface
161 | | ... | ${node} | ${interface1} | ${1} | ${settings_transmit}
162 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
163 | | ... | ${node} | ${interface1} | ${1} | ${settings_transmit}
164
165 | TC10: Honeycomb can configure SPAN on a sub-interface - both
166 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
167 | | ... | against VPP SPAN dump in state both.
168 | | ...
169 | | Given Sub-interface state from Honeycomb should be
170 | | ... | ${node} | ${interface1} | ${1} | down | up
171 | | When Honeycomb Configures SPAN on sub-interface
172 | | ... | ${node} | ${interface1} | ${1} | ${settings_both}
173 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
174 | | ... | ${node} | ${interface1} | ${1} | ${settings_both}
175
176 | TC11: Honeycomb can configure SPAN on a sub-interface with two source interfaces
177 | | [Documentation] | Honeycomb configures SPAN on sub-interface and verifies
178 | | ... | against VPP SPAN dump in state both.
179 | | ...
180 | | Given Sub-interface state from Honeycomb should be
181 | | ... | ${node} | ${interface1} | ${1} | down | up
182 | | When Honeycomb Configures SPAN on sub-interface
183 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
184 | | Then sub-Interface SPAN Operational Data from Honeycomb should be
185 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
186
187 | TC12: Honeycomb can disable SPAN on interface
188 | | [Documentation] | Honeycomb removes existing SPAN configuration
189 | | ... | from sub-interface.
190 | | ...
191 | | Given Sub-interface state from Honeycomb should be
192 | | ... | ${node} | ${interface1} | ${1} | down | up
193 | | Given sub-Interface SPAN Operational Data from Honeycomb should be
194 | | ... | ${node} | ${interface1} | ${1} | ${settings_both} | ${settings_if2}
195 | | When Honeycomb removes sub-interface SPAN configuration
196 | | ... | ${node} | ${interface1} | ${1}
197 | | Then sub-Interface SPAN Operational Data from Honeycomb should be empty
198 | | ... | ${node} | ${interface1} | ${1}
199
200 | TC13: Honeycomb can configure SPAN with two destination sub-interfaces from the same source
201 | | [Documentation] | Honeycomb configures SPAN on two sub-interfaces
202 | | ... | and verifies against VPP SPAN dump.
203 | | ...
204 | | [Teardown] | Run Keywords
205 | | ... | Honeycomb removes sub-interface SPAN configuration
206 | | ... | ${node} | ${interface1} | ${1} | AND
207 | | ... | Honeycomb removes sub-interface SPAN configuration
208 | | ... | ${node} | ${interface2} | ${1}
209 | | ...
210 | | Given Honeycomb creates sub-interface | ${node} | ${interface2}
211 | | ... | ${sub_if_2_match} | ${sub_if_2_tags} | ${sub_if_2_settings}
212 | | When Honeycomb Configures SPAN on sub-interface
213 | | ... | ${node} | ${interface1} | ${1} | ${settings_if2}
214 | | And Honeycomb Configures SPAN on sub-interface
215 | | ... | ${node} | ${interface2} | ${1} | ${settings_if2}
216 | | Then Sub-Interface SPAN Operational Data from Honeycomb should be
217 | | ... | ${node} | ${interface1} | ${1} | ${settings_if2}
218 | | Then Sub-Interface SPAN Operational Data from Honeycomb should be
219 | | ... | ${node} | ${interface2} | ${1} | ${settings_if2}
220
221 | TC14: DUT mirrors IPv4 packets from an interface to a sub-interface
222 | | [Documentation]
223 | | ... | [Top] TG=DUT1
224 | | ... | [Cfg] (using Honeycomb) On DUT1 configure IPv4 address and set SPAN\
225 | | ... | mirroring from one DUT interface to a sub-interface on the other\
226 | | ... | interface.
227 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
228 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
229 | | ... | on the sub-interface.
230 | | ...
231 | | [Teardown] | Show Packet Trace on All DUTs | ${nodes}
232 | | ...
233 | | Given Configure path in 2-node circular topology
234 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
235 | | And Honeycomb creates sub-interface | ${dut_node} | ${dut_to_tg_if1}
236 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
237 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1}
238 | | ... | up
239 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2}
240 | | ... | up
241 | | And Honeycomb sets the sub-interface up
242 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${1}
243 | | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
244 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix}
245 | | And And Honeycomb adds interface IPv4 neighbor
246 | | ... | ${dut_node} | ${dut_to_tg_if2}
247 | | ... | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_mac}
248 | | ${settings_5}= | create dictionary | state=both
249 | | ... | iface-ref=${dut_to_tg_if2}
250 | | And All Vpp Interfaces Ready Wait | ${nodes}
251 | | When Honeycomb Configures SPAN on sub-interface
252 | | ... | ${node} | ${dut_to_tg_if1} | ${1} | ${settings_5}
253 | | Then Send Packet And Check Received Copies | ${tg_node}
254 | | ... | ${tg_to_dut_if2} | ${tg_to_dut_if2_mac}
255 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1}
256 | | ... | ${tg_to_dut_if2_ip} | ${dut_to_tg_if2_ip} | ICMP