9cb60cba537759bac8b77971b7382420de3dd4d7
[csit.git] / tests / suites / lisp / lisp_dataplane_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/testing_path.robot
17 | Resource | resources/libraries/robot/ipv4.robot
18 | Resource | resources/libraries/robot/traffic.robot
19 | Resource | resources/libraries/robot/lisp/lisp_static_mapping.robot
20 | Resource | resources/libraries/robot/l2_traffic.robot
21 | Library  | resources.libraries.python.IPUtil
22 | Library  | resources.libraries.python.Trace
23 | Library  | resources.libraries.python.IPv4Util.IPv4Util
24 # import additional Lisp settings from resource file
25 | Variables | tests/suites/lisp/resources/lisp_static_mapping.py
26 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
27 | ... | VM_ENV | HW_ENV
28 | Test Setup | Run Keywords | Setup all DUTs before test
29 | ...        | AND          | Setup all TGs before traffic script
30 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
31 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
32 | Documentation | *LISP static remote mapping test cases*
33 | ...
34 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
35 | ... | with single links between nodes.
36 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2,
37 | ... | Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel;
38 | ... | Eth-IPv6-LISP-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn for
39 | ... | IPv6 routing over LISPoIPv6 tunnel; Eth-IPv6-LISP-IPv4-ICMPv4 on
40 | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv6
41 | ... | tunnel; Eth-IPv4-LISP-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on
42 | ... | TG-DUTn for IPv6 routing over LISPoIPv4 tunnel.
43 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4 (IPv6)
44 | ... | routing and static routes. LISPoIPv4 (oIPv6) tunnel is configured
45 | ... | between DUT1 and DUT2.
46 | ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets
47 | ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive
48 | ... | TG verifies packets for correctness and their IPv4 (IPv6) src-addr,
49 | ... | dst-addr and MAC addresses.
50 | ... | *[Ref] Applicable standard specifications:* RFC6830.
51
52 *** Test Cases ***
53 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISPoIPv4 tunnel
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv4-ICMPv4 on \
56 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2
57 | | ... | configure IPv4 LISP remote static mappings. [Ver] Make TG send
58 | | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP
59 | | ... | tunnel between them; verify IPv4 headers on received packets are
60 | | ... | correct. [Ref] RFC6830.
61 | | Given Path for 3-node testing is set
62 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
63 | | And   Interfaces in 3-node path are up
64 | | And   IP addresses are set on interfaces
65 | |       ... | ${dut1_node} | ${dut1_to_dut2}
66 | |       ... | ${dut1_to_dut2_ip4} | ${prefix4}
67 | |       ... | ${dut1_node} | ${dut1_to_tg}
68 | |       ... | ${dut1_to_tg_ip4} | ${prefix4}
69 | |       ... | ${dut2_node} | ${dut2_to_dut1}
70 | |       ... | ${dut2_to_dut1_ip4} | ${prefix4}
71 | |       ... | ${dut2_node} | ${dut2_to_tg}
72 | |       ... | ${dut2_to_tg_ip4} | ${prefix4}
73 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
74 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
75 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
76 | |       ... | ${tg_to_dut2_mac}
77 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
78 | |       ... | ${tg_to_dut1_mac}
79 | | When Set up Lisp topology
80 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
81 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
82 | |      ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
83 | |      ... | ${dut1_ip4_static_mapping} | ${dut2_ip4_static_mapping}
84 | | Then Send Packet And Check Headers
85 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
86 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
87 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
88 | | And Send Packet And Check Headers
89 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
90 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
91 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
92
93 | TC02: DUT1 and DUT2 route IPv6 bidirectionally over LISPoIPv6 tunnel
94 | | [Documentation]
95 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-LISP-IPv6-ICMPv6 on \
96 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 and DUT2
97 | | ... | configure IPv6 LISP remote static mappings. [Ver] Make TG send
98 | | ... | ICMPv6 Echo Req between its interfaces across both DUTs and LISP
99 | | ... | tunnel between them; verify IPv4 headers on received packets are
100 | | ... | correct. [Ref] RFC6830.
101 | | Given Path for 3-node testing is set
102 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
103 | | And   Interfaces in 3-node path are up
104 | | And   IP addresses are set on interfaces
105 | |       ... | ${dut1_node} | ${dut1_to_dut2}
106 | |       ... | ${dut1_to_dut2_ip6} | ${prefix6}
107 | |       ... | ${dut1_node} | ${dut1_to_tg}
108 | |       ... | ${dut1_to_tg_ip6} | ${prefix6}
109 | |       ... | ${dut2_node} | ${dut2_to_dut1}
110 | |       ... | ${dut2_to_dut1_ip6} | ${prefix6}
111 | |       ... | ${dut2_node} | ${dut2_to_tg}
112 | |       ... | ${dut2_to_tg_ip6} | ${prefix6}
113 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
114 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
115 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
116 | |       ... | ${tg_to_dut2_mac}
117 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
118 | |       ... | ${tg_to_dut1_mac}
119 | | When Set up Lisp topology
120 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
121 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
122 | |      ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
123 | |      ... | ${dut1_ip6_static_mapping} | ${dut2_ip6_static_mapping}
124 | | Then Send Packet And Check Headers
125 | |      ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
126 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
127 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
128 | | And Send Packet And Check Headers
129 | |      ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
130 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
131 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
132
133 | TC03: DUT1 and DUT2 route IPv4 bidirectionally over LISPoIPv6 tunnel
134 | | [Documentation]
135 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-LISP-IPv4-ICMPv4 on \
136 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2
137 | | ... | configure IPv6 LISP remote static mappings. [Ver] Make TG send
138 | | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP
139 | | ... | tunnel between them; verify IPv4 headers on received packets are
140 | | ... | correct. [Ref] RFC6830.
141 | | Given Path for 3-node testing is set
142 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
143 | | And   Interfaces in 3-node path are up
144 | | And   IP addresses are set on interfaces
145 | |       ... | ${dut1_node} | ${dut1_to_dut2}
146 | |       ... | ${dut1_to_dut2_ip4o6} | ${dut_prefix4o6}
147 | |       ... | ${dut1_node} | ${dut1_to_tg}
148 | |       ... | ${dut1_to_tg_ip4o6} | ${tg_prefix4o6}
149 | |       ... | ${dut2_node} | ${dut2_to_dut1}
150 | |       ... | ${dut2_to_dut1_ip4o6} | ${dut_prefix4o6}
151 | |       ... | ${dut2_node} | ${dut2_to_tg}
152 | |       ... | ${dut2_to_tg_ip4o6} | ${tg_prefix4o6}
153 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4o6}
154 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4o6}
155 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4o6}
156 | |       ... | ${tg_to_dut2_mac}
157 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4o6}
158 | |       ... | ${tg_to_dut1_mac}
159 | | When Set up Lisp topology
160 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
161 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
162 | |      ... | ${duts_locator_set} | ${dut1_ip4o6_eid} | ${dut2_ip4o6_eid}
163 | |      ... | ${dut1_ip4o6_static_mapping} | ${dut2_ip4o6_static_mapping}
164 | | Then Send Packet And Check Headers
165 | |      ... | ${tg_node} | ${tg1_ip4o6} | ${tg2_ip4o6}
166 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
167 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
168 | | And Send Packet And Check Headers
169 | |      ... | ${tg_node} | ${tg2_ip4o6} | ${tg1_ip4o6}
170 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
171 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
172
173 | TC04: DUT1 and DUT2 route IPv6 bidirectionally over LISPoIPv4 tunnel
174 | | [Documentation]
175 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv6-ICMPv6 on \
176 | | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 and DUT2
177 | | ... | configure IPv4 LISP remote static mappings. [Ver] Make TG send
178 | | ... | ICMPv6 Echo Req between its interfaces across both DUTs and LISP
179 | | ... | tunnel between them; verify IPv4 headers on received packets are
180 | | ... | correct. [Ref] RFC6830.
181 | | Given Path for 3-node testing is set
182 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
183 | | And   Interfaces in 3-node path are up
184 | | And   IP addresses are set on interfaces
185 | |       ... | ${dut1_node} | ${dut1_to_dut2}
186 | |       ... | ${dut1_to_dut2_ip6o4} | ${dut_prefix6o4}
187 | |       ... | ${dut1_node} | ${dut1_to_tg}
188 | |       ... | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4}
189 | |       ... | ${dut2_node} | ${dut2_to_dut1}
190 | |       ... | ${dut2_to_dut1_ip6o4} | ${dut_prefix6o4}
191 | |       ... | ${dut2_node} | ${dut2_to_tg}
192 | |       ... | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4}
193 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4}
194 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4}
195 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4}
196 | |       ... | ${tg_to_dut2_mac}
197 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4}
198 | |       ... | ${tg_to_dut1_mac}
199 | | When Set up Lisp topology
200 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
201 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
202 | |      ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid}
203 | |      ... | ${dut1_ip6o4_static_mapping} | ${dut2_ip6o4_static_mapping}
204 | | Then Send Packet And Check Headers
205 | |      ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
206 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
207 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
208 | | And Send Packet And Check Headers
209 | |      ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
210 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
211 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
212
213 | TC05: DUT1 and DUT2 route IPv4 over LISPoIPv4 tunnel after disable-enable
214 | | [Documentation]
215 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv4-ICMPv4 on \
216 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg1] On DUT1 and DUT2
217 | | ... | configure IPv4 LISP remote static mappings. [Ver1] Make TG send
218 | | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP
219 | | ... | tunnel between them; verify IPv4 headers on received packets are
220 | | ... | correct. [Cfg2] Disable LISP. [Ver2] verify packets are not
221 | | ... | received via LISP tunnel. [Cfg3] Re-enable LISP. [Ver3] verify
222 | | ... | packets are received again via LISP tunnel. [Ref] RFC6830.
223 | | Given Path for 3-node testing is set
224 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
225 | | And   Interfaces in 3-node path are up
226 | | And   IP addresses are set on interfaces
227 | |       ... | ${dut1_node} | ${dut1_to_dut2}
228 | |       ... | ${dut1_to_dut2_ip4} | ${prefix4}
229 | |       ... | ${dut1_node} | ${dut1_to_tg}
230 | |       ... | ${dut1_to_tg_ip4} | ${prefix4}
231 | |       ... | ${dut2_node} | ${dut2_to_dut1}
232 | |       ... | ${dut2_to_dut1_ip4} | ${prefix4}
233 | |       ... | ${dut2_node} | ${dut2_to_tg}
234 | |       ... | ${dut2_to_tg_ip4} | ${prefix4}
235 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
236 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
237 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
238 | |       ... | ${tg_to_dut2_mac}
239 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
240 | |       ... | ${tg_to_dut1_mac}
241 | | When Set up Lisp topology
242 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
243 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
244 | |      ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
245 | |      ... | ${dut1_ip4_static_mapping} | ${dut2_ip4_static_mapping}
246 | | Then Send Packet And Check Headers
247 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
248 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
249 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
250 | | And Send Packet And Check Headers
251 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
252 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
253 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
254 | | When Disable Lisp | ${dut1_node}
255 | | Then Send packet from Port to Port should failed
256 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
257 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
258 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
259 | | And Send packet from Port to Port should failed
260 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
261 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
262 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
263 | | When Enable Lisp | ${dut1_node}
264 | | Then Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers
265 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
266 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
267 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
268 | | And Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers
269 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
270 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
271 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}