CSIT-56: modify honeycomb bootstrap file permissions
[csit.git] / tests / func / lisp / ipsec_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 | 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.L2Util
20 | Library | resources.libraries.python.LispUtil
21 | Library | resources.libraries.python.IPsecUtil
22 | Library | resources.libraries.python.VatJsonUtil
23 | Library | resources.libraries.python.IPv6Setup
24 | Library | resources.libraries.python.VhostUser
25 | Library | resources.libraries.python.QemuUtils
26 | Library | String
27 | Resource | resources/libraries/robot/traffic.robot
28 | Resource | resources/libraries/robot/default.robot
29 | Resource | resources/libraries/robot/interfaces.robot
30 | Resource | resources/libraries/robot/testing_path.robot
31 | Resource | resources/libraries/robot/ipv6.robot
32 | Resource | resources/libraries/robot/ipsec.robot
33 | Resource | resources/libraries/robot/qemu.robot
34 | Resource | resources/libraries/robot/lisp/lispgpe.robot
35 | Resource | resources/libraries/robot/bridge_domain.robot
36 # Import configuration and test data:
37 | Variables | resources/test_data/lisp/ipv4_lispgpe_ipv6/ipv4_lispgpe_ipsec_ipv6.py
38 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP
39 | ...
40 | Test Setup | Run Keywords | Setup all DUTs before test
41 | ...        | AND          | Setup all TGs before traffic script
42 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
43 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
44 | ...           | AND          | Show vpp trace dump on all DUTs
45 | ...           | AND          | VPP Show Errors | ${nodes['DUT1']}
46 | ...           | AND          | VPP Show Errors | ${nodes['DUT2']}
47 | ...
48 | Documentation | *IPv6 - ip4-ipsec-lispgpe-ip6 - main fib, virt2lisp, phy2lisp*
49 | ...
50 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
51 | ... | with single links between nodes.
52 | ... | *[Enc] Packet Encapsulations:*Eth-IPv6-LISPGPE-IPSec-IPv4-ICMP,\
53 | ... | Eth-IPv6-IPSec-LISPGPE-IPv4-ICMP
54 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
55 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
56 | ... | on RLOC interface or lisp_gpe0 interface.
57 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1 to\
58 | ... | DUT2 where it is forwarded to TG(if2).
59 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
60
61 *** Test Cases ***
62 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
63 | | [Documentation]
64 | | ... | [Top] TG-DUT1-DUT2-TG.
65 | | ... | [Enc] Eth-IPv6-LISPGPE-IPSec-IPv4-ICMP on DUT1-DUT2, Eth-IPv4-ICMP\
66 | | ... | on TG-DUTn.
67 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
68 | | ... | IPsec in between DUTS.
69 | | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces across\
70 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
71 | | ... | received packets are correct.
72 | | ... | [Ref] RFC6830, RFC4303.
73 | | ...
74 | | ${encr_alg}= | Crypto Alg AES CBC 128
75 | | ${auth_alg}= | Integ Alg SHA1 96
76 | | Given Setup Topology And Lisp
77 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
78 | | When VPP Setup IPsec Manual Keyed Connection
79 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
80 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
81 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
82 | | And VPP Setup IPsec Manual Keyed Connection
83 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
84 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
85 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
86 | | Then Send Packet And Check Headers
87 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
88 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
89 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
90 | | And Send Packet And Check Headers
91 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
92 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
93 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
94
95 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
96 | | [Documentation]
97 | | ... | [Top] TG-DUT1-DUT2-TG.
98 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMP\
99 | | ... | on TG-DUTn.
100 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
101 | | ... | IPsec in between DUTS.
102 | | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces across\
103 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
104 | | ... | received packets are correct.
105 | | ... | [Ref] RFC6830, RFC4303.
106 | | ...
107 | | ${encr_alg}= | Crypto Alg AES CBC 128
108 | | ${auth_alg}= | Integ Alg SHA1 96
109 | | Given Setup Topology And Lisp
110 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
111 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
112 | | ... | ${dut1_node} | ${lisp_gpe_int}
113 | | When VPP Setup IPsec Manual Keyed Connection
114 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
115 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
116 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
117 | | And VPP Setup IPsec Manual Keyed Connection
118 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
119 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
120 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
121 | | Then Send Packet And Check Headers
122 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
123 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
124 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
125 | | And Send Packet And Check Headers
126 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
127 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
128 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
129
130 | TC03: DUT1 and DUT2 route IPv4 over Vhost to LISP GPE tunnel using IPsec (transport) on RLOC Int.
131 | | [Documentation]
132 | | ... | [Top] TG-DUT1-DUT2-TG.
133 | | ... | [Enc] Eth-IPv6-LISPGPE-IPSec-IPv4-ICMP on DUT1-DUT2, Eth-IPv4-ICMP\
134 | | ... | on TG-DUTn.
135 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
136 | | ... | IPsec in between DUTS. Create Qemu vm on DUT1 and configure bridge\
137 | | ... | between two vhosts.
138 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip4 - main fib, virt2lisp\
139 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
140 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
141 | | ... | received packets are correct.
142 | | ... | [Ref] RFC6830, RFC4303.
143 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
144 | | ...           | AND       | Show vpp trace dump on all DUTs
145 | | ...           | AND       | VPP Show Errors | ${nodes['DUT1']}
146 | | ...           | AND       | VPP Show Errors | ${nodes['DUT2']}
147 | | ...           | AND       | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
148 | | ...
149 | | ${encr_alg}= | Crypto Alg AES CBC 128
150 | | ${auth_alg}= | Integ Alg SHA1 96
151 | | Given Setup Topology And Lisp
152 | | And Setup Qemu DUT1
153 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
154 | | When VPP Setup IPsec Manual Keyed Connection
155 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
156 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
157 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
158 | | And VPP Setup IPsec Manual Keyed Connection
159 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
160 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
161 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
162 | | Then Send Packet And Check Headers
163 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
164 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
165 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
166 | | And Send Packet And Check Headers
167 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
168 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
169 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
170
171 | TC04: DUT1 and DUT2 route IPv4 over Vhost to LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
172 | | [Documentation]
173 | | ... | [Top] TG-DUT1-DUT2-TG.
174 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
175 | | ... | Eth-IPv6-ICMPv6, on TG-DUTn.
176 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
177 | | ... | IPsec in between DUTS.
178 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip4 - main fib, virt2lisp\
179 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
180 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
181 | | ... | received packets are correct.
182 | | ... | [Ref] RFC6830, RFC4303.
183 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
184 | | ...           | AND       | Show vpp trace dump on all DUTs
185 | | ...           | AND       | VPP Show Errors | ${nodes['DUT1']}
186 | | ...           | AND       | VPP Show Errors | ${nodes['DUT2']}
187 | | ...           | AND       | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
188 | | ...
189 | | ${encr_alg}= | Crypto Alg AES CBC 128
190 | | ${auth_alg}= | Integ Alg SHA1 96
191 | | Given Setup Topology And Lisp
192 | | And Setup Qemu DUT1
193 | | ${lisp1_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
194 | | ... | ${dut1_node} | ${lisp_gpe_int}
195 | | ${lisp2_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
196 | | ... | ${dut2_node} | ${lisp_gpe_int}
197 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
198 | | When VPP Setup IPsec Manual Keyed Connection
199 | | ... | ${dut1_node} | ${lisp1_if_idx} | ${encr_alg} | ${encr_key}
200 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
201 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
202 | | And VPP Setup IPsec Manual Keyed Connection
203 | | ... | ${dut2_node} | ${lisp2_if_idx} | ${encr_alg} | ${encr_key}
204 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
205 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
206 | | Then Send Packet And Check Headers
207 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
208 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
209 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
210 | | And Send Packet And Check Headers
211 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
212 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
213 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
214
215 *** Keywords ***
216 | Setup Topology And Lisp
217 | | [Documentation] | Setup IPs and neighbors for interfaces on DUT1 and DUT2\
218 | | ... | and then setup LISP.
219 | | Path for 3-node testing is set
220 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
221 | | Interfaces in 3-node path are up
222 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
223 | | ... | ${prefix6}
224 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
225 | | ... | ${prefix6}
226 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4}
227 | | ... | ${prefix4}
228 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
229 | | ... | ${prefix6}
230 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4}
231 | | ... | ${prefix4}
232 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
233 | | ... | ${tg_to_dut2_mac}
234 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
235 | | ... | ${dut2_to_dut1_mac}
236 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
237 | | ... | ${dut1_to_dut2_mac}
238 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
239 | | ... | ${tg_to_dut1_mac}
240 | | Set up LISP GPE topology
241 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
242 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
243 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
244 | | ... | ${dut1_to_dut2_ip_static_adjacency}
245 | | ... | ${dut2_to_dut1_ip_static_adjacency}
246
247 | Setup Qemu DUT1
248 | | [Documentation] | Setup Vhosts on DUT1 and setup IP to one of them. Setup\
249 | | ... | Qemu and bridge the vhosts.
250 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
251 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
252 | | Set Interface Address | ${dut1_node} | ${vhost2} | ${vhost_ip} | ${prefix4}
253 | | Set Interface State | ${dut1_node} | ${vhost1} | up
254 | | Set Interface State | ${dut1_node} | ${vhost2} | up
255 | | Bridge domain on DUT node is created | ${dut1_node} | ${bid} | learn=${TRUE}
256 | | Interface is added to bridge domain | ${dut1_node}
257 | | ... | ${dut1_to_tg} | ${bid} | 0
258 | | Interface is added to bridge domain | ${dut1_node}
259 | | ... | ${vhost1} | ${bid} | 0
260 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
261 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
262 | | VM for Vhost L2BD forwarding is setup | ${dut1_node} | ${sock1} | ${sock2}