d67928c7ab3e1200a78389045fa1b42bd20885ce
[csit.git] / tests / func / lisp / eth2p-ethip6ipsectptlispgpe-ip4base-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 | 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 | SKIP_VPP_PATCH
39 | ...
40 | Test Setup | Set up functional test
41 | Test Teardown | Tear down functional test
42 | ...
43 | Documentation | *IPv6 - ip4-ipsec-lispgpe-ip6 - main fib, virt2lisp, phy2lisp*
44 | ...
45 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
46 | ... | with single links between nodes.
47 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-LISPGPE-IPSec-IPv4-ICMP,\
48 | ... | Eth-IPv6-IPSec-LISPGPE-IPv4-ICMP
49 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
50 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
51 | ... | on RLOC interface or lisp_gpe0 interface.
52 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1 to\
53 | ... | DUT2 where it is forwarded to TG(if2).
54 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
55
56 *** Test Cases ***
57 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
58 | | [Documentation]
59 | | ... | [Top] TG-DUT1-DUT2-TG.
60 | | ... | [Enc] Eth-IPv6-LISPGPE-IPSec-IPv4-ICMP on DUT1-DUT2, Eth-IPv4-ICMP\
61 | | ... | on TG-DUTn.
62 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
63 | | ... | IPsec in between DUTS.
64 | | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces across\
65 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
66 | | ... | received packets are correct.
67 | | ... | [Ref] RFC6830, RFC4303.
68 | | ...
69 | | ${encr_alg}= | Crypto Alg AES CBC 128
70 | | ${auth_alg}= | Integ Alg SHA1 96
71 | | Given Setup Topology And Lisp
72 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
73 | | When Configure manual keyed connection for IPSec
74 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
75 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
76 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
77 | | And Configure manual keyed connection for IPSec
78 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
79 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
80 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
81 | | Then Send packet and verify headers
82 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
83 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
84 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
85 | | And Send packet and verify headers
86 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
87 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
88 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
89
90 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
91 | | [Documentation]
92 | | ... | [Top] TG-DUT1-DUT2-TG.
93 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMP\
94 | | ... | on TG-DUTn.
95 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
96 | | ... | IPsec in between DUTS.
97 | | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces across\
98 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
99 | | ... | received packets are correct.
100 | | ... | [Ref] RFC6830, RFC4303.
101 | | ...
102 | | ${encr_alg}= | Crypto Alg AES CBC 128
103 | | ${auth_alg}= | Integ Alg SHA1 96
104 | | Given Setup Topology And Lisp
105 | | And Generate keys for IPSec | ${encr_alg} | ${auth_alg}
106 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
107 | | ... | ${dut1_node} | ${lisp_gpe_int}
108 | | When Configure manual keyed connection for IPSec
109 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
110 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
111 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
112 | | And Configure manual keyed connection for IPSec
113 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
114 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
115 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
116 | | Then Send packet and verify headers
117 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
118 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
119 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
120 | | And Send packet and verify headers
121 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
122 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
123 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
124
125 *** Keywords ***
126 | Setup Topology And Lisp
127 | | [Documentation] | Setup IPs and neighbors for interfaces on DUT1 and DUT2\
128 | | ... | and then setup LISP.
129 | | Configure path in 3-node circular topology
130 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
131 | | Set interfaces in 3-node circular topology up
132 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
133 | | ... | ${prefix6}
134 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
135 | | ... | ${prefix6}
136 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4}
137 | | ... | ${prefix4}
138 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
139 | | ... | ${prefix6}
140 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4}
141 | | ... | ${prefix4}
142 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
143 | | ... | ${tg_to_dut2_mac}
144 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
145 | | ... | ${dut2_to_dut1_mac}
146 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
147 | | ... | ${dut1_to_dut2_mac}
148 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
149 | | ... | ${tg_to_dut1_mac}
150 | | Vpp All RA Suppress Link Layer | ${nodes}
151 | | Configure LISP GPE topology in 3-node circular topology
152 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
153 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
154 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
155 | | ... | ${dut1_to_dut2_ip_static_adjacency}
156 | | ... | ${dut2_to_dut1_ip_static_adjacency}