49039e9db9e8b615277203a34c3574f212374e0e
[csit.git] / tests / vpp / func / l2xc / eth2p-dot1q-l2xcbase-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/shared/default.robot
16 | Resource | resources/libraries/robot/shared/testing_path.robot
17 | Resource | resources/libraries/robot/l2/tagging.robot
18 | Resource | resources/libraries/robot/l2/l2_traffic.robot
19 | Library  | resources.libraries.python.Trace
20 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV | SKIP_VPP_PATCH
21 | Test Setup | Set up functional test
22 | Test Teardown | Tear down functional test
23 | Documentation | *L2XC with VLAN tag rewrite test cases - translate-1-1*
24 | ...
25 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
26 | ... | with single links between nodes.
27 | ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or
28 | ... | Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and DUT1-DUT2, Eth-IPv4-ICMPv4 or
29 | ... | Eth-IPv4-ICMPv4 on TG-DUT2 for L2 switching of IPv4/IPv6.
30 | ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect
31 | ... | (L2XC) switching between VLAN sub-interface with VLAN tag rewrite
32 | ... | translate-1-1 method of interface towards TG and interface towards DUT2.
33 | ... | DUT2 is configured configured with L2 cross-connect (L2XC) switching
34 | ... | between VLAN sub-interface with VLAN tag rewrite pop-1 method
35 | ... | of interface towards DUT1 and interface towards TG.
36 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are
37 | ... | sent from TG on link to DUT1 and received in TG on link form DUT2;
38 | ... | on receive TG verifies packets for correctness and their IPv4 src-addr,
39 | ... | dst-addr and MAC addresses.
40 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad.
41
42 *** Variables ***
43 | ${subid}= | 10
44
45 | ${outer_vlan_id1}= | 110
46 | ${outer_vlan_id2}= | 120
47 | ${outer_vlan_wrong}= | 150
48
49 | ${src_ip}= | 3ffe:63::1
50 | ${dst_ip}= | 3ffe:63::2
51
52 *** Test Cases ***
53 | TC01: DUT1 and DUT2 with L2XC and VLAN translate-1-1 (DUT1) switch ICMPv4 between two TG links
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \
56 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2
57 | | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN
58 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method;
59 | | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG
60 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
61 | | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag
62 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
63 | | ... | that packet is received. [Ref] IEEE 802.1q
64 | | Given Configure path in 3-node circular topology
65 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
66 | | And Set interfaces in 3-node circular topology up
67 | | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface
68 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
69 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
70 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
71 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
72 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2}
73 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
74 | | ... | ${vlan2_index} | pop-1
75 | | And Connect interfaces and VLAN sub-interfaces using L2XC
76 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
77 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
78 | | Then Send ICMP packet and verify received packet
79 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q
80 | | ... | vlan1=${outer_vlan_id1}
81
82 | TC02: DUT1 and DUT2 with L2XC and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links
83 | | [Documentation]
84 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \
85 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2
86 | | ... | cross-connect (L2XC) with one VLAN tagged sub-interface to DUT2 and
87 | | ... | one VLAN sub-interface towards TG with VLAN tag rewrite
88 | | ... | (translate-1-1) on sub-interface to DUT2; on DUT2 configure L2XC with
89 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with VLAN
90 | | ... | tag pop-1. [Ver] Make TG send ICMPv4 Echo Req tagged with one dot1q
91 | | ... | tag from one of its interfaces to another one via DUT1 and DUT2;
92 | | ... | verify that packet is not received. [Ref] IEEE 802.1q
93 | | [Tags] | SKIP_PATCH
94 | | Given Configure path in 3-node circular topology
95 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
96 | | And Set interfaces in 3-node circular topology up
97 | | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface
98 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
99 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
100 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
101 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
102 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong}
103 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
104 | | ... | ${vlan2_index} | pop-1
105 | | And Connect interfaces and VLAN sub-interfaces using L2XC
106 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
107 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
108 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
109 | | ... | Send ICMP packet and verify received packet | ${tg_node} | ${tg_to_dut1}
110 | | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1}
111
112 | TC03: DUT1 and DUT2 with L2XC and VLAN translate-1-1 (DUT1) switch ICMPv6 between two TG links
113 | | [Documentation]
114 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \
115 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2
116 | | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN
117 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method;
118 | | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG
119 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
120 | | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagegd with one Dot1q tag
121 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
122 | | ... | that packet is received. [Ref] IEEE 802.1q
123 | | Given Configure path in 3-node circular topology
124 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
125 | | And Set interfaces in 3-node circular topology up
126 | | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface
127 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
128 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
129 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
130 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
131 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2}
132 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
133 | | ... | ${vlan2_index} | pop-1
134 | | And Connect interfaces and VLAN sub-interfaces using L2XC
135 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
136 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
137 | | Then Send ICMP packet and verify received packet
138 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip}
139 | | ... | dst_ip=${dst_ip} | encaps=Dot1q | vlan1=${outer_vlan_id1}
140
141 | TC04: DUT1 and DUT2 with L2XC and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links
142 | | [Documentation]
143 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \
144 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2
145 | | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN
146 | | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method
147 | | ... | to set tag different from tag set on VLAN sub-interface of DUT2;
148 | | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG
149 | | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1
150 | | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagegd with one Dot1q tag
151 | | ... | from one of its interfaces to another one via DUT1 and DUT2; verify
152 | | ... | that packet is not received. [Ref] IEEE 802.1q
153 | | [Tags] | SKIP_PATCH
154 | | Given Configure path in 3-node circular topology
155 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
156 | | And Set interfaces in 3-node circular topology up
157 | | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface
158 | | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1}
159 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
160 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
161 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
162 | | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong}
163 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
164 | | ... | ${vlan2_index} | pop-1
165 | | And Connect interfaces and VLAN sub-interfaces using L2XC
166 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
167 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
168 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
169 | | ... | Send ICMP packet and verify received packet | ${tg_node} | ${tg_to_dut1}
170 | | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q
171 | | ... | vlan1=${outer_vlan_id1}