OpenVPN 3 Core Library
Loading...
Searching...
No Matches
unittests Namespace Reference

Classes

class  IpHelperTest
 
class  RouteEmulationTest
 
class  SitnlTest
 
class  TunBuilderMock
 

Functions

static void workload (const uint16_t multiplier)
 
 TEST (CPUTime, CpuTimePid)
 
void worker_thread (const uint8_t id)
 
void run_threads (const uint8_t num_threads)
 
 TEST (CPUTime, CpuTimeThread1)
 
 TEST (CPUTime, CpuTimeThreadNumcores)
 
 TEST (Dns, Options)
 
 TEST (Dns, OptionsMerger)
 
 TEST (Dns, DnsAddressTostring)
 
 TEST (Dns, ServerNoAddress)
 
 TEST (Dns, ServerEightAddresses)
 
 TEST (Dns, ServerTooManyAddresses)
 
 TEST (Dns, ServerInvalidAddress)
 
 TEST (Dns, ServerInvalidDnssec)
 
 TEST (Dns, ServerInvalidTransport)
 
 TEST (Dns, DhcpOptions)
 
 TEST (Dns, DhcpOptionsWithSplitDomains)
 
 TEST (Dns, DhcpOptionsIgnored)
 
 TEST (Dns, ToStringMinValuesSet)
 
 TEST (Dns, ToStringValuesFromDhcpOptions)
 
 TEST (Dns, ToStringAllValuesSet)
 
 TEST (Dns, JsonRoundtripMinValuesSet)
 
 TEST (Dns, JsonRoundtripValuesFromDhcpOption)
 
 TEST (Dns, JsonRoundtripAllValuesSet)
 
 TEST_F (IpHelperTest, TestAddRoute4)
 
 TEST (LogInfoTest, TestLogInfo)
 
 TEST (MbedTLSX509GetSubject, OldFormat)
 
 TEST (MbesTLSX509GetSubject, NewFormat)
 
 TEST (MbedTLSX509GetCommonName, BasicCheck)
 
 TEST (OpenSSLX509GetSubject, OldFormat)
 
 TEST (OpenSSLX509GetSubject, NewFormat)
 
 TEST (OpenSSLX509GetSerial, Numeric)
 
 TEST (OpenSSLX509GetSerial, Hexadecimal)
 
 TEST (OpenSSLX509GetField, BasicChecks)
 
 TEST (OpenSSLX509GetField, Signature)
 
 TEST (X509GetFingerprint, Output)
 
 TEST (PeerFingerprint, ParseConfig)
 
 TEST (PeerFingerprint, Malformed)
 
 TEST (PeerFingerprint, Stringify)
 
 TEST (PeerFingerprint, MatchEmpty)
 
 TEST (PeerFingerprint, Match)
 
 TEST (PeerFingerprint, NoMatch)
 
std::string join_string_vector_sorted (std::vector< std::string > vec, const char *const delim=", ")
 
 TEST_F (RouteEmulationTest, ExcludeOneSubnet)
 
 TEST_F (RouteEmulationTest, ExcludeSubnetsNoDefault)
 
 TEST_F (RouteEmulationTest, ExcludeServer)
 
 TEST_F (RouteEmulationTest, NestedIPRoutes)
 
 TEST_F (RouteEmulationTest, DefaultRoute)
 
 TEST_F (SitnlTest, TestAddrAdd4)
 
 TEST_F (SitnlTest, TestAddrAdd6)
 
 TEST_F (SitnlTest, TestSetMTU)
 
 TEST_F (SitnlTest, TestAddRoute4)
 
 TEST_F (SitnlTest, TestAddRoute6)
 
 TEST_F (SitnlTest, TestBestGw4)
 
 TEST_F (SitnlTest, TestBestGw4FilterIface)
 
OptionList parse_testcfg (std::string &config)
 
 TEST (VerifyX509Name, ConfigMissingArgs)
 
 TEST (VerifyX509Name, ConfigIncorrectType)
 
 TEST (VerifyX509Name, ConfigCorrectDefaultType)
 
 TEST (VerifyX509Name, ConfigCorrectSubject)
 
 TEST (VerifyX509Name, ConfigCorrectName)
 
 TEST (VerifyX509Name, ConfigSquote)
 
 TEST (VerifyX509Name, ConfigCorrectNamePrefix)
 
 TEST (VerifyX509Name, TestSubject)
 
 TEST (VerifyX509Name, TestName)
 
 TEST (VerifyX509Name, TestNamePrefix)
 

Variables

static std::string path_to_ip
 
std::string test_cert
 
std::vector< uint8_t > test_fingerprint
 
static std::string path_to_ip
 

Function Documentation

◆ join_string_vector_sorted()

std::string unittests::join_string_vector_sorted ( std::vector< std::string >  vec,
const char *const  delim = ", " 
)

Definition at line 26 of file test_route_emulation.cpp.

◆ parse_testcfg()

OptionList unittests::parse_testcfg ( std::string &  config)

Definition at line 25 of file test_verify_x509_name.cpp.

Here is the caller graph for this function:

◆ run_threads()

void unittests::run_threads ( const uint8_t  num_threads)

Definition at line 165 of file test_cpu_time.cpp.

Here is the caller graph for this function:

◆ TEST() [1/48]

unittests::TEST ( CPUTime  ,
CpuTimePid   
)

Definition at line 110 of file test_cpu_time.cpp.

◆ TEST() [2/48]

unittests::TEST ( CPUTime  ,
CpuTimeThread1   
)

Definition at line 183 of file test_cpu_time.cpp.

◆ TEST() [3/48]

unittests::TEST ( CPUTime  ,
CpuTimeThreadNumcores   
)

Definition at line 203 of file test_cpu_time.cpp.

◆ TEST() [4/48]

unittests::TEST ( Dns  ,
DhcpOptions   
)

Definition at line 291 of file test_dns.cpp.

◆ TEST() [5/48]

unittests::TEST ( Dns  ,
DhcpOptionsIgnored   
)

Definition at line 355 of file test_dns.cpp.

◆ TEST() [6/48]

unittests::TEST ( Dns  ,
DhcpOptionsWithSplitDomains   
)

Definition at line 322 of file test_dns.cpp.

◆ TEST() [7/48]

unittests::TEST ( Dns  ,
DnsAddressTostring   
)

Supported formats: 192.168.0.1 192.168.0.1:53 [2001:db8:1234::1]

Definition at line 139 of file test_dns.cpp.

◆ TEST() [8/48]

unittests::TEST ( Dns  ,
JsonRoundtripAllValuesSet   
)

Definition at line 528 of file test_dns.cpp.

◆ TEST() [9/48]

unittests::TEST ( Dns  ,
JsonRoundtripMinValuesSet   
)

Definition at line 456 of file test_dns.cpp.

◆ TEST() [10/48]

unittests::TEST ( Dns  ,
JsonRoundtripValuesFromDhcpOption   
)

Definition at line 492 of file test_dns.cpp.

◆ TEST() [11/48]

unittests::TEST ( Dns  ,
Options   
)

Definition at line 22 of file test_dns.cpp.

◆ TEST() [12/48]

unittests::TEST ( Dns  ,
OptionsMerger   
)

Definition at line 119 of file test_dns.cpp.

◆ TEST() [13/48]

unittests::TEST ( Dns  ,
ServerEightAddresses   
)

Definition at line 221 of file test_dns.cpp.

◆ TEST() [14/48]

unittests::TEST ( Dns  ,
ServerInvalidAddress   
)

Definition at line 241 of file test_dns.cpp.

◆ TEST() [15/48]

unittests::TEST ( Dns  ,
ServerInvalidDnssec   
)

Definition at line 251 of file test_dns.cpp.

◆ TEST() [16/48]

unittests::TEST ( Dns  ,
ServerInvalidTransport   
)

Definition at line 271 of file test_dns.cpp.

◆ TEST() [17/48]

unittests::TEST ( Dns  ,
ServerNoAddress   
)

Definition at line 211 of file test_dns.cpp.

◆ TEST() [18/48]

unittests::TEST ( Dns  ,
ServerTooManyAddresses   
)

Definition at line 231 of file test_dns.cpp.

◆ TEST() [19/48]

unittests::TEST ( Dns  ,
ToStringAllValuesSet   
)

Definition at line 409 of file test_dns.cpp.

◆ TEST() [20/48]

unittests::TEST ( Dns  ,
ToStringMinValuesSet   
)

Definition at line 381 of file test_dns.cpp.

◆ TEST() [21/48]

unittests::TEST ( Dns  ,
ToStringValuesFromDhcpOptions   
)

Definition at line 395 of file test_dns.cpp.

◆ TEST() [22/48]

unittests::TEST ( LogInfoTest  ,
TestLogInfo   
)

Definition at line 32 of file test_log.cpp.

◆ TEST() [23/48]

unittests::TEST ( MbedTLSX509GetCommonName  ,
BasicCheck   
)

Definition at line 81 of file test_mbedtls_x509certinfo.cpp.

◆ TEST() [24/48]

unittests::TEST ( MbedTLSX509GetSubject  ,
OldFormat   
)

Definition at line 60 of file test_mbedtls_x509certinfo.cpp.

◆ TEST() [25/48]

unittests::TEST ( MbesTLSX509GetSubject  ,
NewFormat   
)

Definition at line 71 of file test_mbedtls_x509certinfo.cpp.

◆ TEST() [26/48]

unittests::TEST ( OpenSSLX509GetField  ,
BasicChecks   
)

Definition at line 97 of file test_openssl_x509certinfo.cpp.

◆ TEST() [27/48]

unittests::TEST ( OpenSSLX509GetField  ,
Signature   
)

Definition at line 118 of file test_openssl_x509certinfo.cpp.

◆ TEST() [28/48]

unittests::TEST ( OpenSSLX509GetSerial  ,
Hexadecimal   
)

Definition at line 89 of file test_openssl_x509certinfo.cpp.

◆ TEST() [29/48]

unittests::TEST ( OpenSSLX509GetSerial  ,
Numeric   
)

Definition at line 81 of file test_openssl_x509certinfo.cpp.

◆ TEST() [30/48]

unittests::TEST ( OpenSSLX509GetSubject  ,
NewFormat   
)

Definition at line 71 of file test_openssl_x509certinfo.cpp.

◆ TEST() [31/48]

unittests::TEST ( OpenSSLX509GetSubject  ,
OldFormat   
)

Definition at line 60 of file test_openssl_x509certinfo.cpp.

◆ TEST() [32/48]

unittests::TEST ( PeerFingerprint  ,
Malformed   
)

Definition at line 71 of file test_peer_fingerprint.cpp.

◆ TEST() [33/48]

unittests::TEST ( PeerFingerprint  ,
Match   
)

Definition at line 136 of file test_peer_fingerprint.cpp.

◆ TEST() [34/48]

unittests::TEST ( PeerFingerprint  ,
MatchEmpty   
)

Definition at line 127 of file test_peer_fingerprint.cpp.

◆ TEST() [35/48]

unittests::TEST ( PeerFingerprint  ,
NoMatch   
)

Definition at line 152 of file test_peer_fingerprint.cpp.

◆ TEST() [36/48]

unittests::TEST ( PeerFingerprint  ,
ParseConfig   
)

Definition at line 29 of file test_peer_fingerprint.cpp.

◆ TEST() [37/48]

unittests::TEST ( PeerFingerprint  ,
Stringify   
)

Definition at line 119 of file test_peer_fingerprint.cpp.

◆ TEST() [38/48]

unittests::TEST ( VerifyX509Name  ,
ConfigCorrectDefaultType   
)

Definition at line 55 of file test_verify_x509_name.cpp.

◆ TEST() [39/48]

unittests::TEST ( VerifyX509Name  ,
ConfigCorrectName   
)

Definition at line 71 of file test_verify_x509_name.cpp.

◆ TEST() [40/48]

unittests::TEST ( VerifyX509Name  ,
ConfigCorrectNamePrefix   
)

Definition at line 86 of file test_verify_x509_name.cpp.

◆ TEST() [41/48]

unittests::TEST ( VerifyX509Name  ,
ConfigCorrectSubject   
)

Definition at line 63 of file test_verify_x509_name.cpp.

◆ TEST() [42/48]

unittests::TEST ( VerifyX509Name  ,
ConfigIncorrectType   
)

Definition at line 47 of file test_verify_x509_name.cpp.

◆ TEST() [43/48]

unittests::TEST ( VerifyX509Name  ,
ConfigMissingArgs   
)

Definition at line 40 of file test_verify_x509_name.cpp.

◆ TEST() [44/48]

unittests::TEST ( VerifyX509Name  ,
ConfigSquote   
)

Definition at line 78 of file test_verify_x509_name.cpp.

◆ TEST() [45/48]

unittests::TEST ( VerifyX509Name  ,
TestName   
)

Definition at line 122 of file test_verify_x509_name.cpp.

◆ TEST() [46/48]

unittests::TEST ( VerifyX509Name  ,
TestNamePrefix   
)

Definition at line 132 of file test_verify_x509_name.cpp.

◆ TEST() [47/48]

unittests::TEST ( VerifyX509Name  ,
TestSubject   
)

Definition at line 93 of file test_verify_x509_name.cpp.

◆ TEST() [48/48]

unittests::TEST ( X509GetFingerprint  ,
Output   
)

Definition at line 125 of file test_openssl_x509certinfo.cpp.

◆ TEST_F() [1/13]

unittests::TEST_F ( IpHelperTest  ,
TestAddRoute4   
)

Definition at line 48 of file test_iphelper.cpp.

◆ TEST_F() [2/13]

unittests::TEST_F ( RouteEmulationTest  ,
DefaultRoute   
)

Definition at line 265 of file test_route_emulation.cpp.

◆ TEST_F() [3/13]

unittests::TEST_F ( RouteEmulationTest  ,
ExcludeOneSubnet   
)

Definition at line 146 of file test_route_emulation.cpp.

◆ TEST_F() [4/13]

unittests::TEST_F ( RouteEmulationTest  ,
ExcludeServer   
)

Definition at line 185 of file test_route_emulation.cpp.

◆ TEST_F() [5/13]

unittests::TEST_F ( RouteEmulationTest  ,
ExcludeSubnetsNoDefault   
)

Definition at line 159 of file test_route_emulation.cpp.

◆ TEST_F() [6/13]

unittests::TEST_F ( RouteEmulationTest  ,
NestedIPRoutes   
)

Definition at line 208 of file test_route_emulation.cpp.

◆ TEST_F() [7/13]

unittests::TEST_F ( SitnlTest  ,
TestAddrAdd4   
)

Definition at line 166 of file test_sitnl.cpp.

◆ TEST_F() [8/13]

unittests::TEST_F ( SitnlTest  ,
TestAddrAdd6   
)

Definition at line 181 of file test_sitnl.cpp.

◆ TEST_F() [9/13]

unittests::TEST_F ( SitnlTest  ,
TestAddRoute4   
)

Definition at line 207 of file test_sitnl.cpp.

◆ TEST_F() [10/13]

unittests::TEST_F ( SitnlTest  ,
TestAddRoute6   
)

Definition at line 232 of file test_sitnl.cpp.

◆ TEST_F() [11/13]

unittests::TEST_F ( SitnlTest  ,
TestBestGw4   
)

Definition at line 276 of file test_sitnl.cpp.

◆ TEST_F() [12/13]

unittests::TEST_F ( SitnlTest  ,
TestBestGw4FilterIface   
)

Definition at line 306 of file test_sitnl.cpp.

◆ TEST_F() [13/13]

unittests::TEST_F ( SitnlTest  ,
TestSetMTU   
)

Definition at line 194 of file test_sitnl.cpp.

◆ worker_thread()

void unittests::worker_thread ( const uint8_t  id)

Definition at line 131 of file test_cpu_time.cpp.

◆ workload()

static void unittests::workload ( const uint16_t  multiplier)
static

Definition at line 88 of file test_cpu_time.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ path_to_ip [1/2]

std::string unittests::path_to_ip
static

Definition at line 24 of file test_iphelper.cpp.

◆ path_to_ip [2/2]

std::string unittests::path_to_ip
static

Definition at line 28 of file test_sitnl.cpp.

◆ test_cert

std::string unittests::test_cert

Definition at line 26 of file test_mbedtls_x509certinfo.cpp.

◆ test_fingerprint

std::vector<uint8_t> unittests::test_fingerprint
Initial value:
= {
0x44, 0xF5, 0xA6, 0x4D, 0x4A, 0xCB, 0x65, 0xE1, 0x8A, 0x9F, 0x55, 0x89, 0x7F, 0x77, 0xA0, 0x79,
0xAA, 0xFB, 0xCC, 0xA1, 0x37, 0x2F, 0xD8, 0xB3, 0x47, 0xAA, 0x9D, 0xE3, 0xD0, 0x76, 0xB1, 0x44
}

Definition at line 22 of file test_peer_fingerprint.cpp.