6c47c5c574b78591e954be8dcf3347326bcd5826
[csit.git] / tests / func / tap / eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot
1 # Copyright (c) 2016 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/default.robot
16 | Resource | resources/libraries/robot/ipv4.robot
17 | Resource | resources/libraries/robot/ipv6.robot
18 | Resource | resources/libraries/robot/interfaces.robot
19 | Resource | resources/libraries/robot/bridge_domain.robot
20 | Resource | resources/libraries/robot/testing_path.robot
21 | Resource | resources/libraries/robot/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 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
27 | Test Setup | Run Keywords | Func Test Setup
28 | ...        | AND          | Clean Up Namespaces | ${nodes['DUT1']}
29 | Test Teardown | Run Keywords | Func Test Teardown
30 | ...           | AND          | Clean Up Namespaces | ${nodes['DUT1']}
31 | Documentation | *Tap Interface Traffic Tests*
32 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
33 | ... | between nodes.
34 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
35 | ... | IPv4.
36 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
37 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
38 | ... | are set depending on test case; Namespaces (NM)
39 | ... | are set on DUT1 with attached linux-TAP.
40 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
41 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
42 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
43 | ... | *[Ref] Applicable standard specifications:*
44
45 *** Variables ***
46 | ${bid_from_TG}= | 19
47 | ${bid_to_TG}= | 20
48 | ${bid_TAP}= | tapBr
49
50 | ${tap_int1}= | tap_int1
51 | ${tap_int2}= | tap_int2
52
53 *** Test Cases ***
54 | TC01: Tap Interface Simple BD
55 | | [Documentation]
56 | | ... | [Top] TG-DUT1-TG.
57 | | ... | [Enc] Eth-IPv4-ICMPv4.
58 | | ... | [Cfg] On DUT1 configure two
59 | | ... | L2BD with two if's for each L2BD with MAC learning and one L2BD
60 | | ... | joining two linux-TAP interfaces created by VPP located in namespace.
61 | | ... | [Ver] Packet sent from TG is passed through all L2BD and received
62 | | ... | back on TG. Then src_ip, dst_ip and MAC are checked.
63 | | ...
64 | | [Teardown] | Run Keywords
65 | | ... | Linux Del Bridge | ${dut_node} | ${bid_TAP} | AND
66 | | ... | Show Packet Trace on All DUTs | ${nodes} | AND
67 | | ... | Clean Up Namespaces | ${nodes['DUT1']} | AND
68 | | ... | Check VPP PID in Teardown
69 | | ...
70 | | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']}
71 | | ... | ${nodes['TG']}
72 | | And Interfaces in 2-node path are up
73 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
74 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
75 | | And Set Interface State | ${dut_node} | ${int1} | up
76 | | And Set Interface State | ${dut_node} | ${int2} | up
77 | | And Bridge domain on DUT node is created | ${dut_node}
78 | | ... | ${bid_from_TG} | learn=${TRUE}
79 | | And Bridge domain on DUT node is created | ${dut_node}
80 | | ... | ${bid_to_TG} | learn=${TRUE}
81 | | And Linux Add Bridge | ${dut_node}
82 | | ... | ${bid_TAP} | ${tap_int1} | ${tap_int2}
83 | | And Interface is added to bridge domain | ${dut_node}
84 | | ... | ${int1} | ${bid_to_TG} | 0
85 | | And Interface is added to bridge domain | ${dut_node}
86 | | ... | ${dut_to_tg_if1} | ${bid_to_TG} | 0
87 | | And Interface is added to bridge domain | ${dut_node}
88 | | ... | ${int2} | ${bid_from_TG} | 0
89 | | And Interface is added to bridge domain | ${dut_node}
90 | | ... | ${dut_to_tg_if2} | ${bid_from_TG} | 0
91 | | Then Send and receive ICMP Packet | ${tg_node}
92 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}