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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 | Library | resources.libraries.python.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.Trace
18 | Library | resources.libraries.python.IPUtil
19 | Library | resources.libraries.python.VPPUtil
20 | Library | resources.libraries.python.InterfaceUtil
21 | Library | resources.libraries.python.VhostUser
22 | Resource | resources/libraries/robot/traffic.robot
23 | Resource | resources/libraries/robot/default.robot
24 | Resource | resources/libraries/robot/interfaces.robot
25 | Resource | resources/libraries/robot/testing_path.robot
26 | Resource | resources/libraries/robot/ipv4.robot
27 | Resource | resources/libraries/robot/vrf.robot
28 | Resource | resources/libraries/robot/qemu.robot
29 | Resource | resources/libraries/robot/bridge_domain.robot
30 | Resource | resources/libraries/robot/lisp/lispgpe.robot
31 # Import configuration and test data:
32 | Variables | resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py
34 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP
36 | Test Setup | Run Keywords | Setup all DUTs before test
37 | ... | AND | Setup all TGs before traffic script
38 | ... | AND | Update All Interface Data On All Nodes | ${nodes}
39 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
40 | ... | AND | Show vpp trace dump on all DUTs
41 | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
42 | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
44 | Documentation | *ip4-lispgpe-ip4 encapsulation test cases*
46 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
47 | ... | with single links between nodes.
48 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2,\
49 | ... | Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel.
50 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4\
51 | ... | routing and static routes. LISPoIPv4 tunnel is configured between\
52 | ... | DUT1 and DUT2.
53 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in\
54 | ... | both directions by TG on links to DUT1 and DUT2; on receive\
55 | ... | TG verifies packets for correctness and their IPv4 src-addr, dst-addr\
56 | ... | and MAC addresses.
57 | ... | *[Ref] Applicable standard specifications:* RFC6830.
60 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using physical interfaces
62 | | ... | [Top] TG-DUT1-DUT2-TG.
63 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on\
65 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
66 | | ... | [Ver] Case: ip4-lispgpe-ip4 - phy2lisp
67 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
68 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
69 | | ... | received packets are correct.
70 | | ... | [Ref] RFC6830.
72 | | Given Path for 3-node testing is set
73 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
74 | | And Interfaces in 3-node path are up
75 | | And IP addresses are set on interfaces
76 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
77 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
78 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
79 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
80 | | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
81 | | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
82 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
83 | | ... | ${tg_to_dut2_mac}
84 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
85 | | ... | ${tg_to_dut1_mac}
86 | | When Set up LISP GPE topology
87 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
88 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
89 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
90 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
91 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
92 | | Then Send Packet And Check Headers
93 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
94 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
95 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
96 | | And Send Packet And Check Headers
97 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
98 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
99 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
101 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using physical interfaces and VRF is enabled
103 | | ... | [Top] TG-DUT1-DUT2-TG.
104 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on\
106 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
107 | | ... | [Ver] Case: ip4-lispgpe-ip4 - vrf, phy2lisp
108 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
109 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
110 | | ... | received packets are correct.
111 | | ... | [Ref] RFC6830.
113 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
114 | | ... | AND | Show vpp trace dump on all DUTs
115 | | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
116 | | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
118 | | Given Path for 3-node testing is set
119 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
120 | | And Interfaces in 3-node path are up
121 | | And Assign Interface To Fib Table | ${dut1_node}
122 | | ... | ${dut1_to_tg} | ${fib_table_1}
123 | | And Assign Interface To Fib Table | ${dut2_node}
124 | | ... | ${dut2_to_tg} | ${fib_table_1}
125 | | Add IP Neighbors | ${fib_table_1}
126 | | And IP addresses are set on interfaces
127 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
128 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
129 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
130 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
131 | | When Set up LISP GPE topology
132 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
133 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
134 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
135 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
136 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
137 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
138 | | Then Send Packet And Check Headers
139 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
140 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
141 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
142 | | And Send Packet And Check Headers
143 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
144 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
145 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
147 | TC03: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using vhost interfaces
149 | | ... | [Top] TG-DUT1-DUT2-TG.
150 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on\
152 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
153 | | ... | [Ver] Case: ip4-lispgpe-ip4 - main fib, virt2lisp
154 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
155 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
156 | | ... | received packets are correct.
158 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
159 | | ... | AND | Show vpp trace dump on all DUTs
160 | | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
161 | | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
162 | | ... | AND | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
164 | | Given Path for 3-node testing is set
165 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
166 | | And Interfaces in 3-node path are up
167 | | And IP addresses are set on interfaces
168 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
169 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
170 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
171 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
172 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
173 | | ... | ${tg_to_dut1_mac}
174 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
175 | | ... | ${tg_to_dut2_mac}
176 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
177 | | ... | ${dut2_to_dut1_mac}
178 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
179 | | ... | ${dut1_to_dut2_mac}
180 | | When Set up LISP GPE topology
181 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
182 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
183 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
184 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
185 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
186 | | And Setup Qemu DUT1
187 | | Then Send Packet And Check Headers
188 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
189 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
190 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
191 | | And Send Packet And Check Headers
192 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
193 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
194 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
196 | TC04: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using vhost interfaces and VRF is enabled
198 | | ... | [Top] TG-DUT1-DUT2-TG.
199 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on\
201 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
202 | | ... | [Ver] Case: ip4-lispgpe-ip4 - vrf, virt2lisp
203 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
204 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
205 | | ... | received packets are correct.
206 | | ... | [Ref] RFC6830.
208 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
209 | | ... | AND | Show vpp trace dump on all DUTs
210 | | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
211 | | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
212 | | ... | AND | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
214 | | Given Path for 3-node testing is set
215 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
216 | | And Interfaces in 3-node path are up
217 | | And Assign Interface To Fib Table | ${dut1_node}
218 | | ... | ${dut1_to_tg} | ${fib_table_1}
219 | | And Assign Interface To Fib Table | ${dut2_node}
220 | | ... | ${dut2_to_tg} | ${fib_table_1}
221 | | Add IP Neighbors | ${fib_table_1}
222 | | And IP addresses are set on interfaces
223 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
224 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
225 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
226 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
227 | | When Set up LISP GPE topology
228 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
229 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
230 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
231 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
232 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
233 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
234 | | And Setup Qemu DUT1 | ${fib_table_1}
235 | | Then Send Packet And Check Headers
236 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
237 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
238 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
239 | | And Send Packet And Check Headers
240 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
241 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
242 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
246 | | [Documentation] | Setup Vhosts on DUT1 and setup IP on one of them. Setup\
247 | | ... | Qemu and bridge the vhosts. Optionally, you can set fib table ID\
248 | | ... | where the vhost2 interface should be assigned to.
250 | | [Arguments] | ${fib_table}=0
252 | | ${vhost1}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
253 | | ${vhost2}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
254 | | Set Interface Address | ${dut1_node} | ${vhost2} | ${vhost_ip} | ${prefix4}
255 | | Assign Interface To Fib Table | ${dut1_node}
256 | | ... | ${vhost2} | ${fib_table}
257 | | Set Interface State | ${dut1_node} | ${vhost1} | up
258 | | Set Interface State | ${dut1_node} | ${vhost2} | up
259 | | Bridge domain on DUT node is created | ${dut1_node} | ${bid} | learn=${TRUE}
260 | | Interface is added to bridge domain | ${dut1_node}
261 | | ... | ${dut1_to_tg} | ${bid} | 0
262 | | Interface is added to bridge domain | ${dut1_node}
263 | | ... | ${vhost1} | ${bid} | 0
264 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
265 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
266 | | VM for Vhost L2BD forwarding is setup | ${dut1_node} | ${sock1} | ${sock2}
270 | | ... | Add IP neighbors to physical interfaces on DUTs.\
271 | | ... | You can specify fib table ID for DUT-TG interfaces. Default is 0.
273 | | [Arguments] | ${fib_id}=0
274 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
275 | | ... | ${tg_to_dut1_mac} | ${fib_id}
276 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
277 | | ... | ${tg_to_dut2_mac} | ${fib_id}
278 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
279 | | ... | ${dut2_to_dut1_mac}
280 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
281 | | ... | ${dut1_to_dut2_mac}