575d800df2d120a7a35ee4e57d2c4fe71a969328
[csit.git] / tests / func / telemetry / span.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/testing_path.robot
17 | Resource | resources/libraries/robot/telemetry/span.robot
18 | Library  | resources.libraries.python.Trace
19 | Library  | resources.libraries.python.IPv4Util
20 | Library  | resources.libraries.python.IPv4Setup
21 | Library  | resources.libraries.python.telemetry.SPAN
22 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO | EXPECTED_FAILING
23 # TODO: Remove EXPECTED_FAILING tag once functionality is implemented (VPP-185)
24 | Test Setup | Run Keywords | Setup all DUTs before test
25 | ...        | AND          | Setup all TGs before traffic script
26 | Test Teardown | Run Keyword If Test Failed | Run Keywords
27 | ... | Show packet trace on all DUTs | ${nodes} | AND
28 | ... | Show vpp trace dump on all DUTs
29 | Documentation | *SPAN test suite*
30 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two
31 | ... | links between nodes.
32 | ... | *[Cfg] DUT configuration:* DUT1 is configured with SPAN mirroring from
33 | ... | the first DUT1-TG interface to the second one.
34 | ... | *[Ver] TG verification:* Test ARP or ICMP packets are sent by TG
35 | ... | on first link to DUT1; On receipt through second link TG verifies
36 | ... | the copy of packet sent and the copy of DUT's reply packet.
37 | ... | *[Ref] Applicable standard specifications: None?*
38
39 *** Variables ***
40 | ${tg_to_dut_if1_ip4}= | 192.168.1.1
41 | ${dut_to_tg_if1_ip4}= | 192.168.1.2
42 | ${tg_to_dut_if1_ip6}= | 11::1
43 | ${dut_to_tg_if1_ip6}= | 10::1
44 | ${prefix}= | 24
45
46 *** Test Cases ***
47 | TC01: DUT mirrors L2 packets from one interface to another
48 | | [Documentation]
49 | | ... | [Top] TG=DUT1
50 | | ... | [Cfg] On DUT1 configure IPv4 address and set SPAN mirroring\
51 | | ... | from one DUT interface to the other.
52 | | ... | [Ver] Make TG send an ARP packet to DUT through one interface,\
53 | | ... | then receive a copy of sent packet and of DUT's ARP reply\
54 | | ... | on the second interface.
55 | | Given Path For 2-node Testing Is Set | ${nodes['TG']} | ${nodes['DUT1']}
56 | | ... | ${nodes['TG']}
57 | | And Interfaces In 2-node Path Are Up
58 | | And Set interface Address | ${dut_node} | ${dut_to_tg_if1}
59 | | ... | ${dut_to_tg_if1_ip4} | ${prefix}
60 | | And Set SPAN Mirroring | ${dut_node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
61 | | Then Send Packet And Check Received Copies | ${tg_node}
62 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
63 | | ... | ${dut_to_tg__if1_mac} | ${tg_to_dut_if2}
64 | | ... | ${tg_to_dut_if1_ip4} | ${dut_to_tg_if1_ip4} | ARP
65
66 | TC02: DUT mirrors IPv4 packets from one interface to another
67 | | [Documentation]
68 | | ... | [Top] TG=DUT1
69 | | ... | [Cfg] On DUT1 configure IPv4 address, add ARP entry for one TG \
70 | | ... | interface and set SPAN mirroring from one DUT interface to the other.
71 | | ... | [Ver] Make TG send an ICMP packet to DUT through one interface,\
72 | | ... | then receive a copy of sent packet and of DUT's ICMP reply\
73 | | ... | on the other interface.
74 | | Given Path For 2-node Testing Is Set | ${nodes['TG']} | ${nodes['DUT1']}
75 | | ... | ${nodes['TG']}
76 | | And Interfaces In 2-node Path Are Up
77 | | And Set interface Address | ${dut_node} | ${dut_to_tg_if1}
78 | | ... | ${dut_to_tg_if1_ip4} | ${prefix}
79 | | And Add ARP on DUT | ${dut_node} | ${dut_to_tg_if1} | ${tg_to_dut_if1_ip4}
80 | | ... | ${tg_to_dut_if1_mac}
81 | | And Set SPAN Mirroring | ${dut_node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
82 | | Then Send Packet And Check Received Copies | ${tg_node}
83 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
84 | | ... | ${dut_to_tg__if1_mac} | ${tg_to_dut_if2}
85 | | ... | ${tg_to_dut_if1_ip4} | ${dut_to_tg_if1_ip4} | ICMP
86