16daa2d79SPeter Mikus# Copyright (c) 2020 Cisco and/or its affiliates.
2982e81efSJan Gelety# Licensed under the Apache License, Version 2.0 (the "License");
3982e81efSJan Gelety# you may not use this file except in compliance with the License.
4982e81efSJan Gelety# You may obtain a copy of the License at:
5982e81efSJan Gelety#
6982e81efSJan Gelety#     http://www.apache.org/licenses/LICENSE-2.0
7982e81efSJan Gelety#
8982e81efSJan Gelety# Unless required by applicable law or agreed to in writing, software
9982e81efSJan Gelety# distributed under the License is distributed on an "AS IS" BASIS,
10982e81efSJan Gelety# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11982e81efSJan Gelety# See the License for the specific language governing permissions and
12982e81efSJan Gelety# limitations under the License.
13982e81efSJan Gelety
14982e81efSJan Gelety*** Settings ***
151577123aSPeter Mikus| Resource | resources/libraries/robot/shared/default.robot
16d68951acSJan Gelety|
17533fcfe3SPeter Mikus| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
18d2a7114dSPeter Mikus| ... | NIC_Virtual | ETH | IP4FWD | BASE | IP4BASE | 1TAP | NAMESPACE
193f9fc8d2SJan Gelety| ... | DRV_VFIO_PCI
206daa2d79SPeter Mikus| ... | RXQ_SIZE_0 | TXQ_SIZE_0
21e916ab4dSVratko Polak| ... | ethicmpv4-ip4base-eth-1tap-namespace
22d68951acSJan Gelety|
2314a71b74SPeter Mikus| Suite Setup | Setup suite topology interfaces | scapy
241577123aSPeter Mikus| Test Setup | Setup test | namespace
256871d4e7SPeter Mikus| Test Teardown | Tear down test | packet_trace | namespace
26d68951acSJan Gelety|
27d2a7114dSPeter Mikus| Test Template | Local Template
28d68951acSJan Gelety|
29982e81efSJan Gelety| Documentation | *Tap Interface Traffic Tests*
30982e81efSJan Gelety| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
31982e81efSJan Gelety| ... | between nodes.
32982e81efSJan Gelety| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
33982e81efSJan Gelety| ... | IPv4.
34982e81efSJan Gelety| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
35982e81efSJan Gelety| ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
36982e81efSJan Gelety| ... | are set depending on test case; Namespaces (NM)
37982e81efSJan Gelety| ... | are set on DUT1 with attached linux-TAP.
38982e81efSJan Gelety| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
39982e81efSJan Gelety| ... | are sent by TG on link to DUT1; On receipt TG verifies packets
40982e81efSJan Gelety| ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
41982e81efSJan Gelety| ... | *[Ref] Applicable standard specifications:*
42982e81efSJan Gelety
43982e81efSJan Gelety*** Variables ***
441577123aSPeter Mikus| @{plugins_to_enable}= | dpdk_plugin.so
45ac89ba8aSPeter Mikus| ${crypto_type}= | ${None}
461577123aSPeter Mikus| ${nic_name}= | virtual
47fcc77752SPeter Mikus| ${nic_driver}= | vfio-pci
486daa2d79SPeter Mikus| ${nic_rxq_size}= | 0
496daa2d79SPeter Mikus| ${nic_txq_size}= | 0
5014a71b74SPeter Mikus| ${nic_pfs}= | 2
5114a71b74SPeter Mikus| ${nic_vfs}= | 0
52533fcfe3SPeter Mikus| ${overhead}= | ${0}
53982e81efSJan Gelety| ${tap1_VPP_ip}= | 16.0.10.1
54982e81efSJan Gelety| ${tap1_NM_ip}= | 16.0.10.2
55982e81efSJan Gelety| ${tap1_NM_mac}= | 02:00:00:00:00:02
56982e81efSJan Gelety| ${dut_ip_address}= | 192.168.0.1
57982e81efSJan Gelety| ${tg_ip_address}= | 192.168.0.2
58982e81efSJan Gelety| ${tg_ip_address_GW}= | 192.168.0.0
59982e81efSJan Gelety| ${prefix}= | 24
60982e81efSJan Gelety
61d2a7114dSPeter Mikus*** Keywords ***
62d2a7114dSPeter Mikus| Local Template
63982e81efSJan Gelety| | [Documentation]
6453d69321STibor Frank| | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which\
6553d69321STibor Frank| | ... | one is TAP interface (dut_to_tg_if and TAP) and one is linux-TAP in\
6653d69321STibor Frank| | ... | namespace.
6753d69321STibor Frank| | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is\
68982e81efSJan Gelety| | ... | received on TG.
69d68951acSJan Gelety| |
70d2a7114dSPeter Mikus| | ... | *Arguments:*
71d2a7114dSPeter Mikus| | ... | - frame_size - Framesize in Bytes in integer. Type: integer
72d2a7114dSPeter Mikus| | ... | - phy_cores - Number of physical cores. Type: integer
73d2a7114dSPeter Mikus| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
74d68951acSJan Gelety| |
75d2a7114dSPeter Mikus| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
76d68951acSJan Gelety| |
77d2a7114dSPeter Mikus| | Set Test Variable | \${frame_size}
78d68951acSJan Gelety| |
79ac89ba8aSPeter Mikus| | Given Set Max Rate And Jumbo
80ac89ba8aSPeter Mikus| | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
81ac89ba8aSPeter Mikus| | And Pre-initialize layer driver | ${nic_driver}
82d2a7114dSPeter Mikus| | And Apply startup configuration on all VPP DUTs | with_trace=${True}
83fcc77752SPeter Mikus| | When Initialize layer driver | ${nic_driver}
84fcc77752SPeter Mikus| | And Initialize layer interface
85533fcfe3SPeter Mikus| | ${int1}= | And Add Tap Interface | ${dut1} | tap0
860e28406bSJan Gelety| | And VPP Interface Set IP Address
87533fcfe3SPeter Mikus| | ... | ${dut1} | ${int1} | ${tap1_VPP_ip} | ${prefix}
880e28406bSJan Gelety| | And VPP Interface Set IP Address
8914a71b74SPeter Mikus| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_ip_address} | ${prefix}
90533fcfe3SPeter Mikus| | And Set Interface State | ${dut1} | ${int1} | up
91533fcfe3SPeter Mikus| | And Create Namespace | ${dut1} | nmspace1
92533fcfe3SPeter Mikus| | And Attach Interface To Namespace | ${dut1} | nmspace1 | tap0
93533fcfe3SPeter Mikus| | And Set Linux Interface MAC
94533fcfe3SPeter Mikus| | ... | ${dut1} | tap0 | ${tap1_NM_mac} | nmspace1
95533fcfe3SPeter Mikus| | And Set Linux Interface IP
96533fcfe3SPeter Mikus| | ... | ${dut1} | tap0 | ${tap1_NM_ip} | ${prefix} | nmspace1
97533fcfe3SPeter Mikus| | And VPP Add IP Neighbor
9814a71b74SPeter Mikus| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_ip_address} | ${TG_pf1_mac}[0]
99533fcfe3SPeter Mikus| | And VPP Add IP Neighbor
100533fcfe3SPeter Mikus| | ... | ${dut1} | ${int1} | ${tap1_NM_ip} | ${tap1_NM_mac}
101533fcfe3SPeter Mikus| | And Add Linux Route
102533fcfe3SPeter Mikus| | ... | ${dut1} | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} | nmspace1
103533fcfe3SPeter Mikus| | Then Send ICMP echo request and verify answer
10414a71b74SPeter Mikus| | ... | ${tg} | ${TG_pf1}[0] | ${DUT1_vf1_mac}[0] | ${TG_pf1_mac}[0]
105982e81efSJan Gelety| | ... | ${tap1_NM_ip} | ${tg_ip_address}
106d2a7114dSPeter Mikus
107d2a7114dSPeter Mikus*** Test Cases ***
108f8452762SPeter Mikus| tc01-64B-ethicmpv4-ip4base-eth-1tap-namespace-dev
109d2a7114dSPeter Mikus| | [Tags] | 64B
110d2a7114dSPeter Mikus| | frame_size=${64} | phy_cores=${0}
111