]> git.ipfire.org Git - thirdparty/openvpn.git/commit
test_user_pass: Check fatal errors for empty username/password
authorFrank Lichtenheld <frank@lichtenheld.com>
Fri, 10 Oct 2025 21:11:47 +0000 (23:11 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 11 Oct 2025 09:51:27 +0000 (11:51 +0200)
commite7fdde7cb8d39a51a4a38b0d16f23a18d086cfe2
treed65f5a1a3b3fed52148884ef96727b8a7fea7f20
parente03d53842b5494d8caf19fc47ea788a32a3544c7
test_user_pass: Check fatal errors for empty username/password

Required a fix to mock_msg to make tests of M_FATAL
possible at all.
This also tests some cases which arguably should throw
a fatal error but do not.

v2:
 - Suppress LeakSanitizer errors for fatal error tests.
   Due to aborting the function, the memory will not be
   cleaned up, but that is expected.
v3:
 - Disable assert tests with MSVC. Does not seem to catch
   the error correctly.
 - Rebase on top of parallel-tests series to get
   AM_TESTS_ENVIRONMENT.
v8:
 - Update srcdir handling according to master.
v10:
 - Update mock_msg.c fatal handling to be compatible
   with NO_CMOCKA.

Change-Id: Icabc8acf75638c86c8c395e9ffecba7a7226cd97
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/474
Message-Id: <20251010211154.2780-1-gert@greenie.muc.de>
URL: https://sourceforge.net/p/openvpn/mailman/message/59245149/
Signed-off-by: Gert Doering <gert@greenie.muc.de>
CMakeLists.txt
tests/unit_tests/openvpn/Makefile.am
tests/unit_tests/openvpn/input/appears_empty.txt [new file with mode: 0644]
tests/unit_tests/openvpn/input/empty.txt [new file with mode: 0644]
tests/unit_tests/openvpn/input/leak_suppr.txt [new file with mode: 0644]
tests/unit_tests/openvpn/mock_msg.c
tests/unit_tests/openvpn/test_user_pass.c