CSIT-509: Add perf tests for vlan + l2 + vhost
[csit.git] / tests / func / lisp / 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/traffic.robot
29 | Resource | resources/libraries/robot/default.robot
30 | Resource | resources/libraries/robot/interfaces.robot
31 | Resource | resources/libraries/robot/testing_path.robot
32 | Resource | resources/libraries/robot/ipv6.robot
33 | Resource | resources/libraries/robot/ipsec.robot
34 | Resource | resources/libraries/robot/qemu.robot
35 | Resource | resources/libraries/robot/lisp/lispgpe.robot
36 | Resource | resources/libraries/robot/bridge_domain.robot
37 # Import configuration and test data:
38 | Variables | resources/test_data/lisp/ipv6_lispgpe_ipv6/ipv6_lispgpe_ipsec_ipv6.py
39 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP
40 | ...
41 | Test Setup | Run Keywords | Func Test Setup
42 | ...        | AND          | Vpp All Ra Suppress Link Layer | ${nodes}
43 | Test Teardown | Func Test Teardown
44 | ...
45 | Documentation | *IPv6 - ip6-ipsec-lispgpe-ip6 - main fib,
46 | ... | vrf (gpe_vni-to-vrf), phy2lisp, virt2lisp*
47 | ...
48 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
49 | ... | with single links between nodes.
50 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6,\
51 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
52 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
53 | ... | on RLOC interface or lisp_gpe0 interface.
54 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1\
55 | ... | via VM to DUT2 where it is forwarded to TG(if2).
56 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
57
58 *** Variables ***
59 | ${dut2_spi}= | ${1000}
60 | ${dut1_spi}= | ${1001}
61
62 | ${ESP_PROTO}= | ${50}
63
64 | ${sock1}= | /tmp/sock1
65 | ${sock2}= | /tmp/sock2
66
67 | ${bid}= | 10
68
69 *** Test Cases ***
70 | TC01: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on RLOC Int.
71 | | [Documentation]
72 | | ... | [Top] TG-DUT1-DUT2-TG.
73 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMP on DUT1-DUT2, Eth-IPv6-ICMP\
74 | | ... | on TG-DUTn.
75 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
76 | | ... | IPsec in between DUTS. Create Qemu vm on DUT1 and configure bridge\
77 | | ... | between two vhosts.
78 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, virt2lisp\
79 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
80 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
81 | | ... | received packets are correct.
82 | | ... | [Ref] RFC6830, RFC4303.
83 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
84 | | ... | AND | Show vpp trace dump on all DUTs
85 | | ... | AND | VPP Show Errors | ${nodes['DUT1']}
86 | | ... | AND | VPP Show Errors | ${nodes['DUT2']}
87 | | ... | AND | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
88 | | ... | AND | Show VPP Settings | ${dut1_node}
89 | | ... | AND | Check VPP PID in Teardown
90 | | ...
91 | | ${encr_alg}= | Crypto Alg AES CBC 128
92 | | ${auth_alg}= | Integ Alg SHA1 96
93 | | Given Setup Topology
94 | | And Setup Qemu DUT1
95 | | And Set up LISP GPE topology
96 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
97 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
98 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
99 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
100 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
101 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
102 | | When VPP Setup IPsec Manual Keyed Connection
103 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
104 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
105 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
106 | | And VPP Setup IPsec Manual Keyed Connection
107 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
108 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
109 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
110 | | Then Send Packet And Check Headers
111 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
112 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
113 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
114 | | And Send Packet And Check Headers
115 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
116 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
117 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
118
119 | TC02: DUT1 and DUT2 route IPv6 over Vhost to LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
120 | | [Documentation]
121 | | ... | [Top] TG-DUT1-DUT2-TG.
122 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
123 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
124 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
125 | | ... | IPsec in between DUTS.
126 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, virt2lisp\
127 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
128 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
129 | | ... | received packets are correct.
130 | | ... | [Ref] RFC6830, RFC4303.
131 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
132 | | ... | AND | Show vpp trace dump on all DUTs
133 | | ... | AND | VPP Show Errors | ${nodes['DUT1']}
134 | | ... | AND | VPP Show Errors | ${nodes['DUT2']}
135 | | ... | AND | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
136 | | ... | AND | Show VPP Settings | ${dut1_node}
137 | | ... | AND | Check VPP PID in Teardown
138 | | ...
139 | | ${encr_alg}= | Crypto Alg AES CBC 128
140 | | ${auth_alg}= | Integ Alg SHA1 96
141 | | Given Setup Topology
142 | | And Setup Qemu DUT1
143 | | And Set up LISP GPE topology
144 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
145 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
146 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
147 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
148 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
149 | | ${lisp1_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
150 | | ... | ${dut1_node} | lisp_gpe0
151 | | ${lisp2_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
152 | | ... | ${dut2_node} | lisp_gpe0
153 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
154 | | When VPP Setup IPsec Manual Keyed Connection
155 | | ... | ${dut1_node} | ${lisp1_if_idx} | ${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} | ${lisp2_if_idx} | ${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_ip6} | ${tg2_ip6}
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_ip6} | ${tg1_ip6}
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 *** Keywords ***
172 | Setup Topology
173 | | Path for 3-node testing is set
174 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
175 | | Interfaces in 3-node path are up
176 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
177 | | ... | ${prefix6}
178 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
179 | | ... | ${prefix6}
180 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6}
181 | | ... | ${prefix6}
182 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
183 | | ... | ${prefix6}
184 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6}
185 | | ... | ${prefix6}
186 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
187 | | ... | ${tg_to_dut1_mac}
188 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
189 | | ... | ${tg_to_dut2_mac}
190 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
191 | | ... | ${dut2_to_dut1_mac}
192 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
193 | | ... | ${dut1_to_dut2_mac}
194
195 | Setup Qemu DUT1
196 | | [Documentation] | Setup Vhosts on DUT1 and setup IP to one of them. Setup \
197 | | ... | Qemu and bridge the vhosts.
198 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
199 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
200 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${vhost2} | 2001:cdba:1::9
201 | | ... | ${prefix6}
202 | | Set Interface State | ${dut1_node} | ${vhost1} | up
203 | | Set Interface State | ${dut1_node} | ${vhost2} | up
204 | | Bridge domain on DUT node is created | ${dut1_node} | ${bid} | learn=${TRUE}
205 | | Interface is added to bridge domain | ${dut1_node}
206 | | ... | ${dut1_to_tg} | ${bid} | 0
207 | | Interface is added to bridge domain | ${dut1_node}
208 | | ... | ${vhost1} | ${bid} | 0
209 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
210 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
211 | | VM for Vhost L2BD forwarding is setup | ${dut1_node} | ${sock1} | ${sock2}