HC Test: SPAN Port Mirroring Suite
[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/testing_path.robot
20 | Resource | resources/libraries/robot/telemetry/span.robot
21 | Variables | resources/test_data/honeycomb/spanrx-apihc-apivat.py
22 | ... | ${node} | ${node['interfaces']['port1']['name']}
23 | ... | ${node['interfaces']['port3']['name']} | local0
24 | Force Tags | honeycomb_sanity
25 | Suite Setup | Add Interface local0 To Topology | ${node}
26 | Suite Teardown | Restart Honeycomb and VPP | ${node}
27 | Documentation | *Honeycomb port mirroring test suite.*
28
29 *** Test Cases ***
30 | TC01: Honeycomb can configure SPAN on an interface receive
31 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
32 | | ... | against VPP SPAN dump in state receive.
33 | | ...
34 | | When Honeycomb Configures SPAN on interface
35 | | ... | ${node} | ${interface1} | ${settings_1}
36 | | Then Interface SPAN configuration from Honeycomb should be
37 | | ... | ${node} | ${interface1} | ${settings_1}
38
39 | TC02: Honeycomb can configure SPAN on an interface transmit
40 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
41 | | ... | against VPP SPAN dump in state transmit.
42 | | ...
43 | | When Honeycomb Configures SPAN on interface
44 | | ... | ${node} | ${interface1} | ${settings_2}
45 | | Then Interface SPAN configuration from Honeycomb should be
46 | | ... | ${node} | ${interface1} | ${settings_2}
47
48 | TC03: Honeycomb can configure SPAN on an interface both
49 | | [Documentation] | Honeycomb configures SPAN on interface and verifies
50 | | ... | against VPP SPAN dump in state both.
51 | | ...
52 | | When Honeycomb Configures SPAN on interface
53 | | ... | ${node} | ${interface1} | ${settings_3}
54 | | Then Interface SPAN configuration from Honeycomb should be
55 | | ... | ${node} | ${interface1} | ${settings_3}
56
57 | TC04: Honeycomb can configure SPAN on two interfaces
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_2} | ${settings_4}
63 | | Then Interface SPAN configuration from Honeycomb should be
64 | | ... | ${node} | ${interface1} | ${settings_2} | ${settings_4}
65
66 | TC05: Honeycomb can disable SPAN on interface
67 | | [Documentation] | Honeycomb removes existing SPAN configuration
68 | | ... | on interface.
69 | | ...
70 | | Given Interface SPAN configuration from Honeycomb should be
71 | | ... | ${node} | ${interface1} | ${settings_2} | ${settings_4}
72 | | When Honeycomb removes interface SPAN configuration
73 | | ... | ${node} | ${interface1}
74 | | Then Interface SPAN configuration from Honeycomb should be empty
75 | | ... | ${node} | ${interface1}
76
77 | TC06: DUT mirrors IPv4 packets from one interface to another
78 | | [TearDown] | Show Packet Trace on All DUTs | ${nodes}
79 | | [Documentation]
80 | | ... | [Top] TG=DUT1
81 | | ... | [Cfg] (using Honeycomb) On DUT1 configure IPv4 address and set SPAN\
82 | | ... | mirroring from one DUT interface to the other.
83 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
84 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
85 | | ... | on the second interface.
86 | | ...
87 | | Path for 2-node testing is set
88 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
89 | | Honeycomb sets interface state | ${dut_node} | ${dut_to_tg_if1} | up
90 | | Honeycomb sets interface state | ${dut_node} | ${dut_to_tg_if2} | up
91 | | Honeycomb sets interface ipv4 address with prefix | ${dut_node}
92 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix}
93 | | Add ARP on DUT
94 | | ... | ${node} | ${dut_to_tg_if1} | ${tg_to_dut_if1_ip}
95 | | ... | ${tg_to_dut_if1_mac}
96 | | ${settings_5}= | create dictionary | state=both
97 | | ... | iface-ref=${dut_to_tg_if1}
98 | | InterfaceCLI.All Vpp Interfaces Ready Wait | ${nodes}
99 | | When Honeycomb Configures SPAN on interface
100 | | ... | ${node} | ${dut_to_tg_if2} | ${settings_5}
101 | | Then Send Packet And Check Received Copies | ${tg_node}
102 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
103 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2}
104 | | ... | ${tg_to_dut_if1_ip} | ${dut_to_tg_if1_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.