Add Test Suite for VPP WireGuard
[csit.git] / resources / libraries / robot / wireguard / wireguard.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 | String
16 | Library | resources.libraries.python.InterfaceUtil
17 | Library | resources.libraries.python.WireGuardUtil
18 | Library | resources.libraries.python.IPUtil
19 | Library | resources.libraries.python.IPv6Util
20 |
21 | Documentation | Wireguard keywords.
22
23 *** Keywords ***
24 | Generate keys for WireGuard
25 | | [Documentation] | Generate a pair of keys for WireGuard
26 | |
27 | | ... | _NOTE:_ This KW sets following test case variable:
28 | | ... | - private_key - wireguard Private key. Type: bytes
29 | | ... | - pub_key - wireguard public key. Type: bytes
30 | |
31 | | ... | *Example:*
32 | | ... | \| ${private_key} | ${pub_key} |
33 | | ... | \| Generate Wireguard Privatekey and Pubkey \|
34 | |
35 | | ${private_key} | ${pub_key} | Generate Wireguard Privatekey and Pubkey
36 | | Set Test Variable | ${private_key}
37 | | Set Test Variable | ${pub_key}
38
39 | Initialize WireGuard in 3-node circular topology
40 | | [Documentation]
41 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
42 | | ... | topology. Get the interface MAC addresses and setup ARP on VPP
43 | | ... | interfaces towards TG. Setup IPv4 addresses with /24 prefix on DUT-TG
44 | | ... | links. Set routing for decrypted traffic on both DUT nodes
45 | | ... | with prefix /8 and next hop of neighbour TG interface IPv4 address.
46 | |
47 | | VPP Interface Set IP Address
48 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip4} | 24
49 | | VPP Interface Set IP Address
50 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip4} | 24
51 | | VPP Add IP Neighbor
52 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip4} | ${TG_pf1_mac}[0]
53 | | VPP Add IP Neighbor
54 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0]
55 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
56 | | ... | interface=${DUT1_${int}1}[0]
57 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
58 | | ... | interface=${DUT2_${int}2}[0]