3135be73fd5008c7deccde6aa19a6ecee2250197
[csit.git] / resources / libraries / robot / overlay / gtpu.robot
1 # Copyright (c) 2021 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.
27 | |
28 | | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}1}[0]
29 | | ... | 10.10.10.1 | 24
30 | | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}2}[0]
31 | | ... | 1.1.1.2 | 30
32 | | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}1}[0]
33 | | ... | 1.1.1.1 | 30
34 | | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}2}[0]
35 | | ... | 20.20.20.1 | 24
36 | |
37 | | VPP Add IP Neighbor
38 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.2 | ${TG_pf1_mac}[0]
39 | | VPP Add IP Neighbor
40 | | ... | ${dut1} | ${DUT1_${int}2}[0] | 1.1.1.1 | ${DUT2_${int}1_mac}[0]
41 | | VPP Add IP Neighbor
42 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 1.1.1.2 | ${DUT1_${int}2_mac}[0]
43 | | VPP Add IP Neighbor
44 | | ... | ${dut2} | ${DUT2_${int}2}[0] | 20.20.20.2 | ${TG_pf2_mac}[0]
45 | |
46 | | ${dut1_tunnel_if_index}= | Create GTPU Tunnel Interface | ${dut1}
47 | | ... | source_ip=1.1.1.2 | destination_ip=1.1.1.1 | teid=${10}
48 | | ${dut2_tunnel_if_index}= | Create GTPU Tunnel Interface | ${dut2}
49 | | ... | source_ip=1.1.1.1 | destination_ip=1.1.1.2 | teid=${10}
50 | |
51 | | Set Interface State | ${dut1} | ${dut1_tunnel_if_index} | up
52 | | Set Interface State | ${dut2} | ${dut2_tunnel_if_index} | up
53 | |
54 | | VPP Interface Set IP Address | ${dut1} | ${dut1_tunnel_if_index}
55 | | ... | 10.10.1.2 | 24
56 | | VPP Interface Set IP Address | ${dut2} | ${dut2_tunnel_if_index}
57 | | ... | 10.10.1.1 | 24
58 | |
59 | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
60 | | ... | interface=${dut1_tunnel_if_index}
61 | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
62 | | ... | interface=${dut2_tunnel_if_index}