csit-func-tc-naming-change - phase 1
[csit.git] / tests / func / vlan / eth2p-dot1q-l2bdbasemaclrn-vlantrans11-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/bridge_domain.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/tagging.robot
19 | Resource | resources/libraries/robot/l2_traffic.robot
20 | Library  | resources.libraries.python.Trace
21 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV
22 | Test Setup | Func Test Setup
23 | Test Teardown | Func Test Teardown
24 | Documentation | *L2BD with VLAN tag rewrite test cases - translate-1-1*
25 | ...
26 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
27 | ... | with single links between nodes.
28 | ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or
29 | ... | Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and DUT1-DUT2, Eth-IPv4-ICMPv4 or
30 | ... | Eth-IPv6-ICMPv6 on TG-DUT2 for L2 switching of IPv4/IPv6.
31 | ... | *[Cfg] DUT configuration:* DUT1 is configured with bridge domain (L2BD)
32 | ... | switching combined with MAC learning enabled and added VLAN
33 | ... | sub-interface with VLAN tag rewrite translate-1-1 method of interface
34 | ... | towards TG and interface towards DUT2. DUT2 is configured with L2
35 | ... | bridge domain (L2BD) switching between VLAN sub-interface with VLAN tag
36 | ... | rewrite pop-1 method of interface towards DUT1 and interface towards TG.
37 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are
38 | ... | sent from TG on link to DUT1 and received in TG on link form DUT2;
39 | ... | on receive TG verifies packets for correctness and their IPv4 src-addr,
40 | ... | dst-addr and MAC addresses.
41 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad.
42
43 *** Variables ***
44 | ${bd_id1}= | 1
45
46 | ${subid}= | 10
47
48 | ${outer_vlan_id1}= | 110
49 | ${outer_vlan_id2}= | 120
50 | ${outer_vlan_wrong}= | 150
51
52 | ${inner_vlan_id1}= | 210
53 | ${inner_vlan_wrong}= | 250
54
55 | ${src_ip6}= | 3ffe:63::1
56 | ${dst_ip6}= | 3ffe:63::2
57
58 *** Test Cases ***
59 | TC01: DUT1 and DUT2 with L2BD and VLAN translate-1-1 (DUT1) switch ICMPv4 between two TG links
60 | | [Documentation]
61 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \
62 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2
63 | | ... | bridge domain with one interface to DUT2 and one VLAN
64 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method;
65 | | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG
66 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
67 | | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag
68 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
69 | | ... | that packet is received. [Ref] IEEE 802.1q
70 | | Given Path for 3-node testing is set
71 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
72 | | And Interfaces in 3-node path are up
73 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
74 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
75 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
76 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
77 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
78 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2}
79 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
80 | | ... | ${vlan2_index} | pop-1
81 | | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
82 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
83 | | ...                                     | ${bd_id1}
84 | | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index}
85 | | ...                                     | ${bd_id1}
86 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1}
87 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
88 | | ...                                     | ${bd_id1}
89 | | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index}
90 | | ...                                     | ${bd_id1}
91 | | Then Send and receive ICMP Packet
92 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q
93 | | ... | vlan1=${outer_vlan_id1}
94
95 | TC02: DUT1 and DUT2 with L2BD and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links
96 | | [Documentation]
97 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \
98 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2
99 | | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN
100 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method
101 | | ... | to set tag different from tag set on VLAN sub-interface of DUT2;
102 | | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG
103 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
104 | | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag
105 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
106 | | ... | that packet is not received. [Ref] IEEE 802.1q
107 | | [Tags] | SKIP_PATCH
108 | | Given Path for 3-node testing is set
109 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
110 | | And Interfaces in 3-node path are up
111 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
112 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
113 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
114 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
115 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
116 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong}
117 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
118 | | ... | ${vlan2_index} | pop-1
119 | | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
120 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
121 | | ...                                     | ${bd_id1}
122 | | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index}
123 | | ...                                     | ${bd_id1}
124 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1}
125 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
126 | | ...                                     | ${bd_id1}
127 | | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index}
128 | | ...                                     | ${bd_id1}
129 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
130 | | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1}
131 | | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1}
132
133 | TC03: DUT1 and DUT2 with L2BD and VLAN translate-1-1 (DUT1) switch ICMPv6 between two TG links
134 | | [Documentation]
135 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \
136 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2
137 | | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN
138 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method;
139 | | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG
140 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
141 | | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag
142 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
143 | | ... | that packet is received. [Ref] IEEE 802.1q
144 | | Given Path for 3-node testing is set
145 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
146 | | And Interfaces in 3-node path are up
147 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
148 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
149 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
150 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
151 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
152 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2}
153 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
154 | | ... | ${vlan2_index} | pop-1
155 | | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
156 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
157 | | ...                                     | ${bd_id1}
158 | | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index}
159 | | ...                                     | ${bd_id1}
160 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1}
161 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
162 | | ...                                     | ${bd_id1}
163 | | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index}
164 | | ...                                     | ${bd_id1}
165 | | Then Send and receive ICMP Packet
166 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip6}
167 | | ... | dst_ip=${dst_ip6} | encaps=Dot1q | vlan1=${outer_vlan_id1}
168
169 | TC04: DUT1 and DUT2 with L2BD and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links
170 | | [Documentation]
171 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \
172 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2
173 | | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN
174 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method
175 | | ... | to set tag different from tag set on VLAN sub-interface of DUT2;
176 | | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG
177 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
178 | | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag
179 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
180 | | ... | that packet is not received. [Ref] IEEE 802.1q
181 | | [Tags] | SKIP_PATCH
182 | | Given Path for 3-node testing is set
183 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
184 | | And Interfaces in 3-node path are up
185 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
186 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
187 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
188 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
189 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
190 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong}
191 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
192 | | ... | ${vlan2_index} | pop-1
193 | | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
194 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
195 | | ...                                     | ${bd_id1}
196 | | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index}
197 | | ...                                     | ${bd_id1}
198 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1}
199 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
200 | | ...                                     | ${bd_id1}
201 | | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index}
202 | | ...                                     | ${bd_id1}
203 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
204 | | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1}
205 | | ... | ${tg_to_dut2} | src_ip=${src_ip6} | dst_ip=${dst_ip6} | encaps=Dot1q
206 | | ... | vlan1=${outer_vlan_id1}