aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/wireguard/wireguard.robot
diff options
context:
space:
mode:
authorCui,Cheng <cheng.cui@intel.com>2022-05-19 06:48:04 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2022-06-09 05:10:18 +0000
commit75ef277536c43096e7646430568d97d2cc489238 (patch)
tree6f590a8d2704c2a7e57f1d343f2523f31b63182f /resources/libraries/robot/wireguard/wireguard.robot
parent13a3991322bc77e5bc88c6b3970c191adb487f7d (diff)
Add Test Suite for VPP WireGuard
Signed-off-by: Cui,Cheng <cheng.cui@intel.com> Change-Id: I71e257e5f16a887a40ff83d782a9ebdee9d05c34 Signed-off-by: Cui,Cheng <cheng.cui@intel.com>
Diffstat (limited to 'resources/libraries/robot/wireguard/wireguard.robot')
-rw-r--r--resources/libraries/robot/wireguard/wireguard.robot58
1 files changed, 58 insertions, 0 deletions
diff --git a/resources/libraries/robot/wireguard/wireguard.robot b/resources/libraries/robot/wireguard/wireguard.robot
new file mode 100644
index 0000000000..ca794d0c36
--- /dev/null
+++ b/resources/libraries/robot/wireguard/wireguard.robot
@@ -0,0 +1,58 @@
+# Copyright (c) 2022 Intel and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+| Library | String
+| Library | resources.libraries.python.InterfaceUtil
+| Library | resources.libraries.python.WireGuardUtil
+| Library | resources.libraries.python.IPUtil
+| Library | resources.libraries.python.IPv6Util
+|
+| Documentation | Wireguard keywords.
+
+*** Keywords ***
+| Generate keys for WireGuard
+| | [Documentation] | Generate a pair of keys for WireGuard
+| |
+| | ... | _NOTE:_ This KW sets following test case variable:
+| | ... | - private_key - wireguard Private key. Type: bytes
+| | ... | - pub_key - wireguard public key. Type: bytes
+| |
+| | ... | *Example:*
+| | ... | \| ${private_key} | ${pub_key} |
+| | ... | \| Generate Wireguard Privatekey and Pubkey \|
+| |
+| | ${private_key} | ${pub_key} | Generate Wireguard Privatekey and Pubkey
+| | Set Test Variable | ${private_key}
+| | Set Test Variable | ${pub_key}
+
+| Initialize WireGuard in 3-node circular topology
+| | [Documentation]
+| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
+| | ... | topology. Get the interface MAC addresses and setup ARP on VPP
+| | ... | interfaces towards TG. Setup IPv4 addresses with /24 prefix on DUT-TG
+| | ... | links. Set routing for decrypted traffic on both DUT nodes
+| | ... | with prefix /8 and next hop of neighbour TG interface IPv4 address.
+| |
+| | VPP Interface Set IP Address
+| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip4} | 24
+| | VPP Interface Set IP Address
+| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip4} | 24
+| | VPP Add IP Neighbor
+| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip4} | ${TG_pf1_mac}[0]
+| | VPP Add IP Neighbor
+| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0]
+| | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
+| | ... | interface=${DUT1_${int}1}[0]
+| | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
+| | ... | interface=${DUT2_${int}2}[0]