curl-curl/tests
Viktor Szakats 73840836a5
tests: move GSS-API dynamic stub into debug-mode libcurl
Replace the `libstubgss.so`-based overload solution with one built into
libcurl at compile-time.

The previous, `LD_PRELOAD`-based, solution was non-portable, allowlisted
for Linux, BSD and Solaris. It also required non-debug builds, which
turned out to be an accidental condition:
7d342c723c. It also required a curl tool
built against a shared libcurl. Detecting this condition wasn't always
accurate, e.g. with certain cmake configurations.

The overload solution also didn't work on macOS, though it theoretically
should have:
- #17653
- #2394

Experiments on making the overload solution work in more envs:
- #17759
  That revealed that it also did not work on NetBSD, in CI.

The replacement solution is overloading the necessary GSS-API functions
for test 2056 and 2057 at compile time. It requires a debug-enabled curl
build (due to its insecure nature).

This makes these tests run on all platforms. Including most GSS jobs in
CI, that are running tests. (the exception is old-linux, non-debug jobs,
where it felt overkill to enable debug for this.)

The refactored GSS stub code needs to overload less than before because
it's free to use the official GSS API. (This didn't work with
the overload solution on Alpine for example). It can also use libcurl
functions, allowing to replace `snprintf()` with `msnprintf()`.

OS/400 is also overloading GSS API functions. I haven't tested how this
works after this PR. In theory it should, because this PR doesn't rely
on preprocessor overrides.

Note that for future GSS tests, it may be necessary to stub these GSS
API functions: `gss_inquire_context()`, `gss_unwrap()`, `gss_wrap()`.
They are on codepaths not (yet) touched by tests.

Also:
- stub-gss: check for token buffer overrun.
- stub-gss: replace size macros with `sizeof()`.
- GHA: enable debug for some jobs with GSS.
- GHA/linux: ignore results for 2056 and 2057 in the valgrind job.
  They leak the same way as seen with 2077 and 2078.
  Ref: 7020ba7979 #17462
  Ref: 146759716c #14430
- GHA/linux: fix to ignore `gss_import_name()` leaks in valgrind builds.
  only.
- lib/vauth/krb5_gssapi: reduce variable scope.
- lib/vauth/spnego_gssapi: reduce variable scope.
- tests/libtest: drop code and build logic dealing with `libstubgss`.
- runtests:
  - drop `ld_preload` feature.
  - drop special handling of `LD_PRELOAD` env in tests.
  - drop logic dealing with shared curl tool detection.
  - drop `LD_PRELOAD` envs from tests.

Follow-up to 56d949d31a #1687

Closes #17752
2025-07-01 00:17:15 +02:00
..
certs tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
client tests: fix BUNDLE variable references in Makefile.am 2025-06-26 10:55:47 +02:00
cmake cmake: replace cmakelint with cmake-lint from cmakelang, fix issues 2025-06-11 07:07:49 +02:00
data tests: move GSS-API dynamic stub into debug-mode libcurl 2025-07-01 00:17:15 +02:00
http cf-socket: make socket data_pending a nop 2025-06-30 13:44:24 +02:00
libtest tests: move GSS-API dynamic stub into debug-mode libcurl 2025-07-01 00:17:15 +02:00
server checksrc: reduce exceptions, apply again to curlx 2025-06-27 17:33:35 +02:00
tunit tests: fix BUNDLE variable references in Makefile.am 2025-06-26 10:55:47 +02:00
unit unit tests: extract "private" prototypes at build time 2025-06-30 23:16:40 +02:00
.gitignore tidy-up: .gitignore lines mostly 2025-01-27 20:59:46 +01:00
allversions.pm VERSIONS: list all past releases 2025-04-03 08:26:33 +02:00
appveyor.pm
azure.pm
CMakeLists.txt cmake: replace the way clang-tidy verifies tests, fix issues found 2025-06-22 23:08:46 +02:00
config.in
configurehelp.pm.in build: use configurehelp.pm.in with autotools and cmake 2024-09-21 12:21:14 +02:00
devtest.pl tests: replace hard-coded /dev/null with variable 2024-10-01 12:07:19 +02:00
dictserver.py tidy-up: align MSYS2/Cygwin codepaths, follow Cygwin MAX_PID bump 2025-02-21 11:58:05 +01:00
directories.pm scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
ech_combos.py tidy-up: whitespace [ci skip] 2024-04-16 09:53:39 +02:00
ech_tests.sh doh: httpsrr fix 2025-04-18 23:03:31 +02:00
ftpserver.pl scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
getpart.pm scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
globalconfig.pm tests: move GSS-API dynamic stub into debug-mode libcurl 2025-07-01 00:17:15 +02:00
http2-server.pl CI: fix OpenBSD tests stall 2025-06-05 09:12:22 +02:00
http3-server.pl tests: use a more portable null device path 2025-04-04 03:40:47 -04:00
http-server.pl runtests: support multi-target cmake, drop workarounds from CI 2025-02-24 21:00:30 +01:00
Makefile.am tests/http/clients: move to tests/client 2025-06-17 19:39:36 +02:00
memanalyze.pl memanalyze.pl: fix getaddrinfo/freeaddrinfo checks 2025-06-01 10:24:31 +02:00
negtelnetserver.py tidy-up: align MSYS2/Cygwin codepaths, follow Cygwin MAX_PID bump 2025-02-21 11:58:05 +01:00
nghttpx.conf
pathhelp.pm runtests: fix SSH server not starting in cases, re-ignore failing vcpkg CI jobs 2025-03-09 23:28:07 +01:00
processhelp.pm tests: improve server start reliability 2025-06-02 11:03:10 +02:00
requirements.txt
rtspserver.pl runtests: support multi-target cmake, drop workarounds from CI 2025-02-24 21:00:30 +01:00
runner.pm tests: move GSS-API dynamic stub into debug-mode libcurl 2025-07-01 00:17:15 +02:00
runtests.pl tests: move GSS-API dynamic stub into debug-mode libcurl 2025-07-01 00:17:15 +02:00
secureserver.pl tests: Add https-mtls server to force client auth 2025-04-07 08:46:56 +02:00
serverhelp.pm tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
servers.pm tests/servers.pm: add more ways to figure out current user 2025-06-06 23:07:29 +02:00
smbserver.py tidy-up: align MSYS2/Cygwin codepaths, follow Cygwin MAX_PID bump 2025-02-21 11:58:05 +01:00
sshhelp.pm runtests: fix test key format for libssh2 WinCNG (and others) 2025-03-23 20:26:26 +01:00
sshserver.pl tests: make sshserver less verbose 2025-06-17 12:20:10 +02:00
test745.pl typecheck-gcc.h: fix the typechecks 2025-04-24 13:23:49 +02:00
test971.pl VERSIONS: list all past releases 2025-04-03 08:26:33 +02:00
test1119.pl cmake: fix clang-tidy builds to verify tests, fix fallouts 2025-03-24 10:14:58 +01:00
test1132.pl tests: rename tests scripts to the test number 2023-12-08 12:53:17 +01:00
test1135.pl tests: Remove unused variables 2025-03-22 11:12:29 -07:00
test1139.pl tool_getparam: add "TLS required" flag for each such option 2025-02-06 11:39:35 +01:00
test1140.pl tests/scripts: call it 'manpage' (single word) 2024-07-18 15:12:09 +02:00
test1165.pl buildinfo: move from tests/server/ to src/, rename to curlinfo 2025-04-28 22:40:10 +02:00
test1167.pl tests: Remove unused variables 2025-03-22 11:12:29 -07:00
test1173.pl test1173.pl: whitelist some option-looking names that aren't options 2025-05-15 22:43:54 +02:00
test1175.pl test1175: scan libcurl-errors.md, not the generated .3 version 2024-07-09 23:13:40 +02:00
test1177.pl NTLM_WB: drop support 2024-04-08 13:58:58 +02:00
test1222.pl scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
test1275.pl docs: improve cipher options documentation 2024-08-17 11:14:21 +02:00
test1276.pl tests: rename tests scripts to the test number 2023-12-08 12:53:17 +01:00
test1477.pl cmake: fix clang-tidy builds to verify tests, fix fallouts 2025-03-24 10:14:58 +01:00
test1486.pl write-out.md: add 'header' and 'output' to the variable list 2025-02-12 17:49:37 -05:00
test1488.pl VERSIONS: list all past releases 2025-04-03 08:26:33 +02:00
test1544.pl scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
test1707.pl test1707: output diff more for debugging differences in CI outputs 2024-08-16 08:57:19 +02:00
testcurl.pl scripts: fix perl indentation, whitespace, semicolons 2025-04-29 19:35:55 +02:00
testutil.pm runtests: support running tests under wine or qemu 2025-03-23 20:26:38 +01:00
tftpserver.pl tests: Remove unused variables 2025-03-22 11:12:29 -07:00
util.py tests: enable additional ruff Python lint options 2024-10-04 14:03:17 -07:00
valgrind.pm tests/valgrind.pm: fix warnings with no valgrind report to show 2024-09-20 15:40:07 +02:00
valgrind.supp hyper: drop support 2024-12-21 11:33:05 +01:00