64ecb5573c1277e3971181c6a36014e33fdac6e3
[csit.git] / tests / vpp / device / interfaces / 2n1l-10ge2p1x710-ethicmp4-ip4base-eth-1tap-scapy.robot
1 # Copyright (c) 2021 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 |
17 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
18 | ... | NIC_Intel-X710 | ETH | IP4FWD | BASE | IP4BASE | 1TAP | DRV_VFIO_PCI
19 | ... | RXQ_SIZE_0 | TXQ_SIZE_0
20 | ... | ethicmp4-ip4base-eth-1tap
21 |
22 | Suite Setup | Setup suite topology interfaces | scapy
23 | Test Setup | Setup test | namespace
24 | Test Teardown | Tear down test | packet_trace | telemetry | namespace
25 |
26 | Test Template | Local Template
27 |
28 | Documentation | **Tap Interface Traffic Tests**
29 | ... |
30 | ... | - **[Top] Network Topologies:** TG=DUT1 2-node topology with two links \
31 | ... | between nodes.
32 | ... |
33 | ... | - **[Enc] Packet Encapsulations:** Eth-IPv4-ICMPv4 for L2 switching of \
34 | ... | IPv4.
35 | ... |
36 | ... | - **[Cfg] DUT configuration:** DUT1 and DUT2 are configured with L2 \
37 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG) \
38 | ... | are set depending on test case; Namespaces (NM) \
39 | ... | are set on DUT1 with attached linux-TAP.
40 | ... |
41 | ... | - **[Ver] TG verification:** Test ICMPv4 Echo Request packets \
42 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets \
43 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
44 | ... |
45 | ... | - **[Ref] Applicable standard specifications:**
46
47 *** Variables ***
48 | @{plugins_to_enable}= | dpdk_plugin.so | perfmon_plugin.so
49 | ${crypto_type}= | ${None}
50 | ${nic_name}= | Intel-X710
51 | ${nic_driver}= | vfio-pci
52 | ${nic_rxq_size}= | 0
53 | ${nic_txq_size}= | 0
54 | ${nic_pfs}= | 2
55 | ${nic_vfs}= | 0
56 | ${overhead}= | ${0}
57 | ${tap1_VPP_ip}= | 16.0.10.1
58 | ${tap1_NM_ip}= | 16.0.10.2
59 | ${tap1_NM_mac}= | 02:00:00:00:00:02
60 | ${dut_ip_address}= | 192.168.0.1
61 | ${tg_ip_address}= | 192.168.0.2
62 | ${tg_ip_address_GW}= | 192.168.0.0
63 | ${prefix}= | 24
64 # Telemetry
65 | ${telemetry_profile}= | vpp_test_teardown
66
67 *** Keywords ***
68 | Local Template
69 | | [Documentation]
70 | | ... | - **[Cfg]** On DUT1 configure two interface addresses with IPv4 of \
71 | | ... |  which one is TAP interface (dut_to_tg_if and TAP) and one is \
72 | | ... | linux-TAP.
73 | | ... | - **[Ver]** Packet sent from TG gets to the destination and \
74 | | ... | ICMP-reply is received on TG.
75 | |
76 | | ... | *Arguments:*
77 | | ... | - frame_size - Framesize in Bytes in integer. Type: integer
78 | | ... | - phy_cores - Number of physical cores. Type: integer
79 | | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
80 | |
81 | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
82 | |
83 | | Set Test Variable | \${frame_size}
84 | |
85 | | Given Set Max Rate And Jumbo
86 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
87 | | And Pre-initialize layer driver | ${nic_driver}
88 | | And Apply startup configuration on all VPP DUTs | with_trace=${True}
89 | | When Initialize layer driver | ${nic_driver}
90 | | And Initialize layer interface
91 | | ${int1}= | And Add Tap Interface | ${dut1} | tap0
92 | | And VPP Interface Set IP Address
93 | | ... | ${dut1} | ${int1} | ${tap1_VPP_ip} | ${prefix}
94 | | And VPP Interface Set IP Address
95 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_ip_address} | ${prefix}
96 | | And Set Interface State | ${dut1} | ${int1} | up
97 | | And Set Linux Interface MAC | ${dut1} | tap0 | ${tap1_NM_mac}
98 | | And Set Linux Interface IP | ${dut1} | tap0 | ${tap1_NM_ip} | ${prefix}
99 | | And Add Linux Route
100 | | ... | ${dut1} | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip}
101 | | And VPP Add IP Neighbor
102 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_ip_address} | ${TG_pf1_mac}[0]
103 | | And VPP Add IP Neighbor
104 | | ... | ${dut1} | ${int1} | ${tap1_NM_ip} | ${tap1_NM_mac}
105 | | Then Send ICMP echo request and verify answer
106 | | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_vf1_mac}[0] | ${TG_pf1_mac}[0]
107 | | ... | ${tap1_NM_ip} | ${tg_ip_address}
108
109 *** Test Cases ***
110 | 64B-0c-ethicmp4-ip4base-eth-1tap-scapy
111 | | [Tags] | 64B | 0C
112 | | frame_size=${64} | phy_cores=${0}