|
OpenVPN 3 Core Library
|
#include <iostream>#include "test_common.hpp"#include <openvpn/init/initprocess.hpp>#include <openvpn/time/asiotimer.hpp>#include <client/ovpncli.hpp>#include <openvpn/client/cliopt.hpp>Go to the source code of this file.
Classes | |
| class | ValidConfigs |
| class | InvalidConfigs |
Typedefs | |
| typedef std::pair< std::string, std::string > | config_error |
Functions | |
| void | load_client_config (const std::string &config_content) |
| TEST_P (ValidConfigs, valid_config) | |
| TEST_P (InvalidConfigs, config_throws_option_error) | |
| TEST (config, missingRequiredOption) | |
| INSTANTIATE_TEST_SUITE_P (optionError, InvalidConfigs, testing::Values(config_error{std::string("remote wooden.box\n")+"mode server"+"\n<ca>\n"+dummysecp256cert+"</ca>\n", "option 'cert' not found"}, config_error{minimalConfig+"mode", "Only 'mode p2p' supported"}, config_error{minimalConfig+"mode server", "Only 'mode p2p' supported"}, config_error{minimalConfig+"key-method 1", "Only 'key-method 2' is supported"}, config_error{minimalConfig+"fragment", "sorry, 'fragment' directive is not supported"})) | |
| TEST (config, parse_unknown_option) | |
| INSTANTIATE_TEST_SUITE_P (minimalConfigs, ValidConfigs, testing::Values(minimalConfig+"cipher AES-192-CBC\ncipher AES-256-GCM\n", minimalConfig+"ignore-unknown-option bikeshed-colour bikeshed-color\n" "ignore-unknown-option danish axe phk\n" "bikeshed-colour green", minimalConfig+"setenv opt bikeshed-paint silver with sparkling", minimalConfig+"tun-ipv6\n", minimalConfig+"opt-verify\n")) | |
| TEST (config, parse_management) | |
| TEST (config, duplicate_options_sets) | |
| TEST (config, dco_compatibility) | |
| TEST (config, server_cert_in_eval) | |
| TEST (config, server_options_present_in_error_msg) | |
| TEST (config, unknown_options_present_in_error_msg) | |
| TEST (config, multiple_option_errors) | |
| INSTANTIATE_TEST_SUITE_P (clientPull, ValidConfigs, testing::Values(certconfig+"\nremote 1.2.3.4\ntls-client\npull\n", certconfig+"\nremote 1.2.3.4\ntls-client\npull\nclient\n", certconfig+"\nremote 1.2.3.4\npull\nclient\n", certconfig+"\nremote 1.2.3.4\nclient\ntls-client\n")) | |
| INSTANTIATE_TEST_SUITE_P (clientPull, InvalidConfigs, testing::Values(config_error{certconfig+"\nremote 1.2.3.4\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."}, config_error{certconfig+"\nremote 1.2.3.4\ntls-client\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."}, config_error{certconfig+"\nremote 1.2.3.4\npull\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."})) | |
| TEST (config, meta_option_in_content) | |
Variables | |
| std::string | dummysecp256cert |
| std::string | dummysecp256key |
| std::string | certconfig |
| std::string | minimalConfig |
| typedef std::pair<std::string, std::string> config_error |
Definition at line 44 of file test_cliopt.cpp.
| INSTANTIATE_TEST_SUITE_P | ( | clientPull | , |
| InvalidConfigs | , | ||
| testing::Values(config_error{certconfig+"\nremote 1.2.3.4\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."}, config_error{certconfig+"\nremote 1.2.3.4\ntls-client\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."}, config_error{certconfig+"\nremote 1.2.3.4\npull\n", "option_error: Neither 'client' nor both 'tls-client' and 'pull' options declared. OpenVPN3 client only supports --client mode."}) | |||
| ) |
| INSTANTIATE_TEST_SUITE_P | ( | clientPull | , |
| ValidConfigs | , | ||
| testing::Values(certconfig+"\nremote 1.2.3.4\ntls-client\npull\n", certconfig+"\nremote 1.2.3.4\ntls-client\npull\nclient\n", certconfig+"\nremote 1.2.3.4\npull\nclient\n", certconfig+"\nremote 1.2.3.4\nclient\ntls-client\n") | |||
| ) |
| INSTANTIATE_TEST_SUITE_P | ( | minimalConfigs | , |
| ValidConfigs | , | ||
| testing::Values(minimalConfig+"cipher AES-192-CBC\ncipher AES-256-GCM\n", minimalConfig+"ignore-unknown-option bikeshed-colour bikeshed-color\n" "ignore-unknown-option danish axe phk\n" "bikeshed-colour green", minimalConfig+"setenv opt bikeshed-paint silver with sparkling", minimalConfig+"tun-ipv6\n", minimalConfig+"opt-verify\n") | |||
| ) |
| INSTANTIATE_TEST_SUITE_P | ( | optionError | , |
| InvalidConfigs | , | ||
| testing::Values(config_error{std::string("remote wooden.box\n")+"mode server"+"\n<ca>\n"+dummysecp256cert+"</ca>\n", "option 'cert' not found"}, config_error{minimalConfig+"mode", "Only 'mode p2p' supported"}, config_error{minimalConfig+"mode server", "Only 'mode p2p' supported"}, config_error{minimalConfig+"key-method 1", "Only 'key-method 2' is supported"}, config_error{minimalConfig+"fragment", "sorry, 'fragment' directive is not supported"}) | |||
| ) |
| void load_client_config | ( | const std::string & | config_content | ) |
| TEST | ( | config | , |
| dco_compatibility | |||
| ) |
Definition at line 173 of file test_cliopt.cpp.
| TEST | ( | config | , |
| duplicate_options_sets | |||
| ) |
Definition at line 132 of file test_cliopt.cpp.
| TEST | ( | config | , |
| meta_option_in_content | |||
| ) |
Definition at line 277 of file test_cliopt.cpp.
| TEST | ( | config | , |
| missingRequiredOption | |||
| ) |
Definition at line 77 of file test_cliopt.cpp.
| TEST | ( | config | , |
| multiple_option_errors | |||
| ) |
Definition at line 243 of file test_cliopt.cpp.
| TEST | ( | config | , |
| parse_management | |||
| ) |
Definition at line 119 of file test_cliopt.cpp.
| TEST | ( | config | , |
| parse_unknown_option | |||
| ) |
Definition at line 96 of file test_cliopt.cpp.
| TEST | ( | config | , |
| server_cert_in_eval | |||
| ) |
Definition at line 198 of file test_cliopt.cpp.
| TEST | ( | config | , |
| server_options_present_in_error_msg | |||
| ) |
Definition at line 210 of file test_cliopt.cpp.
| TEST | ( | config | , |
| unknown_options_present_in_error_msg | |||
| ) |
Definition at line 227 of file test_cliopt.cpp.
| TEST_P | ( | InvalidConfigs | , |
| config_throws_option_error | |||
| ) |
Definition at line 69 of file test_cliopt.cpp.
| TEST_P | ( | ValidConfigs | , |
| valid_config | |||
| ) |
Definition at line 64 of file test_cliopt.cpp.
| std::string certconfig |
Definition at line 30 of file test_cliopt.cpp.
| std::string dummysecp256cert |
Definition at line 15 of file test_cliopt.cpp.
| std::string dummysecp256key |
Definition at line 24 of file test_cliopt.cpp.
| std::string minimalConfig |
Definition at line 37 of file test_cliopt.cpp.