t_client.rc-sample 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #
  2. # this is sourced from t_client.sh and defines which openvpn client tests
  3. # to run
  4. #
  5. # (sample config, copy to t_client.rc and adapt to your environment)
  6. #
  7. #
  8. # define these - if empty, no tests will run
  9. #
  10. top_srcdir="${top_srcdir:-..}"
  11. CA_CERT="${top_srcdir}/sample/sample-keys/ca.crt"
  12. CLIENT_KEY="${top_srcdir}/sample/sample-keys/client.key"
  13. CLIENT_CERT="${top_srcdir}/sample/sample-keys/client.crt"
  14. #FPING_EXTRA_ARGS="-t 1000"
  15. # Load EXPECT_IFCONFIG* parameters from cache
  16. if [ -r "${top_builddir}/t_client_ips.rc" ]; then
  17. . "${top_builddir}/t_client_ips.rc"
  18. else
  19. echo "NOTICE: missing t_client_ips.rc will be auto-generated"
  20. fi
  21. #
  22. # remote host (used as macro below)
  23. #
  24. REMOTE=mytestserver
  25. #
  26. # tests to run (list suffixes for config stanzas below)
  27. #
  28. TEST_RUN_LIST="1 2"
  29. #
  30. # use "sudo" (etc) to give openvpn the necessary privileges
  31. # if this is not active, "make check" must be run as root
  32. #
  33. #RUN_SUDO=sudo
  34. #
  35. # base confic that is the same for all the p2mp test runs
  36. #
  37. OPENVPN_BASE_P2MP="--client --ca $CA_CERT \
  38. --cert $CLIENT_CERT --key $CLIENT_KEY \
  39. --remote-cert-tls server --nobind --comp-lzo --verb 3"
  40. # base config for p2p tests
  41. #
  42. OPENVPN_BASE_P2P="..."
  43. #
  44. #
  45. # now define the individual tests - all variables suffixed with _1, _2 etc
  46. # will be used in test run "1", "2", etc.
  47. #
  48. # if something is not defined here, the corresponding test is not run
  49. #
  50. # possible test options:
  51. #
  52. # RUN_TITLE_x="what is being tested on here" (purely informational)
  53. # OPENVPN_CONF_x = "how to call ./openvpn" [mandatory]
  54. # EXPECT_IFCONFIG4_x = "this IPv4 address needs to show up in ifconfig"
  55. # EXPECT_IFCONFIG6_x = "this IPv6 address needs to show up in ifconfig"
  56. # PING4_HOSTS_x = "these hosts musts ping when openvpn is up (IPv4 fping)"
  57. # PING6_HOSTS_x = "these hosts musts ping when openvpn is up (IPv6 fping6)"
  58. #
  59. # Test 1: UDP / p2mp tun
  60. # specify IPv4+IPv6 addresses expected from server and ping targets
  61. #
  62. RUN_TITLE_1="testing tun/udp/ipv4+ipv6"
  63. OPENVPN_CONF_1="$OPENVPN_BASE_P2MP --dev tun --proto udp --remote $REMOTE --port 51194"
  64. PING4_HOSTS_1="10.100.50.1 10.100.0.1"
  65. PING6_HOSTS_1="2001:db8::1 2001:db8:a050::1"
  66. # Test 2: TCP / p2mp tun
  67. #
  68. RUN_TITLE_2="testing tun/tcp/ipv4+ipv6"
  69. OPENVPN_CONF_2="$OPENVPN_BASE_P2MP --dev tun --proto tcp --remote $REMOTE --port 51194"
  70. PING4_HOSTS_2="10.100.51.1 10.100.0.1"
  71. PING6_HOSTS_2="2001:db8::1 2001:db8:a051::1"
  72. #
  73. # run command after openvpn initialization is done - here: delay 5 seconds
  74. POSTINIT_CMD_2="sleep 5"
  75. # Test 3: UDP / p2p tun
  76. # ...
  77. # Test 4: TCP / p2p tun
  78. # ...
  79. # Test 5: UDP / p2mp tap
  80. # ...
  81. # Test 6: TCP / p2mp tun
  82. # ...
  83. # Test 7: UDP / p2p tap
  84. # ...
  85. # Test 8: TCP / p2p tap
  86. # ...
  87. # Test 9: whatever you want to test... :-)