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