Commit 304ed350d5 for bind
commit 304ed350d59a753ff821c285b2c96b556ef0b42a
Author: Aydın Mercan <aydin@isc.org>
Date: Mon Aug 17 09:30:30 2026 +0300
Set OPENSSL_CONF and KRYOPTIC_CONF when starting servers
A PKCS#11 system test needs its named instances to run with the
provider and token configuration the test rendered for them, not with
whatever OPENSSL_CONF the environment happens to carry. Let start.pl
look for openssl.cnf and kryoptic.toml in the server directory, then in
the test directory, export them for the server being started, and
restore the previous environment afterwards so that the other servers
of the test are not affected.
diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl
index 61dfe14c6d..1fd3d42025 100755
--- a/bin/tests/system/start.pl
+++ b/bin/tests/system/start.pl
@@ -209,10 +209,34 @@ sub start_server {
chdir "$testdir/$server" or die "unable to chdir \"$testdir/$server\" ($OS_ERROR)\n";
+ my %saved_env;
+
+ $saved_env{'OPENSSL_CONF'} = $ENV{'OPENSSL_CONF'} if exists $ENV{'OPENSSL_CONF'};
+ if (-e "openssl.cnf") {
+ $ENV{'OPENSSL_CONF'} = abs_path("$testdir/$server/openssl.cnf");
+ } elsif (-e "$testdir/openssl.cnf") {
+ $ENV{'OPENSSL_CONF'} = abs_path("$testdir/openssl.cnf");
+ }
+
+ $saved_env{'KRYOPTIC_CONF'} = $ENV{'KRYOPTIC_CONF'} if exists $ENV{'KRYOPTIC_CONF'};
+ if (-e "kryoptic.toml") {
+ $ENV{'KRYOPTIC_CONF'} = abs_path("$testdir/$server/kryoptic.toml");
+ } elsif (-e "$testdir/kryoptic.toml") {
+ $ENV{'KRYOPTIC_CONF'} = abs_path("$testdir/kryoptic.toml");
+ }
+
# start the server
my $child = `$command`;
chomp($child);
+ foreach my $var ('OPENSSL_CONF', 'KRYOPTIC_CONF') {
+ if (exists $saved_env{$var}) {
+ $ENV{$var} = $saved_env{$var};
+ } else {
+ delete $ENV{$var};
+ }
+ }
+
# wait up to 90 seconds for the server to start and to write the
# pid file otherwise kill this server and any others that have
# already been started