CSIT-604: Bootstrap file for vpp-csit-verify-master-centos7-nightly
[csit.git] / tests / vpp / func / vm_vhost / ip4 / eth2p-ethip4ipsectptlispgpe-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.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 | resources.libraries.python.VPPUtil
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_ipv4/ipv6_lispgpe_ipsec_ipv4.py
39 | ...
40 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP | SKIP_VPP_PATCH
41 | ...
42 | Test Setup | Set up functional test
43 | ...
44 | Test Teardown | Tear down LISP functional test with QEMU | ${vm_node}
45 | ...
46 | Documentation | *IPv6 - ip4-ipsec-lispgpe-ip6 - main fib, vrf, virt2lisp,\
47 | ... | phy2lisp*
48 | ...
49 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
50 | ... | with single links between nodes.
51 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISPGPE-IPSec-IPv6-ICMP,\
52 | ... | Eth-IPv4-IPSec-LISPGPE-IPv6-ICMP
53 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
54 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
55 | ... | on RLOC interface or lisp_gpe0 interface.
56 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1\
57 | ... | via VM to DUT2 where it is forwarded to TG(if2).
58 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
59
60 *** Test Cases ***
61 | TC01: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on RLOC Int.
62 | | [Documentation]
63 | | ... | [Top] TG-DUT1-DUT2-TG.
64 | | ... | [Enc] Eth-IPv4-LISPGPE-IPSec-IPv6-ICMP on DUT1-DUT2, Eth-IPv6-ICMP\
65 | | ... | on TG-DUTn.
66 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
67 | | ... | IPsec in between DUTS. Create Qemu vm on DUT1 and configure bridge\
68 | | ... | between two vhosts.
69 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip6 - main fib, virt2lisp\
70 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
71 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
72 | | ... | received packets are correct.
73 | | ... | [Ref] RFC6830, RFC4303.
74 | | ...
75 | | ${encr_alg}= | Crypto Alg AES CBC 128
76 | | ${auth_alg}= | Integ Alg SHA1 96
77 | | Given Setup Topology And Lisp
78 | | And Setup Qemu DUT1
79 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
80 | | When Configure manual keyed connection for IPSec
81 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
82 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
83 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
84 | | And Configure manual keyed connection for IPSec
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
86 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
87 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
88 | | Then Send packet and verify headers
89 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
90 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
91 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
92 | | And Send packet and verify headers
93 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
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
97 | TC02: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
98 | | [Documentation]
99 | | ... | [Top] TG-DUT1-DUT2-TG.
100 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
101 | | ... | Eth-IPv6-ICMPv6, on TG-DUTn.
102 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
103 | | ... | IPsec in between DUTS.
104 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip6 - main fib, virt2lisp\
105 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
106 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
107 | | ... | received packets are correct.
108 | | ... | [Ref] RFC6830, RFC4303.
109 | | ...
110 | | ${encr_alg}= | Crypto Alg AES CBC 128
111 | | ${auth_alg}= | Integ Alg SHA1 96
112 | | Given Setup Topology And Lisp
113 | | And Setup Qemu DUT1
114 | | ${lisp1_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
115 | | ... | ${dut1_node} | ${lisp_gpe_int}
116 | | ${lisp2_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
117 | | ... | ${dut2_node} | ${lisp_gpe_int}
118 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
119 | | When Configure manual keyed connection for IPSec
120 | | ... | ${dut1_node} | ${lisp1_if_idx} | ${encr_alg} | ${encr_key}
121 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
122 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
123 | | And Configure manual keyed connection for IPSec
124 | | ... | ${dut2_node} | ${lisp2_if_idx} | ${encr_alg} | ${encr_key}
125 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
126 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
127 | | Then Send packet and verify headers
128 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
129 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
130 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
131 | | And Send packet and verify headers
132 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
133 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
134 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
135
136 *** Keywords ***
137 | Setup Topology And Lisp
138 | | [Documentation] | Setup IPs and neighbors for interfaces on DUT1 and DUT2\
139 | | ... | and then setup LISP.
140 | | [Arguments] | ${fib_table}=0 | ${vni_table}=0 | ${ip6}=${FALSE}
141 | | Configure path in 3-node circular topology
142 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
143 | | Set interfaces in 3-node circular topology up
144 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4}
145 | | ... | ${prefix4}
146 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6}
147 | | ... | ${prefix6}
148 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4}
149 | | ... | ${prefix4}
150 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6}
151 | | ... | ${prefix6}
152 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
153 | | ... | ${tg_to_dut2_mac}
154 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
155 | | ... | ${dut2_to_dut1_mac}
156 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
157 | | ... | ${dut1_to_dut2_mac}
158 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
159 | | ... | ${tg_to_dut1_mac}
160 | | Vpp All RA Suppress Link Layer | ${nodes}
161 | | Configure LISP GPE topology in 3-node circular topology
162 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
163 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
164 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
165 | | ... | ${dut1_to_dut2_ip_static_adjacency}
166 | | ... | ${dut2_to_dut1_ip_static_adjacency}
167 | | ... | ${vni_table} | ${fib_table}
168
169 | Setup Qemu DUT1
170 | | [Documentation] | Setup Vhosts on DUT1 and setup IP to one of them. Setup\
171 | | ... | Qemu and bridge the vhosts.
172 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
173 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
174 | | Set Interface Address | ${dut1_node} | ${vhost2} | ${vhost_ip} | ${prefix6}
175 | | Set Interface State | ${dut1_node} | ${vhost1} | up
176 | | Set Interface State | ${dut1_node} | ${vhost2} | up
177 | | Vpp RA Suppress Link Layer | ${dut1_node} | ${vhost2}
178 | | Create bridge domain | ${dut1_node} | ${bid} | learn=${TRUE}
179 | | Add interface to bridge domain | ${dut1_node}
180 | | ... | ${dut1_to_tg} | ${bid} | 0
181 | | Add interface to bridge domain | ${dut1_node}
182 | | ... | ${vhost1} | ${bid} | 0
183 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
184 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
185 | | Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} | ${sock2}