f6596ba48bd4cfa4ef75c416facaa8ba05479c2e
[csit.git] / tests / func / lisp / ipv4_lispgpe_ipv6.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_adjacency.robot
20 | Resource | resources/libraries/robot/l2_traffic.robot
21 | Resource | resources/libraries/robot/lisp/lispgpe.robot
22 | Resource | resources/libraries/robot/bridge_domain.robot
23 | Resource | resources/libraries/robot/qemu.robot
24 | Library  | resources.libraries.python.IPUtil
25 | Library | resources.libraries.python.VhostUser
26 | Library  | resources.libraries.python.Trace
27 | Library  | resources.libraries.python.VPPUtil
28 # import additional Lisp settings from resource file
29 | Variables | resources/test_data/lisp/static_adjacency/lisp_static_adjacency.py
30 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
31 | ... | VM_ENV | HW_ENV
32 | Test Setup | Run Keywords | Setup all DUTs before test
33 | ...        | AND          | Setup all TGs before traffic script
34 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
35 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
36 | ...           | AND          | Show vpp trace dump on all DUTs
37 | Documentation | *LISP static adjacency test cases*
38 | ...
39 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
40 | ... | with single links between nodes.
41 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv6-ICMPv6 on DUT1-DUT2,\
42 | ... | Eth-IPv6-ICMPv6 on TG-DUTn for IPv6 routing over LISPoIPv4 tunnel.
43 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv6\
44 | ... | routing and static routes. LISPoIPv4 tunnel is configured\
45 | ... | between DUT1 and DUT2.
46 | ... | *[Ver] TG verification:* Test 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 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 IPv6 bidirectionally over LISPoIPv4 tunnel
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG.
56 | | ... | [Enc] Eth-IPv4-LISP-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on\
57 | | ... | TG-DUTn.
58 | | ... | [Cfg] On DUT1 and DUT2 configure IPv4 LISP static adjacencies.
59 | | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces across both\
60 | | ... | DUTs and LISP tunnel between them; verify IPv6 headers on received\
61 | | ... | packets are correct.
62 | | ... | [Cfg2] Reconf LISP.
63 | | ... | [Ver2] Verify packets are received again via LISP tunnel.
64 | | ... | [Ref] RFC6830.
65 | | Given Path for 3-node testing is set
66 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
67 | | And Interfaces in 3-node path are up
68 | | And IP addresses are set on interfaces
69 | | ... | ${dut1_node} | ${dut1_to_dut2}
70 | | ... | ${dut1_to_dut2_ip6o4} | ${dut_prefix6o4}
71 | | ... | ${dut1_node} | ${dut1_to_tg}
72 | | ... | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4}
73 | | ... | ${dut2_node} | ${dut2_to_dut1}
74 | | ... | ${dut2_to_dut1_ip6o4} | ${dut_prefix6o4}
75 | | ... | ${dut2_node} | ${dut2_to_tg}
76 | | ... | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4}
77 | | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4}
78 | | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4}
79 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4}
80 | | ... | ${tg_to_dut2_mac}
81 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4}
82 | | ... | ${tg_to_dut1_mac}
83 | | When Set up Lisp topology
84 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
86 | | ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid}
87 | | ... | ${dut1_ip6o4_static_adjacency} | ${dut2_ip6o4_static_adjacency}
88 | | Then Send Packet And Check Headers
89 | | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
90 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
91 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
92 | | And Send Packet And Check Headers
93 | | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
94 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
95 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
96 | | When Change Lisp Configuration | ${dut1_node} | ${dut2_node}
97 | | ... | ${dut1_to_dut2} | ${dut2_to_dut1} | ${dut1_to_dut2_mac}
98 | | ... | ${dut2_to_dut1_mac} | ${dut1_to_dut2_ip6o4}
99 | | ... | ${dut2_to_dut1_ip6o4_reconf} | ${dut_prefix6o4}
100 | | ... | ${dut1_ip6o4_static_adjacency}
101 | | ... | ${dut1_ip6o4_static_adjacency_reconf}
102 | | Then Send Packet And Check Headers
103 | | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
104 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
105 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
106 | | And Send Packet And Check Headers
107 | | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
108 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
109 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
110
111 | TC02: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using physical interfaces and VRF is enabled
112 | | [Documentation]
113 | | ... | [Top] TG-DUT1-DUT2-TG.
114 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on\
115 | | ... | TG-DUTn.
116 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
117 | | ... | [Ver] Case: ip6-lispgpe-ip4 - vrf, phy2lisp
118 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
119 | | ... | DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
120 | | ... | received packets are correct.
121 | | ... | [Ref] RFC6830.
122 | | ...
123 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
124 | | ... | AND | Show vpp trace dump on all DUTs
125 | | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
126 | | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
127 | | ...
128 | | Given Path for 3-node testing is set
129 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
130 | | And Interfaces in 3-node path are up
131 | | And Assign Interface To Fib Table | ${dut1_node}
132 | | ... | ${dut1_to_tg} | ${fib_table_1} | ip6=${TRUE}
133 | | And Assign Interface To Fib Table | ${dut2_node}
134 | | ... | ${dut2_to_tg} | ${fib_table_1} | ip6=${TRUE}
135 | | And Add IP Neighbors | ${fib_table_1}
136 | | And IP addresses are set on interfaces
137 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6o4}
138 | | ... | ${dut_prefix6o4}
139 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4}
140 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6o4}
141 | | ... | ${dut_prefix6o4}
142 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4}
143 | | When Set up LISP GPE topology
144 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
145 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
146 | | ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid}
147 | | ... | ${dut1_ip6o4_static_adjacency}
148 | | ... | ${dut2_ip6o4_static_adjacency}
149 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
150 | | Then Send Packet And Check Headers
151 | | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
152 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
153 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
154 | | And Send Packet And Check Headers
155 | | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
156 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
157 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
158
159 | TC03: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using vhost interfaces
160 | | [Documentation]
161 | | ... | [Top] TG-DUT1-DUT2-TG.
162 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on\
163 | | ... | TG-DUTn.
164 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
165 | | ... | [Ver] Case: ip6-lispgpe-ip4 - main fib, virt2lisp
166 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across both\
167 | | ... | DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
168 | | ... | received packets are correct.
169 | | ...
170 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
171 | | ... | AND | Show vpp trace dump on all DUTs
172 | | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
173 | | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
174 | | ... | AND | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
175 | | ...
176 | | Given Path for 3-node testing is set
177 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
178 | | And Interfaces in 3-node path are up
179 | | And IP addresses are set on interfaces
180 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6o4}
181 | | ... | ${dut_prefix6o4}
182 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4}
183 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6o4}
184 | | ... | ${dut_prefix6o4}
185 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4}
186 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4}
187 | | ... | ${tg_to_dut1_mac}
188 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4}
189 | | ... | ${tg_to_dut2_mac}
190 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4}
191 | | ... | ${dut2_to_dut1_mac}
192 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4}
193 | | ... | ${dut1_to_dut2_mac}
194 | | When Set up LISP GPE topology
195 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
196 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
197 | | ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid}
198 | | ... | ${dut1_ip6o4_static_adjacency}
199 | | ... | ${dut2_ip6o4_static_adjacency}
200 | | And Setup Qemu DUT1
201 | | Then Send Packet And Check Headers
202 | | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
203 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
204 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
205 | | And Send Packet And Check Headers
206 | | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
207 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
208 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
209
210
211 *** Keywords ***
212 | Add IP Neighbors
213 | | [Documentation]
214 | | ... | Add IP neighbors to physical interfaces on DUTs.\
215 | | ... | You can specify fib table ID for DUT-TG interfaces. Default is 0.
216 | | ...
217 | | [Arguments] | ${fib_id}=0
218 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4}
219 | | ... | ${tg_to_dut1_mac} | ${fib_id}
220 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4}
221 | | ... | ${tg_to_dut2_mac} | ${fib_id}
222 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4}
223 | | ... | ${dut2_to_dut1_mac}
224 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4}
225 | | ... | ${dut1_to_dut2_mac}
226
227 | Setup Qemu DUT1
228 | | [Documentation] | Setup Vhosts on DUT1 and setup IP on one of them. Setup\
229 | | ... | Qemu and bridge the vhosts.
230 | | ...
231 | | ${vhost1}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
232 | | ${vhost2}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
233 | | Set Interface Address | ${dut1_node} | ${vhost2} | ${vhost_ip} | ${prefix4}
234 | | Set Interface State | ${dut1_node} | ${vhost1} | up
235 | | Set Interface State | ${dut1_node} | ${vhost2} | up
236 | | Bridge domain on DUT node is created | ${dut1_node} | ${bid} | learn=${TRUE}
237 | | Interface is added to bridge domain | ${dut1_node}
238 | | ... | ${dut1_to_tg} | ${bid} | 0
239 | | Interface is added to bridge domain | ${dut1_node}
240 | | ... | ${vhost1} | ${bid} | 0
241 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
242 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
243 | | VM for Vhost L2BD forwarding is setup | ${dut1_node} | ${sock1} | ${sock2}