]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: set `CURL_ENTROPY` per test, not globally
authorViktor Szakats <commit@vsz.me>
Sat, 19 Jul 2025 16:45:25 +0000 (18:45 +0200)
committerViktor Szakats <commit@vsz.me>
Sat, 19 Jul 2025 19:30:32 +0000 (21:30 +0200)
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

tests/data/test1972
tests/data/test2300
tests/data/test2301
tests/data/test2302
tests/data/test2303
tests/data/test2304
tests/data/test823
tests/data/test869
tests/data/test907
tests/runner.pm

index 1fb52b4e50fc30f2938220977a6166999b5386d4..5a07d544d4fc15a80be09d3c1df7424561238869 100644 (file)
@@ -39,6 +39,9 @@ Debug
 crypto
 aws
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 
 <name>
 HTTP AWS_SIGV4 for AWS S3: MIMEPOST
index e8a145929f26abdff4272ee02861d47f8e1250e0..6cb941dac367081c0c8d27b340e4388d7fe379c9 100644 (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>
index 61079d28c0bd5e2b4e564227dbb998f9a73e18f9..e3cab99f15f7e356cde867c759d71550294fa8d0 100644 (file)
@@ -32,6 +32,9 @@ upgrade
 Debug
 ws
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <server>
 http
 </server>
index 52887e8b7dc16c60b4c062e63dfa5345c3996d5f..b1d11fcf6e88a91690f2676ac8cf818c2449565b 100644 (file)
@@ -32,6 +32,9 @@ upgrade
 Debug
 ws
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <server>
 http
 </server>
index ab1edb2f57182e2bcda2851db787c073476e022b..d90d23dc9ed5c4146f16439dafc5f9464db963e7 100644 (file)
@@ -25,6 +25,9 @@ hello
 Debug
 ws
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <server>
 http
 </server>
index a141f52ccc63473b64bddf7a2f337fe052745c70..21fac7a0f03e4cd3a1403d41f15c5c8d122aef9c 100644 (file)
@@ -31,6 +31,9 @@ upgrade
 Debug
 ws
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <server>
 http
 </server>
index 3a7686affd38f9704b2bea8914d27f9c903b9dca..91d75fed4a7b35c57a1c3dbec8d279bf2d495136 100644 (file)
@@ -40,6 +40,9 @@ Debug
 crypto
 digest
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <name>
 IMAP DIGEST-MD5 authentication
 </name>
index be374dc2c05419f90e5d3ecbc71c4e05c5a765a6..b6f91a266a02e6024030e4db953d1906ae5535ea 100644 (file)
@@ -42,6 +42,9 @@ Debug
 crypto
 digest
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <name>
 POP3 DIGEST-MD5 authentication
 </name>
index 30d05370caf0acad1f6a1eac8addb9ceef2ffa65..9fddbc0de8e305cc49a1829cc37b58aa1db09b4c 100644 (file)
@@ -32,6 +32,9 @@ Debug
 crypto
 digest
 </features>
+<setenv>
+CURL_ENTROPY=12345678
+</setenv>
 <name>
 SMTP DIGEST-MD5 authentication
 </name>
index d4a4dc385223776bf6eee1c1b4e5920c32b32c58..2122c167caab19f198ffef588dcf6bf1762cfec5 100644 (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;