• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved.
4
5TST_CLEANUP=cleanup
6TST_TESTFUNC=test1
7TST_SETUP=wireguard_lib_setup
8
9. ipsec_lib.sh
10. wireguard_lib.sh
11
12IPSEC_MODE="tunnel"
13IPSEC_PROTO="esp_aead"
14AEALGO="rfc4106_256"
15EALGO="aes"
16AALGO="sha256"
17
18cleanup()
19{
20	wireguard_lib_cleanup
21	tst_ipsec_cleanup
22}
23
24test1()
25{
26	local wgaddr
27	local clients_num="$TST_NETLOAD_CLN_NUMBER"
28
29	# Enforce multi-threading test, at least with 10 TCP clients
30	[ $clients_num -lt 10 ] && clients_num=10
31
32	tst_res TINFO "test wireguard"
33
34	[ -n "$TST_IPV6" ] && wgaddr="$ip6_virt_remote" || wgaddr="$ip_virt_remote"
35	tst_netload -H $wgaddr -a $clients_num -D ltp_v0
36	local time_wg=$(cat tst_netload.res)
37	wireguard_lib_cleanup
38
39	tst_res TINFO "test IPSec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
40	tst_ipsec_setup_vti
41	tst_netload -H $ip_rmt_tun -a $clients_num -D $tst_vti
42	local time_ipsec=$(cat tst_netload.res)
43	tst_ipsec_cleanup
44
45	tst_netload_compare $time_ipsec $time_wg -100
46}
47
48tst_run
49