bc5eac203a565b192a21a0b52bf6bd7637e5fabe
[csit.git] / tests / suites / bridge_domain / bridge_domain_untagged.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/bridge_domain.robot
17 | Resource | resources/libraries/robot/qemu.robot
18 | Library  | resources.libraries.python.Trace
19 | Force Tags | HW_ENV | VM_ENV
20 | Test Setup | Run Keywords | Setup all DUTs before test
21 | ...        | AND          | Setup all TGs before traffic script
22 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
23 | Documentation | *Bridge domain test suite.*
24 | ...
25 | ... | Test suite uses 2-node topology TGTG - DUT1 - TG with two links
26 | ... | between nodes as well as 3-node topology TG - DUT1 - DUT2 - TG
27 | ... | with one link between nodes. Test packets are sent in both directions
28 | ... | and contain Ethernet header, IPv4 header and ICMP message. Ethernet
29 | ... | header MAC addresses are matching MAC addresses of the TG node.
30
31 *** Variables ***
32 | ${bd_id1}= | 1
33 | ${bd_id2}= | 2
34 | ${sock1}= | /tmp/sock1
35 | ${sock2}= | /tmp/sock2
36
37 *** Test Cases ***
38 | VPP reports interfaces
39 | | [Documentation] | Report VPP interfaces on the given node
40 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | 3_NODE_SINGLE_LINK_TOPO
41 | | VPP reports interfaces on | ${nodes['DUT1']}
42
43 | Vpp forwards packets via L2 bridge domain 2 ports
44 | | [Documentation] | Create bridge domain (learning enabled) on one VPP node,
45 | | ...             | add there two interfaces and check traffic
46 | | ...             | bidirectionally.
47 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
48 | | Given Path for 2-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
49 | | When Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
50 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
51 | | ...                                     | ${bd_id1}
52 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
53 | | ...                                     | ${bd_id1}
54 | | And Interfaces on all VPP nodes in the path are up | ${dut_node}
55 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
56 | | ...                                     | ${tg_to_dut_if2}
57
58 | Vpp forwards packets via L2 bridge domain in circular topology
59 | | [Documentation] | Create bridge domains (learning enabled) on two VPP nodes,
60 | | ...             | add two interfaces to each bridge domain and check traffic
61 | | ...             | bidirectionally.
62 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
63 | | Given Path for 3-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
64 | | ...                                     | ${nodes['DUT2']}
65 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
66 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
67 | | ...                                     | ${bd_id1}
68 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
69 | | ...                                     | ${bd_id1}
70 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
71 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
72 | | ...                                     | ${bd_id2}
73 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
74 | | ...                                     | ${bd_id2}
75 | | And Interfaces on all VPP nodes in the path are up | ${dut1_node}
76 | | ...                                                | ${dut2_node}
77 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
78 | | ...                                          | ${tg_to_dut2}
79
80 | Vpp forwards packets via L2 bridge domain in circular topology with static L2FIB entries
81 | | [Documentation] | Create bridge domains (learning disabled) on two VPP
82 | | ...             | nodes, add two interfaces to each bridge domain and set
83 | | ...             | static L2FIB entry on each interface and check traffic
84 | | ...             | bidirectionally.
85 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
86 | | Given Path for 3-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
87 | | ...                                     | ${nodes['DUT2']}
88 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
89 | | ...                                       | learn=${FALSE}
90 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
91 | | ...                                     | ${bd_id1}
92 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
93 | | ...                                     | ${bd_id1}
94 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
95 | | ...                                                | ${tg_to_dut1}
96 | | ...                                                | ${dut1_node}
97 | | ...                                                | ${dut1_to_tg}
98 | | ...                                                | ${bd_id1}
99 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
100 | | ...                                                | ${tg_to_dut2}
101 | | ...                                                | ${dut1_node}
102 | | ...                                                | ${dut1_to_dut2}
103 | | ...                                                | ${bd_id1}
104 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
105 | | ...                                      | learn=${FALSE}
106 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
107 | | ...                                     | ${bd_id2}
108 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
109 | | ...                                     | ${bd_id2}
110 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
111 | | ...                                                | ${tg_to_dut1}
112 | | ...                                                | ${dut2_node}
113 | | ...                                                | ${dut2_to_dut1}
114 | | ...                                                | ${bd_id2}
115 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
116 | | ...                                                | ${tg_to_dut2}
117 | | ...                                                | ${dut2_node}
118 | | ...                                                | ${dut2_to_tg}
119 | | ...                                                | ${bd_id2}
120 | | And Interfaces on all VPP nodes in the path are up | ${dut1_node}
121 | | ...                                                | ${dut2_node}
122 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
123 | | ...                                          | ${tg_to_dut2}
124
125 | VPP forwards packets through VM via two L2 bridge domains
126 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
127 | | ...             | interfaces and check packet forwarding through VM via two
128 | | ...             | L2 bridge domains with learning enabled.
129 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
130 | | Given Path for 2-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
131 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
132 | | ...                                                     | ${sock1}
133 | | ...                                                     | ${sock2}
134 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
135 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
136 | | ...                                     | ${bd_id1}
137 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
138 | | ...                                     | ${bd_id1}
139 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
140 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
141 | | ...                                     | ${bd_id2}
142 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
143 | | ...                                     | ${bd_id2}
144 | | And Interfaces on all VPP nodes in the path are up | ${dut_node}
145 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
146 | | ...                                       | ${sock2}
147 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
148 | | ...                                          | ${tg_to_dut_if2}
149 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
150 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
151
152 | VPP forwards packets through VM via two L2 bridge domains with static L2FIB entries
153 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
154 | | ...             | interfaces and check packet forwarding through VM via two
155 | | ...             | L2 bridge domains with learning disabled (static L2BFIB
156 | | ...             | entries).
157 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
158 | | Given Path for 2-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
159 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
160 | | ...                                                     | ${sock1}
161 | | ...                                                     | ${sock2}
162 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
163 | | ...                                      | learn=${FALSE}
164 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
165 | | ...                                     | ${bd_id1}
166 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
167 | | ...                                     | ${bd_id1}
168 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
169 | | ...                                                | ${tg_to_dut_if1}
170 | | ...                                                | ${dut_node}
171 | | ...                                                | ${dut_to_tg_if1}
172 | | ...                                                | ${bd_id1}
173 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
174 | | ...                                                | ${tg_to_dut_if2}
175 | | ...                                                | ${dut_node}
176 | | ...                                                | ${vhost_if1}
177 | | ...                                                | ${bd_id1}
178 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
179 | | ...                                      | learn=${FALSE}
180 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
181 | | ...                                     | ${bd_id2}
182 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
183 | | ...                                     | ${bd_id2}
184 | | And Interfaces on all VPP nodes in the path are up | ${dut_node}
185 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
186 | | ...                                                | ${tg_to_dut_if2}
187 | | ...                                                | ${dut_node}
188 | | ...                                                | ${dut_to_tg_if2}
189 | | ...                                                | ${bd_id2}
190 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
191 | | ...                                                | ${tg_to_dut_if1}
192 | | ...                                                | ${dut_node}
193 | | ...                                                | ${vhost_if2}
194 | | ...                                                | ${bd_id2}
195 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
196 | | ...                                       | ${sock2}
197 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
198 | | ...                                          | ${tg_to_dut_if2}
199 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
200 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}