Fix few pylint violations
[csit.git] / tests / vpp / device / interfaces / eth2p-ethip4-ip4base-eth-1tap-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 | TAP
19 | ...
20 | Suite Setup | Setup suite single link | scapy
21 | Test Setup | Setup test | namespace
22 | Test Teardown | Tear down test | packet_trace | namespace
23 | ...
24 | Documentation | *Tap Interface Traffic Tests*
25 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
26 | ... | between nodes.
27 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
28 | ... | IPv4.
29 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
30 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
31 | ... | are set depending on test case; Namespaces (NM)
32 | ... | are set on DUT1 with attached linux-TAP.
33 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
34 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
35 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
36 | ... | *[Ref] Applicable standard specifications:*
37
38 *** Variables ***
39 | @{plugins_to_enable}= | dpdk_plugin.so
40 | ${nic_name}= | virtual
41 | ${overhead}= | ${0}
42 | ${tap1_VPP_ip}= | 16.0.10.1
43 | ${tap1_NM_ip}= | 16.0.10.2
44 | ${tap1_NM_mac}= | 02:00:00:00:00:02
45 | ${dut_ip_address}= | 192.168.0.1
46 | ${tg_ip_address}= | 192.168.0.2
47 | ${tg_ip_address_GW}= | 192.168.0.0
48 | ${prefix}= | 24
49
50 *** Test Cases ***
51 | tc01-eth2p-ethicmpv4-ip4base-dev_tap-no-namespace
52 | | [Documentation]
53 | | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which\
54 | | ... | one is TAP interface (dut_to_tg_if and TAP) and one is linux-TAP.
55 | | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is\
56 | | ... | received on TG.
57 | | ...
58 | | Set Test Variable | ${frame_size} | ${42}
59 | | Set Test Variable | ${rxq_count_int} | ${1}
60 | | ...
61 | | Given Add PCI devices to all DUTs
62 | | And Set Max Rate And Jumbo And Handle Multi Seg
63 | | And Apply startup configuration on all VPP DUTs
64 | | And VPP Enable Traces On All Duts | ${nodes}
65 | | When Set interfaces in path up
66 | | ${int1}= | And Add Tap Interface | ${dut1} | tap0
67 | | And VPP Interface Set IP Address
68 | | ... | ${dut1} | ${int1} | ${tap1_VPP_ip} | ${prefix}
69 | | And VPP Interface Set IP Address
70 | | ... | ${dut1} | ${dut1_if1} | ${dut_ip_address} | ${prefix}
71 | | And Set Interface State | ${dut1} | ${int1} | up
72 | | And Set Linux Interface MAC | ${dut1} | tap0 | ${tap1_NM_mac}
73 | | And Set Linux Interface IP | ${dut1} | tap0 | ${tap1_NM_ip} | ${prefix}
74 | | And Add Linux Route
75 | | ... | ${dut1} | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip}
76 | | And VPP Add IP Neighbor
77 | | ... | ${dut1} | ${dut1_if1} | ${tg_ip_address} | ${tg_if1_mac}
78 | | And VPP Add IP Neighbor
79 | | ... | ${dut1} | ${int1} | ${tap1_NM_ip} | ${tap1_NM_mac}
80 | | Then Send ICMP echo request and verify answer
81 | | ... | ${tg} | ${tg_if1} | ${dut1_if1_mac} | ${tg_if1_mac}
82 | | ... | ${tap1_NM_ip} | ${tg_ip_address}
83
84 | tc02-eth2p-ethicmpv4-ip4base-dev_tap-namespace
85 | | [Documentation]
86 | | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which\
87 | | ... | one is TAP interface (dut_to_tg_if and TAP) and one is linux-TAP in\
88 | | ... | namespace.
89 | | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is\
90 | | ... | received on TG.
91 | | ...
92 | | Set Test Variable | ${frame_size} | ${42}
93 | | Set Test Variable | ${rxq_count_int} | ${1}
94 | | ...
95 | | Given Add PCI devices to all DUTs
96 | | And Set Max Rate And Jumbo And Handle Multi Seg
97 | | And Apply startup configuration on all VPP DUTs
98 | | And VPP Enable Traces On All Duts | ${nodes}
99 | | When Set interfaces in path up
100 | | ${int1}= | And Add Tap Interface | ${dut1} | tap0
101 | | And VPP Interface Set IP Address
102 | | ... | ${dut1} | ${int1} | ${tap1_VPP_ip} | ${prefix}
103 | | And VPP Interface Set IP Address
104 | | ... | ${dut1} | ${dut1_if1} | ${dut_ip_address} | ${prefix}
105 | | And Set Interface State | ${dut1} | ${int1} | up
106 | | And Create Namespace | ${dut1} | nmspace1
107 | | And Attach Interface To Namespace | ${dut1} | nmspace1 | tap0
108 | | And Set Linux Interface MAC
109 | | ... | ${dut1} | tap0 | ${tap1_NM_mac} | nmspace1
110 | | And Set Linux Interface IP
111 | | ... | ${dut1} | tap0 | ${tap1_NM_ip} | ${prefix} | nmspace1
112 | | And VPP Add IP Neighbor
113 | | ... | ${dut1} | ${dut1_if1} | ${tg_ip_address} | ${tg_if1_mac}
114 | | And VPP Add IP Neighbor
115 | | ... | ${dut1} | ${int1} | ${tap1_NM_ip} | ${tap1_NM_mac}
116 | | And Add Linux Route
117 | | ... | ${dut1} | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} | nmspace1
118 | | Then Send ICMP echo request and verify answer
119 | | ... | ${tg} | ${tg_if1} | ${dut1_if1_mac} | ${tg_if1_mac}
120 | | ... | ${tap1_NM_ip} | ${tg_ip_address}