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

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.