From: Viktor Szakats Date: Sat, 19 Jul 2025 16:45:25 +0000 (+0200) Subject: tests: set `CURL_ENTROPY` per test, not globally X-Git-Tag: curl-8_16_0~442 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fcf22585fa3d87a50c9dddc688d962978c0c120;p=thirdparty%2Fcurl.git tests: set `CURL_ENTROPY` per test, not globally Setting `CURL_ENTROPY` in debug-enabled builds overrides the code paths responsible for random number generation. To avoid masking issue there, this patch moves `CURL_ENTROPY` settings to each test that requires it, and stop setting it by default for all tests (in `runner.pm`). This makes it possible to catch random generator issues in debug-enabled builds; extending test coverage. To keep offering a well-defined state for tests, make `runner.pm` delete the `CURL_ENTROPY` env, if present. Ref: #17970 Closes #17971 --- diff --git a/tests/data/test1972 b/tests/data/test1972 index 1fb52b4e50..5a07d544d4 100644 --- a/tests/data/test1972 +++ b/tests/data/test1972 @@ -39,6 +39,9 @@ Debug crypto aws + +CURL_ENTROPY=12345678 + HTTP AWS_SIGV4 for AWS S3: MIMEPOST diff --git a/tests/data/test2300 b/tests/data/test2300 index e8a145929f..6cb941dac3 100644 --- a/tests/data/test2300 +++ b/tests/data/test2300 @@ -25,11 +25,14 @@ upgrade # # Client-side -# for the forced CURL_ENTROPY +# require Debug for the forced CURL_ENTROPY Debug ws + +CURL_ENTROPY=12345678 + http diff --git a/tests/data/test2301 b/tests/data/test2301 index 61079d28c0..e3cab99f15 100644 --- a/tests/data/test2301 +++ b/tests/data/test2301 @@ -32,6 +32,9 @@ upgrade Debug ws + +CURL_ENTROPY=12345678 + http diff --git a/tests/data/test2302 b/tests/data/test2302 index 52887e8b7d..b1d11fcf6e 100644 --- a/tests/data/test2302 +++ b/tests/data/test2302 @@ -32,6 +32,9 @@ upgrade Debug ws + +CURL_ENTROPY=12345678 + http diff --git a/tests/data/test2303 b/tests/data/test2303 index ab1edb2f57..d90d23dc9e 100644 --- a/tests/data/test2303 +++ b/tests/data/test2303 @@ -25,6 +25,9 @@ hello Debug ws + +CURL_ENTROPY=12345678 + http diff --git a/tests/data/test2304 b/tests/data/test2304 index a141f52ccc..21fac7a0f0 100644 --- a/tests/data/test2304 +++ b/tests/data/test2304 @@ -31,6 +31,9 @@ upgrade Debug ws + +CURL_ENTROPY=12345678 + http diff --git a/tests/data/test823 b/tests/data/test823 index 3a7686affd..91d75fed4a 100644 --- a/tests/data/test823 +++ b/tests/data/test823 @@ -40,6 +40,9 @@ Debug crypto digest + +CURL_ENTROPY=12345678 + IMAP DIGEST-MD5 authentication diff --git a/tests/data/test869 b/tests/data/test869 index be374dc2c0..b6f91a266a 100644 --- a/tests/data/test869 +++ b/tests/data/test869 @@ -42,6 +42,9 @@ Debug crypto digest + +CURL_ENTROPY=12345678 + POP3 DIGEST-MD5 authentication diff --git a/tests/data/test907 b/tests/data/test907 index 30d05370ca..9fddbc0de8 100644 --- a/tests/data/test907 +++ b/tests/data/test907 @@ -32,6 +32,9 @@ Debug crypto digest + +CURL_ENTROPY=12345678 + SMTP DIGEST-MD5 authentication diff --git a/tests/runner.pm b/tests/runner.pm index d4a4dc3852..2122c167ca 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -163,7 +163,7 @@ sub runner_init { # enable memory debugging if curl is compiled with it $ENV{'CURL_MEMDEBUG'} = "$logdir/$MEMDUMP"; - $ENV{'CURL_ENTROPY'}="12345678"; + delete $ENV{'CURL_ENTROPY'} if($ENV{'CURL_ENTROPY'}); $ENV{'CURL_FORCETIME'}=1; # for debug NTLM magic $ENV{'CURL_GLOBAL_INIT'}=1; # debug curl_global_init/cleanup use $ENV{'HOME'}=$pwd;