CSIT-687: Directory structure reorganization
[csit.git] / tests / vpp / func / ip4_tunnels / softwire / eth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-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/ip/ip4.robot
18 | Resource | resources/libraries/robot/ip/ip6.robot
19 | Resource | resources/libraries/robot/ip/map.robot
20 | Library  | resources.libraries.python.Trace
21 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
22 | Test Setup | Set up functional test
23 | Test Teardown | Tear down functional test
24 | Documentation | *Lightweight 4 over 6 test cases*
25 | ...
26 | ... | LW4o6 is a subset of MAP-E, with per-subscriber rules. It uses the
27 | ... | same tunneling mechanism and configuration as MAP-E. It does not use
28 | ... | embedded address bits.
29 | ...
30 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
31 | ... | between nodes.
32 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG_if1-DUT,
33 | ... | Eth-IPv6-IPv4-UDP on TG_if2_DUT.
34 | ... | *[Cfg] DUT configuration:* DUT1 is configured as lwAFTR.
35 | ... | *[Ver] TG verification:* Test UDP ICMP Echo Request in IPv4 are
36 | ... | sent to lwAFTR and are verified by TG for correctness their
37 | ... | encapsulation in IPv6 src-addr, dst-addr and MAC addresses.
38 | ... | *[Ref] Applicable standard specifications:* RFC7596 RFC7597.
39
40 *** Variables ***
41 | ${dut_ip4}= | 10.0.0.1
42 | ${dut_ip6}= | 2001:0::1
43 | ${tg_ip6}= | 2001:0::2
44 | ${ipv4_prefix_len}= | 24
45 | ${ipv6_prefix_len}= | 64
46
47 | ${lw_ipv4_pfx}= | 20.0.0.1/32
48 | ${lw_ipv6_pfx}= | 2001:1::/64
49 | ${lw_ipv6_src}= | 2001:1::1
50 | ${lw_psid_length}= | ${8}
51 | ${lw_psid_offset}= | ${6}
52 | ${lw_rule_psid}= | ${52}
53 | ${lw_rule_ipv6_dst}= | 2001:1::2
54 | ${lw_rule_2_psid}= | ${22}
55 | ${lw_rule_2_ipv6_dst}= | 2001:1::3
56 | ${test_ipv4_inside}= | 20.0.0.1
57 | ${test_ipv4_outside}= | 10.0.0.100
58 # test_port depends on psid, length, offset
59 | ${test_port}= | ${1232}
60 | ${test_icmp_id}= | ${1232}
61 | ${test_2_port}= | ${6232}
62
63 *** Test Cases ***
64 | TC01: Encapsulate IPv4 into IPv6. IPv6 dst depends on IPv4 and UDP destination
65 | | [Documentation]
66 | | ... | [Top] TG=DUT1.
67 | | ... | [Enc] Eth-IPv4-UDP on TG_if1-DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT.
68 | | ... | [Cfg] On DUT1 configure Map domain and Map rule.
69 | | ... | [Ver] Make TG send non-encapsulated UDP to DUT; verify TG received
70 | | ... |       IPv4oIPv6 encapsulated packet is correct.
71 | | ... | [Ref] RFC7596 RFC7597
72 | | ...
73 | | Given Configure path in 2-node circular topology
74 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
75 | | And   Set interfaces in 2-node circular topology up
76 | | And   Configure IP addresses on interfaces
77 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
78 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
79 | | And   Add IP Neighbor
80 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
81 | |       ... | ${tg_to_dut_if2_mac}
82 | | And Vpp Route Add
83 | |       ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128
84 | |       ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE}
85 | | ${domain_index}=
86 | | ... | When Map Add Domain
87 | |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
88 | |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
89 | |            ... | ${lw_psid_length}
90 | |       And  Map Add Rule
91 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
92 | |            ... | ${lw_rule_ipv6_dst}
93 | | Then Send IPv4 UDP and check headers for lightweight 4over6
94 | |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
95 | |      ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside}
96 | |      ... | ${test_port} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
97 | |      ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src}
98
99 TC02: Encapsulate IPv4 ICMP into IPv6. IPv6 dst depends on IPv4 addr and ICMP ID
100 | | [Documentation]
101 | | ... | [Top] TG=DUT1.
102 | | ... | [Enc] Eth-IPv4-ICMP(type 0 and 8) on TG_if1-DUT, Eth-IPv6-IPv4-ICMP
103 | | ... |       on TG_if2_DUT.
104 | | ... | [Cfg] On DUT1 configure Map domain and Map rule.
105 | | ... | [Ver] Make TG send non-encapsulated ICMP to DUT; verify TG received
106 | | ... |       IPv4oIPv6 encapsulated packet is correct. Checks IPv6
107 | | ... |       destination based on ICMP Identifier field.
108 | | ... | [Ref] RFC7596 section 8.1
109 | | ...
110 | | Given Configure path in 2-node circular topology
111 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
112 | | And   Set interfaces in 2-node circular topology up
113 | | And   Configure IP addresses on interfaces
114 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
115 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
116 | | And   Add IP Neighbor
117 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
118 | |       ... | ${tg_to_dut_if2_mac}
119 | | And Vpp Route Add
120 | |       ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128
121 | |       ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE}
122 | | ${domain_index}=
123 | | ... | When Map Add Domain
124 | |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
125 | |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
126 | |            ... | ${lw_psid_length}
127 | |       And  Map Add Rule
128 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
129 | |            ... | ${lw_rule_ipv6_dst}
130 | | Then Send IPv4 ICMP and check headers for lightweight 4over6
131 | |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
132 | |      ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside}
133 | |      ... | ${test_icmp_id} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
134 | |      ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src}
135
136 TC03: Decapsulate IPv4 UDP from IPv6.
137 | | [Documentation]
138 | | ... | [Top] TG=DUT1.
139 | | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv4-UDP on TG_if1-DUT.
140 | | ... | [Cfg] On DUT1 configure Map domain and Map rule.
141 | | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received
142 | | ... |       IPv4 non-encapsulated packet is correct.
143 | | ... | [Ref] RFC7596 RFC7597
144 | | ...
145 | | Given Configure path in 2-node circular topology
146 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
147 | | And   Set interfaces in 2-node circular topology up
148 | | And   Configure IP addresses on interfaces
149 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
150 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
151 | | And   Add Arp on DUT
152 | |       ... | ${dut_node} | ${dut_to_tg_if1}
153 | |       ... | ${test_ipv4_outside}
154 | |       ... | ${tg_to_dut_if1_mac}
155 | | ${domain_index}=
156 | | ... | When Map Add Domain
157 | |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
158 | |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
159 | |            ... | ${lw_psid_length}
160 | |       And  Map Add Rule
161 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
162 | |            ... | ${lw_rule_ipv6_dst}
163 | | Then Send IPv4 UDP in IPv6 and check headers for lightweight 4over6
164 | |      ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1}
165 | |      ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
166 | |      ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst}
167 | |      ... | ${test_ipv4_outside} | ${test_ipv4_inside} | ${test_port}
168 | |      ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
169
170 TC04: Hairpinning of traffic between two lwB4
171 | | [Documentation]
172 | | ... | [Top] DUT1-TG.
173 | | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT.
174 | | ... | [Cfg] On DUT1 configure Map domain and two Map rules.
175 | | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received
176 | | ... |       encapsulated packet is correct.
177 | | ... | [Ref] RFC7596 RFC7597
178 | | ...
179 | | Given Configure path in 2-node circular topology
180 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
181 | | And   Set interfaces in 2-node circular topology up
182 | | And   Configure IP addresses on interfaces
183 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
184 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
185 | | And   Add IP Neighbor
186 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
187 | |       ... | ${tg_to_dut_if2_mac}
188 | | And Vpp Route Add
189 | |       ... | ${dut_node} | ${lw_rule_2_ipv6_dst} | 128
190 | |       ... | ${tg_ip6} | ${dut_to_tg_if2} | resolve_attempts=${NONE}
191 | | ${domain_index}=
192 | | ... | When Map Add Domain
193 | |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
194 | |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
195 | |            ... | ${lw_psid_length}
196 | |       And  Map Add Rule
197 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
198 | |            ... | ${lw_rule_ipv6_dst}
199 | |       And  Map Add Rule
200 | |            ... | ${dut_node} | ${domain_index} | ${lw_rule_2_psid}
201 | |            ... | ${lw_rule_2_ipv6_dst}
202 | | Then Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning
203 | |      ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if2}
204 | |      ... | ${dut_to_tg_if2_mac}
205 | |      ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst}
206 | |      ... | ${test_ipv4_inside} | ${test_ipv4_inside}
207 | |      ... | ${test_2_port} | ${test_port}
208 | |      ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
209 | |      ... | ${lw_rule_2_ipv6_dst} | ${lw_ipv6_src}