feat(tests): IPsecHW rxq ratio
[csit.git] / resources / libraries / robot / overlay / gtpu.robot
1 # Copyright (c) 2022 Intel 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.InterfaceUtil
16 | Library | resources.libraries.python.IPUtil
17 |
18 | Documentation | GTPU keywords.
19
20 *** Keywords ***
21 | Initialize IP4 forwarding with GTPU tunnel in 3-node circular topology
22 | | [Documentation]
23 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
24 | | ... | topology. Create GTPU tunnel on both DUT nodes, setup IPv4 adresses
25 | | ... | with /30 prefix on DUT1-DUT2 link, and set routing on both DUT nodes
26 | | ... | with prefix /24 and next hop of neighbour DUT interface. Gtpu offload
27 | | ... | rx will be enabled on both DUT nodes if offload is set to true.
28 | |
29 | | ... | *Arguments:*
30 | | ... | - offload - False or True. Type: bool
31 | |
32 | | [Arguments] | ${offload}=${False}
33 | |
34 | | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}1}[0]
35 | | ... | 10.10.10.1 | 24
36 | | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}2}[0]
37 | | ... | 1.1.1.2 | 30
38 | | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}1}[0]
39 | | ... | 1.1.1.1 | 30
40 | | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}2}[0]
41 | | ... | 20.20.20.1 | 24
42 | |
43 | | VPP Add IP Neighbor
44 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.2 | ${TG_pf1_mac}[0]
45 | | VPP Add IP Neighbor
46 | | ... | ${dut1} | ${DUT1_${int}2}[0] | 1.1.1.1 | ${DUT2_${int}1_mac}[0]
47 | | VPP Add IP Neighbor
48 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 1.1.1.2 | ${DUT1_${int}2_mac}[0]
49 | | VPP Add IP Neighbor
50 | | ... | ${dut2} | ${DUT2_${int}2}[0] | 20.20.20.2 | ${TG_pf2_mac}[0]
51 | |
52 | | ${dut1_tunnel_if_index}= | Create GTPU Tunnel Interface | ${dut1}
53 | | ... | source_ip=1.1.1.2 | destination_ip=1.1.1.1 | teid=${10}
54 | | ${dut2_tunnel_if_index}= | Create GTPU Tunnel Interface | ${dut2}
55 | | ... | source_ip=1.1.1.1 | destination_ip=1.1.1.2 | teid=${10}
56 | |
57 | | Set Interface State | ${dut1} | ${dut1_tunnel_if_index} | up
58 | | Set Interface State | ${dut2} | ${dut2_tunnel_if_index} | up
59 | |
60 | | VPP Interface Set IP Address | ${dut1} | ${dut1_tunnel_if_index}
61 | | ... | 10.10.1.2 | 24
62 | | VPP Interface Set IP Address | ${dut2} | ${dut2_tunnel_if_index}
63 | | ... | 10.10.1.1 | 24
64 | |
65 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
66 | | ... | interface=${dut1_tunnel_if_index}
67 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
68 | | ... | interface=${dut2_tunnel_if_index}
69 | |
70 | | Run keyword if | ${offload} == ${True}
71 | | ... | Vpp Enable GTPU Offload rx
72 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_tunnel_if_index}
73 | | Run keyword if | ${offload} == ${True}
74 | | ... | Vpp Enable GTPU Offload rx
75 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_tunnel_if_index}