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