ca81b425c8ff1fdeffe72269dbb2dfdb010d05c7
[csit.git] / tests / vpp / func / crypto / default / eth2p-ethip6ipsectptlispgpe-ip6base-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 | ...
42 | Test Setup | Run Keywords | Set up functional test
43 | ...        | AND          | Vpp All Ra Suppress Link Layer | ${nodes}
44 | ...
45 | Test Teardown | Tear down functional test
46 | ...
47 | Documentation | *IPv6 - ip6-ipsec-lispgpe-ip6 - main fib,
48 | ... | vrf (gpe_vni-to-vrf), phy2lisp, virt2lisp*
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-IPSec-LISPGPE-IPv6-ICMPv6,\
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 | ... | to DUT2 where it is forwarded to TG(if2).
58 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
59
60 *** Variables ***
61 | ${dut2_spi}= | ${1000}
62 | ${dut1_spi}= | ${1001}
63
64 | ${ESP_PROTO}= | ${50}
65
66 | ${bid}= | 10
67
68 *** Test Cases ***
69 | TC01: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
70 | | [Documentation]
71 | | ... | [Top] TG-DUT1-DUT2-TG.
72 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
73 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
74 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
75 | | ... | IPsec in between DUTS.
76 | | ... | [Ver] Case: ip6-lispgpe-ipsec-ip6 - main fib, phys2lisp\
77 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
78 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
79 | | ... | received packets are correct.
80 | | ... | [Ref] RFC6830, RFC4303.
81 | | ...
82 | | ${encr_alg}= | Crypto Alg AES CBC 128
83 | | ${auth_alg}= | Integ Alg SHA1 96
84 | | Given Setup Topology
85 | | And Configure LISP GPE topology in 3-node circular topology
86 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
87 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
88 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
89 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
90 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
91 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
92 | | When Configure manual keyed connection for IPSec
93 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
94 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
95 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
96 | | And Configure manual keyed connection for IPSec
97 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
98 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
99 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
100 | | Then Send packet and verify headers
101 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
102 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
103 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
104 | | And Send packet and verify headers
105 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
106 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
107 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
108
109 | TC02: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using IPsec (transport) lisp_gpe0 Int.
110 | | [Documentation]
111 | | ... | [Top] TG-DUT1-DUT2-TG.
112 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
113 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
114 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
115 | | ... | IPsec in between DUTS.
116 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, phys2lisp\
117 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
118 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
119 | | ... | received packets are correct.
120 | | ... | [Ref] RFC6830, RFC4303.
121 | | ...
122 | | ${encr_alg}= | Crypto Alg AES CBC 128
123 | | ${auth_alg}= | Integ Alg SHA1 96
124 | | Given Setup Topology
125 | | And Configure LISP GPE topology in 3-node circular topology
126 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
127 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
128 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
129 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
130 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
131 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
132 | | ... | ${dut1_node} | lisp_gpe0
133 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
134 | | When Configure manual keyed connection for IPSec
135 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
136 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip6}
137 | | ... | ${tg2_ip6}
138 | | And Configure manual keyed connection for IPSec
139 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
140 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip6}
141 | | ... | ${tg1_ip6}
142 | | Then Send packet and verify headers
143 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
144 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
145 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
146 | | And Send packet and verify headers
147 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
148 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
149 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
150
151 *** Keywords ***
152 | Setup Topology
153 | | Configure path in 3-node circular topology
154 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
155 | | Set interfaces in 3-node circular topology up
156 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
157 | | ... | ${prefix6}
158 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
159 | | ... | ${prefix6}
160 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6}
161 | | ... | ${prefix6}
162 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
163 | | ... | ${prefix6}
164 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6}
165 | | ... | ${prefix6}
166 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
167 | | ... | ${tg_to_dut1_mac}
168 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
169 | | ... | ${tg_to_dut2_mac}
170 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
171 | | ... | ${dut2_to_dut1_mac}
172 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
173 | | ... | ${dut1_to_dut2_mac}
174 | | Vpp All RA Suppress Link Layer | ${nodes}