wireguard02.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. TST_CLEANUP=cleanup
  5. TST_TESTFUNC=test1
  6. TST_SETUP=wireguard_lib_setup
  7. . ipsec_lib.sh
  8. . wireguard_lib.sh
  9. IPSEC_MODE="tunnel"
  10. IPSEC_PROTO="esp_aead"
  11. AEALGO="rfc4106_256"
  12. EALGO="aes"
  13. AALGO="sha256"
  14. cleanup()
  15. {
  16. wireguard_lib_cleanup
  17. tst_ipsec_cleanup
  18. }
  19. test1()
  20. {
  21. local wgaddr
  22. local clients_num="$TST_NETLOAD_CLN_NUMBER"
  23. # Enforce multi-threading test, at least with 10 TCP clients
  24. [ $clients_num -lt 10 ] && clients_num=10
  25. tst_res TINFO "test wireguard"
  26. [ -n "$TST_IPV6" ] && wgaddr="$ip6_virt_remote" || wgaddr="$ip_virt_remote"
  27. tst_netload -H $wgaddr -a $clients_num -D ltp_v0
  28. local time_wg=$(cat tst_netload.res)
  29. wireguard_lib_cleanup
  30. tst_res TINFO "test IPSec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
  31. tst_ipsec_setup_vti
  32. tst_netload -H $ip_rmt_tun -a $clients_num -D $tst_vti
  33. local time_ipsec=$(cat tst_netload.res)
  34. tst_ipsec_cleanup
  35. tst_netload_compare $time_ipsec $time_wg -100
  36. }
  37. tst_run