FIX: Exclude softwire func tests from execution
[csit.git] / tests / vpp / func / vm_vhost / ip6 / eth2p-ethip6ipsectptlispgpe-ip6base-eth-2vhost-1vm-func.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.VPPUtil
22 | Library | resources.libraries.python.IPsecUtil
23 | Library | resources.libraries.python.VatJsonUtil
24 | Library | resources.libraries.python.IPv6Setup
25 | Library | resources.libraries.python.VhostUser
26 | Library | resources.libraries.python.QemuUtils
27 | Library | String
28 | Resource | resources/libraries/robot/shared/traffic.robot
29 | Resource | resources/libraries/robot/shared/default.robot
30 | Resource | resources/libraries/robot/shared/interfaces.robot
31 | Resource | resources/libraries/robot/shared/testing_path.robot
32 | Resource | resources/libraries/robot/ip/ip6.robot
33 | Resource | resources/libraries/robot/crypto/ipsec.robot
34 | Resource | resources/libraries/robot/vm/qemu.robot
35 | Resource | resources/libraries/robot/overlay/lispgpe.robot
36 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
37 # Import configuration and test data:
38 | Variables | resources/test_data/lisp/ipv6_lispgpe_ipv6/ipv6_lispgpe_ipsec_ipv6.py
39 | ...
40 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP | SKIP_VPP_PATCH
41 | ... | EXPECTED_FAILING
42 | ...
43 | Test Setup | Run Keywords | Set up functional test
44 | ...        | AND          | Vpp All Ra Suppress Link Layer | ${nodes}
45 | ...
46 | Test Teardown | Tear down LISP functional test with QEMU | ${vm_node}
47 | ...
48 | Documentation | *IPv6 - ip6-ipsec-lispgpe-ip6 - main fib,
49 | ... | vrf (gpe_vni-to-vrf), phy2lisp, virt2lisp*
50 | ...
51 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
52 | ... | with single links between nodes.
53 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6,\
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\
58 | ... | via VM to DUT2 where it is forwarded to TG(if2).
59 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
60
61 *** Variables ***
62 | ${dut2_spi}= | ${1000}
63 | ${dut1_spi}= | ${1001}
64
65 | ${ESP_PROTO}= | ${50}
66
67 | ${sock1}= | /tmp/sock1
68 | ${sock2}= | /tmp/sock2
69
70 | ${bid}= | 10
71
72 *** Test Cases ***
73 | TC01: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on RLOC Int.
74 | | [Documentation]
75 | | ... | [Top] TG-DUT1-DUT2-TG.
76 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMP on DUT1-DUT2, Eth-IPv6-ICMP\
77 | | ... | on TG-DUTn.
78 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
79 | | ... | IPsec in between DUTS. Create Qemu vm on DUT1 and configure bridge\
80 | | ... | between two vhosts.
81 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, virt2lisp\
82 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
83 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
84 | | ... | received packets are correct.
85 | | ... | [Ref] RFC6830, RFC4303.
86 | | ...
87 | | ${encr_alg}= | Crypto Alg AES CBC 128
88 | | ${auth_alg}= | Integ Alg SHA1 96
89 | | Given Setup Topology
90 | | And Setup Qemu DUT1
91 | | And Configure LISP GPE topology in 3-node circular topology
92 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
93 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
94 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
95 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
96 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
97 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
98 | | When Configure manual keyed connection for IPSec
99 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
100 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
101 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
102 | | And Configure manual keyed connection for IPSec
103 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
104 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
105 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
106 | | Then Send packet and verify headers
107 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
108 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
109 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
110 | | And Send packet and verify headers
111 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
112 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
113 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
114
115 | TC02: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
116 | | [Documentation]
117 | | ... | [Top] TG-DUT1-DUT2-TG.
118 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
119 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
120 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
121 | | ... | IPsec in between DUTS.
122 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, virt2lisp\
123 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
124 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
125 | | ... | received packets are correct.
126 | | ... | [Ref] RFC6830, RFC4303.
127 | | ...
128 | | ${encr_alg}= | Crypto Alg AES CBC 128
129 | | ${auth_alg}= | Integ Alg SHA1 96
130 | | Given Setup Topology
131 | | And Setup Qemu DUT1
132 | | And Configure LISP GPE topology in 3-node circular topology
133 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
134 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
135 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
136 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
137 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
138 | | ${lisp1_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
139 | | ... | ${dut1_node} | lisp_gpe0
140 | | ${lisp2_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
141 | | ... | ${dut2_node} | lisp_gpe0
142 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
143 | | When Configure manual keyed connection for IPSec
144 | | ... | ${dut1_node} | ${lisp1_if_idx} | ${encr_alg} | ${encr_key}
145 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
146 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
147 | | And Configure manual keyed connection for IPSec
148 | | ... | ${dut2_node} | ${lisp2_if_idx} | ${encr_alg} | ${encr_key}
149 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
150 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
151 | | Then Send packet and verify headers
152 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
153 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
154 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
155 | | And Send packet and verify headers
156 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
157 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
158 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
159
160 *** Keywords ***
161 | Setup Topology
162 | | Configure path in 3-node circular topology
163 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
164 | | Set interfaces in 3-node circular topology up
165 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
166 | | ... | ${prefix6}
167 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
168 | | ... | ${prefix6}
169 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6}
170 | | ... | ${prefix6}
171 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
172 | | ... | ${prefix6}
173 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6}
174 | | ... | ${prefix6}
175 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
176 | | ... | ${tg_to_dut1_mac}
177 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
178 | | ... | ${tg_to_dut2_mac}
179 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
180 | | ... | ${dut2_to_dut1_mac}
181 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
182 | | ... | ${dut1_to_dut2_mac}
183 | | Vpp All RA Suppress Link Layer | ${nodes}
184
185 | Setup Qemu DUT1
186 | | [Documentation] | Setup Vhosts on DUT1 and setup IP to one of them. Setup \
187 | | ... | Qemu and bridge the vhosts.
188 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
189 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
190 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${vhost2} | 2001:cdba:1::9
191 | | ... | ${prefix6}
192 | | Set Interface State | ${dut1_node} | ${vhost1} | up
193 | | Set Interface State | ${dut1_node} | ${vhost2} | up
194 | | Vpp RA Suppress Link Layer | ${dut1_node} | ${vhost2}
195 | | Create bridge domain | ${dut1_node} | ${bid} | learn=${TRUE}
196 | | Add interface to bridge domain | ${dut1_node}
197 | | ... | ${dut1_to_tg} | ${bid} | 0
198 | | Add interface to bridge domain | ${dut1_node}
199 | | ... | ${vhost1} | ${bid} | 0
200 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
201 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
202 | | Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} | ${sock2}