From 8b1be77c4421067db5c5d2070974cb2fddc840c2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Jun 2026 17:08:05 +0200 Subject: [PATCH] runtests: fix tests for curl builds with embedded CA bundle Reported-by: Rainer Jung Co-authored-by: Rainer Jung Fixes #21970 Follow-up to 8a3740bc8e558b9a9d4a652b74cf27a0961d7010 #14059 Closes #21973 --- tests/runtests.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 14c07a39a7..5d286366c7 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -146,6 +146,9 @@ my %disabled; # disabled test cases my %ignored; # ignored results of test cases my %ignoretestcodes; # if test results are to be ignored +my @global_strip_stderr; # global patterns added to stripfile before stderr check +my @global_strip_file; # global patterns added to stripfile before file check + my $passedign; # tests passed with results ignored my $timestats; # time stamping and stats generation @@ -668,6 +671,8 @@ sub checksystemfeatures { $feature{"SSL"} = $feat =~ /SSL/i; # multiple SSL backends available. $feature{"MultiSSL"} = $feat =~ /MultiSSL/i; + # embedded CA certificate bundle + $feature{"CAcert"} = $feat =~ /CAcert/i; # large file support $feature{"Largefile"} = $feat =~ /Largefile/i; # IDN support @@ -823,6 +828,13 @@ sub checksystemfeatures { $http_unix = 1 if($sws[0] =~ /unix/); } + # strip line from stderr and file output to not confuse tests + if($feature{"CAcert"}) { + my $strip_cacert = 's/^Note: Using embedded CA bundle.*\n//'; + push @global_strip_stderr, $strip_cacert; + push @global_strip_file, $strip_cacert; + } + open(my $manh, "-|", shell_quote($CURL) . " -M 2>&1"); while(my $s = <$manh>) { if($s =~ /built-in manual was disabled at build-time/) { @@ -1333,7 +1345,7 @@ sub singletest_check { # verify redirected stderr my @actual = loadarray(stderrfilename($logdir, $testnum)); - foreach my $strip (@stripfile) { + foreach my $strip (@global_strip_stderr, @stripfile) { chomp $strip; my @newgen; for(@actual) { @@ -1674,7 +1686,7 @@ sub singletest_check { } } - for my $strip (@stripfilepar) { + for my $strip (@global_strip_file, @stripfilepar) { chomp $strip; my @newgen; for(@generated) {