vpp_device: TAP
[csit.git] / tests / vpp / device / interfaces / eth2p-eth-l2bdbasemaclrn-eth-2tap-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 | Resource | resources/libraries/robot/ip/ip4.robot
17 | Resource | resources/libraries/robot/ip/ip6.robot
18 | Resource | resources/libraries/robot/shared/interfaces.robot
19 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
20 | Resource | resources/libraries/robot/shared/testing_path.robot
21 | Resource | resources/libraries/robot/shared/traffic.robot
22 | Library  | resources.libraries.python.Trace
23 | Library  | resources.libraries.python.Tap
24 | Library  | resources.libraries.python.Namespaces
25 | Library  | resources.libraries.python.IPUtil
26 | ...
27 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
28 | ... | FUNCTEST | L2BD | BASE | ETH | TAP
29 | ...
30 | Test Setup | Run Keywords | Set up VPP device test
31 | ... | AND | Clean Up Namespaces | ${nodes['DUT1']}
32 | ...
33 | Test Teardown | Run Keywords | Tear down VPP device test
34 | ... | AND | Clean Up Namespaces | ${nodes['DUT1']}
35 | ... | AND | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP}
36 | ...
37 | Documentation | *Tap Interface Traffic Tests*
38 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
39 | ... | between nodes.
40 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
41 | ... | IPv4.
42 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
43 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
44 | ... | are set depending on test case; Namespaces (NM)
45 | ... | are set on DUT1 with attached linux-TAP.
46 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
47 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
48 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
49 | ... | *[Ref] Applicable standard specifications:*
50
51 *** Variables ***
52 | ${bid_from_TG}= | 19
53 | ${bid_to_TG}= | 20
54 | ${bid_TAP}= | tapBr
55
56 | ${tap_int1}= | tap0
57 | ${tap_int2}= | tap1
58
59 *** Test Cases ***
60 | tc01-eth2p-ethicmpv4-l2bdbasemaclrn-eth-2tap-device_tap-simple-bd
61 | | [Documentation]
62 | | ... | [Cfg] On DUT1 configure two L2BD with two if's for each L2BD with MAC\
63 | | ... | learning and one L2BD joining two linux-TAP interfaces created by VPP\
64 | | ... | located in namespace.
65 | | ... | [Ver] Packet sent from TG is passed through all L2BD and received\
66 | | ... | back on TG. Then src_ip, dst_ip and MAC are checked.
67 | | ...
68 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
69 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
70 | | And Set interfaces in 2-node circular topology up
71 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
72 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
73 | | And Set Interface State | ${dut_node} | ${int1} | up
74 | | And Set Interface State | ${dut_node} | ${int2} | up
75 | | And Create bridge domain | ${dut_node}
76 | | ... | ${bid_from_TG} | learn=${TRUE}
77 | | And Create bridge domain | ${dut_node}
78 | | ... | ${bid_to_TG} | learn=${TRUE}
79 | | And Linux Add Bridge | ${dut_node}
80 | | ... | ${bid_TAP} | ${tap_int1} | ${tap_int2}
81 | | And Add interface to bridge domain | ${dut_node}
82 | | ... | ${int1} | ${bid_to_TG} | 0
83 | | And Add interface to bridge domain | ${dut_node}
84 | | ... | ${dut_to_tg_if1} | ${bid_to_TG} | 0
85 | | And Add interface to bridge domain | ${dut_node}
86 | | ... | ${int2} | ${bid_from_TG} | 0
87 | | And Add interface to bridge domain | ${dut_node}
88 | | ... | ${dut_to_tg_if2} | ${bid_from_TG} | 0
89 | | Then Send ICMP packet and verify received packet | ${tg_node}
90 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}