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