CSIT-566: Use RA suppress in LISP and VXLAN IPv6 related test cases
[csit.git] / tests / func / lisp / 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/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 | ... | 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 | ${bid}= | 10
65
66 *** Test Cases ***
67 | TC01: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
68 | | [Documentation]
69 | | ... | [Top] TG-DUT1-DUT2-TG.
70 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
71 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
72 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
73 | | ... | IPsec in between DUTS.
74 | | ... | [Ver] Case: ip6-lispgpe-ipsec-ip6 - main fib, phys2lisp\
75 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
76 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
77 | | ... | received packets are correct.
78 | | ... | [Ref] RFC6830, RFC4303.
79 | | ...
80 | | ${encr_alg}= | Crypto Alg AES CBC 128
81 | | ${auth_alg}= | Integ Alg SHA1 96
82 | | Given Setup Topology
83 | | And Set up LISP GPE topology
84 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
86 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
87 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
88 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
89 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
90 | | When VPP Setup IPsec Manual Keyed Connection
91 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
92 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
93 | | ... | ${dut1_to_dut2_ip6} | ${dut2_to_dut1_ip6}
94 | | And VPP Setup IPsec Manual Keyed Connection
95 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
96 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
97 | | ... | ${dut2_to_dut1_ip6} | ${dut1_to_dut2_ip6}
98 | | Then Send Packet And Check Headers
99 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
100 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
101 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
102 | | And Send Packet And Check Headers
103 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
104 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
105 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
106
107 | TC02: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using IPsec (transport) lisp_gpe0 Int.
108 | | [Documentation]
109 | | ... | [Top] TG-DUT1-DUT2-TG.
110 | | ... | [Enc] Eth-IPv6-IPSec-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2,\
111 | | ... | Eth-IPv6-ICMPv6 on TG-DUTn.
112 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2 with\
113 | | ... | IPsec in between DUTS.
114 | | ... | [Ver] Case: ip6-ipsec-lispgpe-ip6 - main fib, phys2lisp\
115 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across\
116 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
117 | | ... | received packets are correct.
118 | | ... | [Ref] RFC6830, RFC4303.
119 | | ...
120 | | ${encr_alg}= | Crypto Alg AES CBC 128
121 | | ${auth_alg}= | Integ Alg SHA1 96
122 | | Given Setup Topology
123 | | And Set up LISP GPE topology
124 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
125 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
126 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
127 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
128 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
129 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.get sw if index
130 | | ... | ${dut1_node} | lisp_gpe0
131 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
132 | | When VPP Setup IPsec Manual Keyed Connection
133 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
134 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip6}
135 | | ... | ${tg2_ip6}
136 | | And VPP Setup IPsec Manual Keyed Connection
137 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
138 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip6}
139 | | ... | ${tg1_ip6}
140 | | Then Send Packet And Check Headers
141 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
142 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
143 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
144 | | And Send Packet And Check Headers
145 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
146 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
147 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
148
149 *** Keywords ***
150 | Setup Topology
151 | | Path for 3-node testing is set
152 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
153 | | Interfaces in 3-node path are up
154 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6}
155 | | ... | ${prefix6}
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_tg} | ${dut1_to_tg_ip6}
159 | | ... | ${prefix6}
160 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6}
161 | | ... | ${prefix6}
162 | | Vpp Set If IPv6 Addr | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6}
163 | | ... | ${prefix6}
164 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
165 | | ... | ${tg_to_dut1_mac}
166 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
167 | | ... | ${tg_to_dut2_mac}
168 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
169 | | ... | ${dut2_to_dut1_mac}
170 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
171 | | ... | ${dut1_to_dut2_mac}
172 | | Vpp All RA Suppress Link Layer | ${nodes}