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
This commit is contained in:
Viktor Szakats 2025-07-19 18:45:25 +02:00
parent 7946bbbbe2
commit 1fcf22585f
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
10 changed files with 29 additions and 2 deletions

View File

@ -39,6 +39,9 @@ Debug
crypto
aws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<name>
HTTP AWS_SIGV4 for AWS S3: MIMEPOST

View File

@ -25,11 +25,14 @@ upgrade
#
# Client-side
<client>
# for the forced CURL_ENTROPY
# require Debug for the forced CURL_ENTROPY
<features>
Debug
ws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<server>
http
</server>

View File

@ -32,6 +32,9 @@ upgrade
Debug
ws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<server>
http
</server>

View File

@ -32,6 +32,9 @@ upgrade
Debug
ws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<server>
http
</server>

View File

@ -25,6 +25,9 @@ hello
Debug
ws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<server>
http
</server>

View File

@ -31,6 +31,9 @@ upgrade
Debug
ws
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<server>
http
</server>

View File

@ -40,6 +40,9 @@ Debug
crypto
digest
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<name>
IMAP DIGEST-MD5 authentication
</name>

View File

@ -42,6 +42,9 @@ Debug
crypto
digest
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<name>
POP3 DIGEST-MD5 authentication
</name>

View File

@ -32,6 +32,9 @@ Debug
crypto
digest
</features>
<setenv>
CURL_ENTROPY=12345678
</setenv>
<name>
SMTP DIGEST-MD5 authentication
</name>

View File

@ -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;