aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/func/ip4_tunnels/softwire/eth2p-ethip4--ethip6ip4-ip4base--ip6base-swirelw46-func.robot
blob: e78f2627f250a7f0f5344c807ecbe55ece57903a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# Copyright (c) 2019 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Resource | resources/libraries/robot/shared/default.robot
| Resource | resources/libraries/robot/shared/testing_path.robot
| Resource | resources/libraries/robot/ip/ip4.robot
| Resource | resources/libraries/robot/ip/ip6.robot
| Resource | resources/libraries/robot/ip/map.robot
| Library  | resources.libraries.python.Trace
| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO | SOFTWIRE
| Test Setup | Set up functional test
| Test Teardown | Tear down functional test
| Documentation | *Lightweight 4 over 6 test cases*
| ...
| ... | LW4o6 is a subset of MAP-E, with per-subscriber rules. It uses the
| ... | same tunneling mechanism and configuration as MAP-E. It does not use
| ... | embedded address bits.
| ...
| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
| ... | between nodes.
| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG_if1-DUT,
| ... | Eth-IPv6-IPv4-UDP on TG_if2_DUT.
| ... | *[Cfg] DUT configuration:* DUT1 is configured as lwAFTR.
| ... | *[Ver] TG verification:* Test UDP ICMP Echo Request in IPv4 are
| ... | sent to lwAFTR and are verified by TG for correctness their
| ... | encapsulation in IPv6 src-addr, dst-addr and MAC addresses.
| ... | *[Ref] Applicable standard specifications:* RFC7596 RFC7597.

*** Variables ***
| ${dut_ip4}= | 10.0.0.1
| ${dut_ip6}= | 2001:0::1
| ${tg_ip6}= | 2001:0::2
| ${ipv4_prefix_len}= | 24
| ${ipv6_prefix_len}= | 64

| ${lw_ipv4_pfx}= | 20.0.0.1/32
| ${lw_ipv6_pfx}= | 2001:1::/64
| ${lw_ipv6_src}= | 2001:1::1
| ${lw_psid_length}= | ${8}
| ${lw_psid_offset}= | ${6}
| ${lw_rule_psid}= | ${52}
| ${lw_rule_ipv6_dst}= | 2001:1::2
| ${lw_rule_2_psid}= | ${22}
| ${lw_rule_2_ipv6_dst}= | 2001:1::3
| ${test_ipv4_inside}= | 20.0.0.1
| ${test_ipv4_outside}= | 10.0.0.100
# test_port depends on psid, length, offset
| ${test_port}= | ${1232}
| ${test_icmp_id}= | ${1232}
| ${test_2_port}= | ${6232}

*** Test Cases ***
| TC01: Encapsulate IPv4 into IPv6. IPv6 dst depends on IPv4 and UDP destination
| | [Documentation]
| | ... | [Top] TG=DUT1.
| | ... | [Enc] Eth-IPv4-UDP on TG_if1-DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT.
| | ... | [Cfg] On DUT1 configure Map domain and Map rule.
| | ... | [Ver] Make TG send non-encapsulated UDP to DUT; verify TG received
| | ... |       IPv4oIPv6 encapsulated packet is correct.
| | ... | [Ref] RFC7596 RFC7597
| | ...
| | Given Configure path in 2-node circular topology
| |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And   Set interfaces in 2-node circular topology up
| | And   Configure IP addresses on interfaces
| |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
| | And   Add IP Neighbor
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
| |       ... | ${tg_to_dut_if2_mac}
| | And Vpp Route Add
| |       ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128
| |       ... | gateway=${tg_ip6} | interface=${dut_to_tg_if2} | resolve_attempts=${NONE}
| | ${domain_index}=
| | ... | When Map Add Domain
| |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
| |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
| |            ... | ${lw_psid_length}
| |       And  Map Add Rule
| |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
| |            ... | ${lw_rule_ipv6_dst}
| | Then Send IPv4 UDP and check headers for lightweight 4over6
| |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
| |      ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside}
| |      ... | ${test_port} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
| |      ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src}

TC02: Encapsulate IPv4 ICMP into IPv6. IPv6 dst depends on IPv4 addr and ICMP ID
| | [Documentation]
| | ... | [Top] TG=DUT1.
| | ... | [Enc] Eth-IPv4-ICMP(type 0 and 8) on TG_if1-DUT, Eth-IPv6-IPv4-ICMP
| | ... |       on TG_if2_DUT.
| | ... | [Cfg] On DUT1 configure Map domain and Map rule.
| | ... | [Ver] Make TG send non-encapsulated ICMP to DUT; verify TG received
| | ... |       IPv4oIPv6 encapsulated packet is correct. Checks IPv6
| | ... |       destination based on ICMP Identifier field.
| | ... | [Ref] RFC7596 section 8.1
| | ...
| | Given Configure path in 2-node circular topology
| |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And   Set interfaces in 2-node circular topology up
| | And   Configure IP addresses on interfaces
| |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
| | And   Add IP Neighbor
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
| |       ... | ${tg_to_dut_if2_mac}
| | And Vpp Route Add
| |       ... | ${dut_node} | ${lw_rule_ipv6_dst} | 128
| |       ... | gateway=${tg_ip6} | interface=${dut_to_tg_if2} | resolve_attempts=${NONE}
| | ${domain_index}=
| | ... | When Map Add Domain
| |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
| |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
| |            ... | ${lw_psid_length}
| |       And  Map Add Rule
| |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
| |            ... | ${lw_rule_ipv6_dst}
| | Then Send IPv4 ICMP and check headers for lightweight 4over6
| |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
| |      ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside}
| |      ... | ${test_icmp_id} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
| |      ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src}

TC03: Decapsulate IPv4 UDP from IPv6.
| | [Documentation]
| | ... | [Top] TG=DUT1.
| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv4-UDP on TG_if1-DUT.
| | ... | [Cfg] On DUT1 configure Map domain and Map rule.
| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received
| | ... |       IPv4 non-encapsulated packet is correct.
| | ... | [Ref] RFC7596 RFC7597
| | ...
| | Given Configure path in 2-node circular topology
| |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And   Set interfaces in 2-node circular topology up
| | And   Configure IP addresses on interfaces
| |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
| | And   Add Arp on DUT
| |       ... | ${dut_node} | ${dut_to_tg_if1}
| |       ... | ${test_ipv4_outside}
| |       ... | ${tg_to_dut_if1_mac}
| | ${domain_index}=
| | ... | When Map Add Domain
| |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
| |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
| |            ... | ${lw_psid_length}
| |       And  Map Add Rule
| |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
| |            ... | ${lw_rule_ipv6_dst}
| | Then Send IPv4 UDP in IPv6 and check headers for lightweight 4over6
| |      ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1}
| |      ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
| |      ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst}
| |      ... | ${test_ipv4_outside} | ${test_ipv4_inside} | ${test_port}
| |      ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}

TC04: Hairpinning of traffic between two lwB4
| | [Documentation]
| | ... | [Top] DUT1-TG.
| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT.
| | ... | [Cfg] On DUT1 configure Map domain and two Map rules.
| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received
| | ... |       encapsulated packet is correct.
| | ... | [Ref] RFC7596 RFC7597
| | ...
| | Given Configure path in 2-node circular topology
| |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And   Set interfaces in 2-node circular topology up
| | And   Configure IP addresses on interfaces
| |       ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len}
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len}
| | And   Add IP Neighbor
| |       ... | ${dut_node} | ${dut_to_tg_if2} | ${tg_ip6}
| |       ... | ${tg_to_dut_if2_mac}
| | And Vpp Route Add
| |       ... | ${dut_node} | ${lw_rule_2_ipv6_dst} | 128
| |       ... | gateway=${tg_ip6} | interface=${dut_to_tg_if2} | resolve_attempts=${NONE}
| | ${domain_index}=
| | ... | When Map Add Domain
| |            ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx}
| |            ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset}
| |            ... | ${lw_psid_length}
| |       And  Map Add Rule
| |            ... | ${dut_node} | ${domain_index} | ${lw_rule_psid}
| |            ... | ${lw_rule_ipv6_dst}
| |       And  Map Add Rule
| |            ... | ${dut_node} | ${domain_index} | ${lw_rule_2_psid}
| |            ... | ${lw_rule_2_ipv6_dst}
| | Then Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning
| |      ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if2}
| |      ... | ${dut_to_tg_if2_mac}
| |      ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst}
| |      ... | ${test_ipv4_inside} | ${test_ipv4_inside}
| |      ... | ${test_2_port} | ${test_port}
| |      ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac}
| |      ... | ${lw_rule_2_ipv6_dst} | ${lw_ipv6_src}