CSIT-687: Directory structure reorganization
[csit.git] / tests / vpp / func / interfaces / eth2p-eth-l2bdbasemaclrn-l2shg-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/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 | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
28 | ...
29 | Test Setup | Set up TAP functional test
30 | ...
31 | Test Teardown | Tear down TAP functional test
32 | ...
33 | Documentation | *Tap Interface Traffic Tests*
34 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
35 | ... | between nodes.
36 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
37 | ... | IPv4.
38 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
39 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
40 | ... | are set depending on test case; Namespaces (NM)
41 | ... | are set on DUT1 with attached linux-TAP.
42 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
43 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
44 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
45 | ... | *[Ref] Applicable standard specifications:*
46
47 *** Variables ***
48 | ${tap1_NM_ip}= | 16.0.10.2
49 | ${tap2_NM_SHG}= | 16.0.10.3
50
51 | ${bd_id1}= | 21
52 | ${shg1}= | 2
53 | ${shg2}= | 3
54
55 | ${tap1_NM_mac}= | 02:00:00:00:00:02
56 | ${tap2_NM_mac}= | 02:00:00:00:00:04
57
58 | ${tap_int1}= | tap_int1
59 | ${tap_int2}= | tap_int2
60
61 | ${namespace1}= | nmspace1
62 | ${namespace2}= | nmspace2
63
64 | ${tg_ip_address_SHG}= | 16.0.10.20
65 | ${prefix}= | 24
66
67 *** Test Cases ***
68 | TC01: Tap Interface BD - Different Split Horizon
69 | | [Documentation]
70 | | ... | [Top] TG-DUT1-TG.
71 | | ... | [Enc] Eth-IPv4-ICMPv4.
72 | | ... | [Cfg] On DUT1 configure one if into L2BD with MAC learning. Add two\
73 | | ... | TAP interfaces into this L2BD and assign them different SHG. Setup\
74 | | ... | two namespaces and assign two linux-TAP interfaces to it respectively.
75 | | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply\
76 | | ... | is checked. Ping from First linux-TAP to another should pass.
77 | | ...
78 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
79 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
80 | | And Set interfaces in 2-node circular topology up
81 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
82 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
83 | | And Set Interface State | ${dut_node} | ${int1} | up
84 | | And Set Interface State | ${dut_node} | ${int2} | up
85 | | When Create Namespace | ${dut_node} | ${namespace1}
86 | | And Attach Interface To Namespace | ${dut_node}
87 | | ... | ${namespace1} | ${tap_int1}
88 | | And Create Namespace | ${dut_node} | ${namespace2}
89 | | And Attach Interface To Namespace | ${dut_node}
90 | | ... | ${namespace2} | ${tap_int2}
91 | | And Set Linux Interface IP | ${dut_node} | ${tap_int1}
92 | | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1}
93 | | And Set Linux Interface IP | ${dut_node} | ${tap_int2}
94 | | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2}
95 | | And Set Linux Interface MAC | ${dut_node}
96 | | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1}
97 | | And Set Linux Interface MAC | ${dut_node}
98 | | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2}
99 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int1}
100 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1}
101 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int2}
102 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2}
103 | | And Create bridge domain | ${dut_node}
104 | | ... | ${bd_id1} | learn=${TRUE}
105 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
106 | | ... | ${bd_id1}
107 | | And Add interface to bridge domain | ${dut_node} | ${int1}
108 | | ... | ${bd_id1} | ${shg1}
109 | | And Add interface to bridge domain | ${dut_node} | ${int2}
110 | | ... | ${bd_id1} | ${shg2}
111 | | Then Send ICMP echo request and verify answer | ${tg_node}
112 | | ... | ${tg_to_dut_if1} | ${tap1_NM_mac} | ${tg_to_dut_if1_mac}
113 | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG}
114 | | And Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1}
115 | | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac}
116 | | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG}
117 | | And Send Ping From Node To Dst | ${dut_node} | ${tap1_NM_ip}
118 | | ... | namespace=${namespace2}
119 | | And Send Ping From Node To Dst | ${dut_node} | ${tap2_NM_SHG}
120 | | ... | namespace=${namespace1}
121
122 | TC02: Tap Interface BD - Same Split Horizon
123 | | [Documentation]
124 | | ... | [Top] TG-DUT1-TG.
125 | | ... | [Enc] Eth-IPv4-ICMPv4.
126 | | ... | [Cfg] On DUT1 configure one if into L2BD with MAC learning. Add two\
127 | | ... | TAP interfaces into this L2BD and assign them same SHG. Setup two\
128 | | ... | namespaces and assign two linux-TAP interfaces to it respectively.
129 | | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply\
130 | | ... | is checked. Ping from First linux-TAP to another should fail.
131 | | ...
132 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
133 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
134 | | And Set interfaces in 2-node circular topology up
135 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
136 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
137 | | And Set Interface State | ${dut_node} | ${int1} | up
138 | | And Set Interface State | ${dut_node} | ${int2} | up
139 | | When Create Namespace | ${dut_node} | ${namespace1}
140 | | And Attach Interface To Namespace | ${dut_node}
141 | | ... | ${namespace1} | ${tap_int1}
142 | | And Create Namespace | ${dut_node} | ${namespace2}
143 | | And Attach Interface To Namespace | ${dut_node}
144 | | ... | ${namespace2} | ${tap_int2}
145 | | And Set Linux Interface IP | ${dut_node} | ${tap_int1}
146 | | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1}
147 | | And Set Linux Interface IP | ${dut_node} | ${tap_int2}
148 | | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2}
149 | | And Set Linux Interface MAC | ${dut_node}
150 | | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1}
151 | | And Set Linux Interface MAC | ${dut_node}
152 | | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2}
153 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int1}
154 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1}
155 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int2}
156 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2}
157 | | And Create bridge domain | ${dut_node}
158 | | ... | ${bd_id1} | learn=${TRUE}
159 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
160 | | ... | ${bd_id1}
161 | | And Add interface to bridge domain | ${dut_node} | ${int1}
162 | | ... | ${bd_id1} | ${shg1}
163 | | And Add interface to bridge domain | ${dut_node} | ${int2}
164 | | ... | ${bd_id1} | ${shg1}
165 | | Then Send ICMP echo request and verify answer | ${tg_node}
166 | | ... | ${tg_to_dut_if1} | ${tap1_NM_mac} | ${tg_to_dut_if1_mac}
167 | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG}
168 | | And Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1}
169 | | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac}
170 | | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG}
171 | | And Run Keyword And Expect Error | Ping Not Successful
172 | | ... | Send Ping From Node To Dst | ${dut_node} | ${tap2_NM_SHG}
173 | | ... | namespace=${namespace1}
174 | | And Run Keyword And Expect Error | Ping Not Successful
175 | | ... | Send Ping From Node To Dst | ${dut_node} | ${tap1_NM_ip}
176 | | ... | namespace=${namespace2}