MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / SetUp

Method SetUp

src/tests/unit/core-extensions.cpp:33–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31{
32 protected:
33 void SetUp() override
34 {
35 std::stringstream metaopts;
36 metaopts << "# OVPN_ACCESS_SERVER_ALLOW_UNSIGNED=-22" << std::endl
37 << "# OVPN_ACCESS_SERVER_APP_VERIFY_START" << std::endl
38 << "# Testing test test 1" << std::endl
39 << "# Testing test test 2" << std::endl
40 << "# Testing test test 3" << std::endl
41 << "# OVPN_ACCESS_SERVER_APP_VERIFY_STOP" << std::endl
42 << "# OVPN_ACCESS_SERVER_AUTOLOGIN_SPEC=123" << std::endl
43 << "# OVPN_ACCESS_SERVER_CLI_PREF_ALLOW_WEB_IMPORT=1" << std::endl
44 << "# OVPN_ACCESS_SERVER_CLI_PREF_BASIC_CLIENT=1" << std::endl
45 << "# OVPN_ACCESS_SERVER_CLI_PREF_ENABLE_CONNECT=1" << std::endl
46 << "# OVPN_ACCESS_SERVER_CLI_PREF_ENABLE_XD_PROXY=1" << std::endl
47 << "# OVPN_ACCESS_SERVER_DYNAMIC=123" << std::endl
48 << "# OVPN_ACCESS_SERVER_EXTERNAL_PKI=1" << std::endl
49 << "# OVPN_ACCESS_SERVER_GENERIC=99" << std::endl
50 << "# OVPN_ACCESS_SERVER_HOST_FIELD=1" << std::endl
51 << "# OVPN_ACCESS_SERVER_HOST_LIST_START" << std::endl
52 << "# host-entry-1" << std::endl
53 << "# host-entry-2" << std::endl
54 << "# host-entry-3" << std::endl
55 << "# OVPN_ACCESS_SERVER_HOST_LIST_STOP" << std::endl
56 << "# OVPN_ACCESS_SERVER_SITE_LIST_START" << std::endl
57 << "# site-entry-1" << std::endl
58 << "# site-entry-2" << std::endl
59 << "# site-entry-3" << std::endl
60 << "# OVPN_ACCESS_SERVER_SITE_LIST_STOP" << std::endl
61 << "# OVPN_ACCESS_SERVER_ICON_CONTENT_TYPE=text/plain" << std::endl
62 << "# OVPN_ACCESS_SERVER_ICON_DATA_START" << std::endl
63 << "# some strange icon data" << std::endl
64 << "# OVPN_ACCESS_SERVER_ICON_DATA_STOP" << std::endl
65 << "# OVPN_ACCESS_SERVER_IS_OPENVPN_WEB_CA=42" << std::endl
66 << "# OVPN_ACCESS_SERVER_NO_WEB=98" << std::endl
67 << "# OVPN_ACCESS_SERVER_ORGANIZATION=Core Extension Unit Test" << std::endl
68 << "# OVPN_ACCESS_SERVER_PORTAL_URL=http://portal.example.org/" << std::endl
69 << "# OVPN_ACCESS_SERVER_WEB_CA_BUNDLE_START" << std::endl
70 << "# some web ca certificate bundle comes here" << std::endl
71 << "# OVPN_ACCESS_SERVER_WEB_CA_BUNDLE_STOP" << std::endl
72 << "# OVPN_ACCESS_SERVER_WSHOST=wshost.example.org" << std::endl
73 << "# OVPN_ACCESS_SERVER_WSHOST_ANY=3" << std::endl
74 << "# OVPN_ACCESS_SERVER_AUTOLOGIN=1" << std::endl
75 << "# OVPN_ACCESS_SERVER_FRIENDLY_NAME=Core Extension unit-test" << std::endl
76 << "# OVPN_ACCESS_SERVER_PROFILE=profile-value" << std::endl
77 << "# OVPN_ACCESS_SERVER_USERNAME=username-value" << std::endl;
78
79 OptionList::Limits limits("profile is too large",
80 ProfileParseLimits::MAX_PROFILE_SIZE,
81 ProfileParseLimits::OPT_OVERHEAD,
82 ProfileParseLimits::TERM_OVERHEAD,
83 ProfileParseLimits::MAX_LINE_SIZE,
84 ProfileParseLimits::MAX_DIRECTIVE_SIZE);
85
86 options.parse_from_config(metaopts.str(), &limits);
87 options.parse_meta_from_config(metaopts.str(), "OVPN_ACCESS_SERVER", &limits);
88 options.update_map();
89 }
90

Callers

nothing calls this directly

Calls 1

strMethod · 0.45

Tested by

no test coverage detected