0cd3dc82ecfb9ee7f00015d8b19190eb66d98536
[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 | Tear down test | packet_trace | namespace | linux_bridge
34 | ...
35 | Documentation | *Tap Interface Traffic Tests*
36 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
37 | ... | between nodes.
38 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
39 | ... | IPv4.
40 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
41 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
42 | ... | are set depending on test case; Namespaces (NM)
43 | ... | are set on DUT1 with attached linux-TAP.
44 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
45 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
46 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
47 | ... | *[Ref] Applicable standard specifications:*
48
49 *** Variables ***
50 | ${bid_from_TG}= | 19
51 | ${bid_to_TG}= | 20
52 | ${bid_TAP}= | tapBr
53
54 | ${tap_int1}= | tap0
55 | ${tap_int2}= | tap1
56
57 *** Test Cases ***
58 | tc01-eth2p-ethicmpv4-l2bdbasemaclrn-eth-2tap-device_tap-simple-bd
59 | | [Documentation]
60 | | ... | [Cfg] On DUT1 configure two L2BD with two if's for each L2BD with MAC\
61 | | ... | learning and one L2BD joining two linux-TAP interfaces created by VPP\
62 | | ... | located in namespace.
63 | | ... | [Ver] Packet sent from TG is passed through all L2BD and received\
64 | | ... | back on TG. Then src_ip, dst_ip and MAC are checked.
65 | | ...
66 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
67 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
68 | | And Set interfaces in 2-node circular topology up
69 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
70 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
71 | | And Set Interface State | ${dut_node} | ${int1} | up
72 | | And Set Interface State | ${dut_node} | ${int2} | up
73 | | And Create bridge domain | ${dut_node}
74 | | ... | ${bid_from_TG} | learn=${TRUE}
75 | | And Create bridge domain | ${dut_node}
76 | | ... | ${bid_to_TG} | learn=${TRUE}
77 | | And Linux Add Bridge | ${dut_node}
78 | | ... | ${bid_TAP} | ${tap_int1} | ${tap_int2}
79 | | And Add interface to bridge domain | ${dut_node}
80 | | ... | ${int1} | ${bid_to_TG} | 0
81 | | And Add interface to bridge domain | ${dut_node}
82 | | ... | ${dut_to_tg_if1} | ${bid_to_TG} | 0
83 | | And Add interface to bridge domain | ${dut_node}
84 | | ... | ${int2} | ${bid_from_TG} | 0
85 | | And Add interface to bridge domain | ${dut_node}
86 | | ... | ${dut_to_tg_if2} | ${bid_from_TG} | 0
87 | | Then Send ICMP packet and verify received packet | ${tg_node}
88 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}