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 ***
156721e7f0STibor Frank| Resource | resources/libraries/robot/shared/default.robot
16d68951acSJan Gelety|
17533fcfe3SPeter Mikus| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY
18ac89ba8aSPeter Mikus| ... | NIC_Virtual | ETH | L2BD | BASE | 2TAP | DRV_VFIO_PCI
196daa2d79SPeter Mikus| ... | RXQ_SIZE_0 | TXQ_SIZE_0
20e916ab4dSVratko Polak| ... | ethipv4-l2bdbasemaclrn-eth-2tap
21d68951acSJan Gelety|
2214a71b74SPeter Mikus| Suite Setup | Setup suite topology interfaces | scapy
231577123aSPeter Mikus| Test Setup | Setup test | namespace
246871d4e7SPeter Mikus| Test Teardown | Tear down test | packet_trace | namespace | linux_bridge
25d68951acSJan Gelety|
26d2a7114dSPeter Mikus| Test Template | Local Template
27d68951acSJan Gelety|
28982e81efSJan Gelety| Documentation | *Tap Interface Traffic Tests*
29d68951acSJan Gelety|
30982e81efSJan Gelety| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
31982e81efSJan Gelety| ... | between nodes.
32a4cad14bSJan Gelety| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 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.
38a4cad14bSJan Gelety| ... | *[Ver] TG verification:* Test IPv4 packets with IP protocol=61
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| ${bid_TAP}= | tapBr
54982e81efSJan Gelety
55d2a7114dSPeter Mikus*** Keywords ***
56d2a7114dSPeter Mikus| Local Template
57982e81efSJan Gelety| | [Documentation]
5853d69321STibor Frank| | ... | [Ver] Packet sent from TG is passed through all L2BD and received\
59982e81efSJan Gelety| | ... | back on TG. Then src_ip, dst_ip and MAC are checked.
60d68951acSJan Gelety| |
61d2a7114dSPeter Mikus| | ... | *Arguments:*
62d2a7114dSPeter Mikus| | ... | - frame_size - Framesize in Bytes in integer. Type: integer
63d2a7114dSPeter Mikus| | ... | - phy_cores - Number of physical cores. Type: integer
64d2a7114dSPeter Mikus| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
65d68951acSJan Gelety| |
66d2a7114dSPeter Mikus| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
67d68951acSJan Gelety| |
68d2a7114dSPeter Mikus| | Set Test Variable | \${frame_size}
69d68951acSJan Gelety| |
70ac89ba8aSPeter Mikus| | Given Set Max Rate And Jumbo
71ac89ba8aSPeter Mikus| | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
72ac89ba8aSPeter Mikus| | And Pre-initialize layer driver | ${nic_driver}
73d2a7114dSPeter Mikus| | And Apply startup configuration on all VPP DUTs | with_trace=${True}
74fcc77752SPeter Mikus| | When Initialize layer driver | ${nic_driver}
75fcc77752SPeter Mikus| | And Initialize layer interface
76533fcfe3SPeter Mikus| | ${int1}= | And Add Tap Interface | ${dut1} | tap0
77533fcfe3SPeter Mikus| | ${int2}= | And Add Tap Interface | ${dut1} | tap1
78533fcfe3SPeter Mikus| | And Set Interface State | ${dut1} | ${int1} | up
79533fcfe3SPeter Mikus| | And Set Interface State | ${dut1} | ${int2} | up
8014a71b74SPeter Mikus| | And Create L2 BD | ${dut1} | 19 | learn=${TRUE}
8114a71b74SPeter Mikus| | And Create L2 BD | ${dut1} | 20 | learn=${TRUE}
82533fcfe3SPeter Mikus| | And Linux Add Bridge | ${dut1} | ${bid_TAP} | tap0 | tap1
83533fcfe3SPeter Mikus| | And Add interface to bridge domain | ${dut1} | ${int1} | 20 | 0
8414a71b74SPeter Mikus| | And Add interface to bridge domain | ${dut1} | ${DUT1_${int}1}[0] | 20 | 0
85533fcfe3SPeter Mikus| | And Add interface to bridge domain | ${dut1} | ${int2} | 19 | 0
8614a71b74SPeter Mikus| | And Add interface to bridge domain | ${dut1} | ${DUT1_${int}2}[0] | 19 | 0
87a4cad14bSJan Gelety| | Then Send IP packet and verify received packet
8814a71b74SPeter Mikus| | ... | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0]
89d2a7114dSPeter Mikus
90d2a7114dSPeter Mikus*** Test Cases ***
91a4cad14bSJan Gelety| tc01-64B-ethipv4-l2bdbasemaclrn-eth-2tap-dev
92d2a7114dSPeter Mikus| | [Tags] | 64B
93d2a7114dSPeter Mikus| | frame_size=${64} | phy_cores=${0}
94