0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00
Commit Graph

450 Commits

Author SHA1 Message Date
Mark Deric
1a5e4a7558 Add a unit test for checking header dependencies
Signed-off-by: Mark Deric <jmark@openvpn.net>
2022-07-21 11:08:42 -07:00
Frank Lichtenheld
273297d630 test/unittests: Add newly imported unittests
Note that the test suite now depends on jsoncpp
and xxHash.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-06 11:21:28 +02:00
Frank Lichtenheld
757a06de99 test_pktid: add explicit cast for PIDRecv::REPLAY_WINDOW_SIZE
mingw complained about this.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-06 11:21:28 +02:00
Frank Lichtenheld
d1097e6169 test_path: add missing output file for windows build
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-06 11:17:18 +02:00
Frank Lichtenheld
1cdc74d5ed Merge various unittests into Core library
When the OpenVPN3 Core library was carved out,
the existing test cases in test/misc were not
analyzed whether they only test functionality
in the library.

Import all tests for which that is true now,
including their history. Note that many of
the commit messages from this history already
exist in the OpenVPN3 repository from the first
creation of the Core library repository. So we
prefix all commit messages in this import with
[test/misc] to make it easy to see where they
are coming from.

Required changes to CMakeLists.txt will be done
after this merge.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-06 11:17:18 +02:00
Frank Lichtenheld
ab04ffd636 [test/misc] test_time: fix range error to show correct interval
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-01 15:57:30 +02:00
James Yonan
90f7bfe8cb [test/misc] unittests: added new test for HostPort::split_host_port()
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
8af57e98fe [test/misc] Adjust unit test to Allow loading private keys with legacy algorithm change
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
David Sommerseth
7490176946 [test/misc] unittest: Update capture test to use new IPv6 block API
The Core library moved from tun_builder_set_block_ipv6() to
tun_builder_set_allow_family() in a recent update.  This change needs to
be reflected in the Common library as well.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
43997ef232 [test/misc] unittests: added test_typeindex.cpp that's a POC for using std::typeindex as a faster replacement for dynamic_cast
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
b1aea61463 [test/misc] unittests: time.timeskew: slightly increase nominal range to reduce probability of failures
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
9350d5710f [test/misc] unit tests: Option::render() no longer emits lines with a trailing space
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
bf50b9086d [test/misc] unittests: added test_weak for testing weak references
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
eb8ab4c0c9 [test/misc] Updated system_cmd() calls to reflect newly added sigset_t* parameter
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
bd85b22e27 [test/misc] Convert http header redact test to Google unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
f2775f05f7 [test/misc] Fix multiple instances of comparison of signed with unsigned 2022-07-01 15:57:30 +02:00
Arne Schwabe
0a6e916eb0 [test/misc] Fix compiler warnings with -Wall and clang and gcc
All warnings eliminated are unused functions/variables

gcc does not like the the ASSERT_EQ macro  with << without braces around
it
2022-07-01 15:57:30 +02:00
James Yonan
a6f5f263b3 [test/misc] HTTP: before logging, pass HTTP headers through HTTP::headers_redact()
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
2e3ced25a0 [test/misc] Convert parsetest tests to unit tests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
bd663fd77f [test/misc] Disable unix only unit tests on windows
- Move misc tempfile test that requires unix to misc_unix test

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
c249d13547 [test/misc] Convert time tests to unit tests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
bbb00aa932 [test/misc] Convert pktid test to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
a3d1e3b51e [test/misc] Convert misc/path to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
aec6ba3b71 [test/misc] Convert hashstr to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
ce9bd51f72 [test/misc] Convert test/pool to unit test
Rename test_icmp6csum to test_ip to collect all small ip related tests

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
abbc91ca62 [test/misc] Convert port_offset to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
8dbcd541c7 [test/misc] Convert test_timeskew.cpp to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
141e71020a [test/misc] Convert session/token related tests to unit tests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
a1d2e8d8a1 [test/misc] Covert skmove into unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
f2eb9e52f3 [test/misc] Convert parseargv to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
ea2640fed3 [test/misc] Fix unit tests on Windows
- use platform independent random instead DevURand
- use pipe only on Unix

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
f62f73aa39 [test/misc] Convert capture test to unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
fc719040d7 [test/misc] Convert misc/rc to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
ecb75b3644 [test/misc] Convert misc/route to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
3bedfb5458 [test/misc] Convert misc/static_key.cpp to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
7626d69345 [test/misc] Convert misc/cleanup.cpp to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
58875e8ff4 [test/misc] Convert icmp6csum to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
4a82cfd984 [test/misc] Convert format.cpp to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
0634043550 [test/misc] Convert prefix length test to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
482950fe3d [test/misc] Convert testpipe into unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
f2cfd225ba [test/misc] Convert streq test to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
775f1313a2 [test/misc] Convert token encrypt test to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
fffcb8083a [test/misc] Convert validate_creds test to unittests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
59084a962e [test/misc] Convert IP checksum test to unittest
Lower amount of round from 10 million to 1 million since the test
will now be run every time and otherwise takes 20s

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
Arne Schwabe
4ea420ad01 [test/misc] Convert OpenSSL PKI test to unittest
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
dccfd5bc09 [test/misc] testing: added jytest unit test wrapper
See test/jytest/README.txt for documentation.

Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
bba08fff25 [test/misc] tests: updated test/misc/sess_id.cpp to use the new conflict parameter added to SessionIDType::find_weak()
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
168541a039 [test/misc] tests: moved misc/certcrl.cpp into test/openssl_pki and expanded its function
test/openssl_pki/pkitest.cpp (formerly moved misc/certcrl.cpp)
is an attempt to more fully test the OpenSSL PKI wrappers.

Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
8a5ce39bf1 [test/misc] tests: added streq.cpp
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00
James Yonan
0d75d41189 [test/misc] tests: added test for path::is_contained()
Signed-off-by: James Yonan <james@openvpn.net>
2022-07-01 15:57:30 +02:00