GHA/macos: enable HTTPS tests with stunnel

- Install stunnel.

- Regenerate certificates (as SecureTransport requires a validity period
  less than 398 days).

- Restart server if it is unresponsive.

- Do not hardcode the SHA-256 base64 public pinned key.

- Ignore test 313 as SecureTransport does not support crl file.

- Ignore tests 1631 and 1632 as SecureTransport is not yet able to shut
  down FTP over HTTPS gracefully.

- Add a CMake target for generating certificates.

Closes #14486
This commit is contained in:
Aki 2024-08-07 22:57:43 +08:00 committed by Viktor Szakats
parent 7c0b6eb3bd
commit fa461b4eff
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 262 additions and 133 deletions

View file

@ -103,6 +103,8 @@ use testutil qw(
runclient
shell_quote
subbase64
subsha256base64file
substrippemfile
subnewlines
);
use valgrind;
@ -364,6 +366,8 @@ sub prepro {
}
subvariables(\$s, $testnum, "%");
subbase64(\$s);
subsha256base64file(\$s);
substrippemfile(\$s);
subnewlines(0, \$s) if($data_crlf);
push @out, $s;
}
@ -401,6 +405,32 @@ sub logslocked {
return @locks;
}
#######################################################################
# Wait log locks to be unlocked
#
sub waitlockunlock {
# If a server logs advisor read lock file exists, it is an indication
# that the server has not yet finished writing out all its log files,
# including server request log files used for protocol verification.
# So, if the lock file exists the script waits here a certain amount
# of time until the server removes it, or the given time expires.
my $serverlogslocktimeout = shift;
if($serverlogslocktimeout) {
my $lockretry = $serverlogslocktimeout * 20;
my @locks;
while((@locks = logslocked()) && $lockretry--) {
portable_sleep(0.05);
}
if(($lockretry < 0) &&
($serverlogslocktimeout >= $defserverlogslocktimeout)) {
logmsg "Warning: server logs lock timeout ",
"($serverlogslocktimeout seconds) expired (locks: " .
join(", ", @locks) . ")\n";
}
}
}
#######################################################################
# Memory allocation test and failure torture testing.
#
@ -1027,11 +1057,6 @@ sub singletest_clean {
}
}
# If a server logs advisor read lock file exists, it is an indication
# that the server has not yet finished writing out all its log files,
# including server request log files used for protocol verification.
# So, if the lock file exists the script waits here a certain amount
# of time until the server removes it, or the given time expires.
my $serverlogslocktimeout = $defserverlogslocktimeout;
my %cmdhash = getpartattr("client", "command");
if($cmdhash{'timeout'}) {
@ -1040,19 +1065,8 @@ sub singletest_clean {
$serverlogslocktimeout = $1 if($1 >= 0);
}
}
if($serverlogslocktimeout) {
my $lockretry = $serverlogslocktimeout * 20;
my @locks;
while((@locks = logslocked()) && $lockretry--) {
portable_sleep(0.05);
}
if(($lockretry < 0) &&
($serverlogslocktimeout >= $defserverlogslocktimeout)) {
logmsg "Warning: server logs lock timeout ",
"($serverlogslocktimeout seconds) expired (locks: " .
join(", ", @locks) . ")\n";
}
}
waitlockunlock($serverlogslocktimeout);
# Test harness ssh server does not have this synchronization mechanism,
# this implies that some ssh server based tests might need a small delay
@ -1148,6 +1162,9 @@ sub runner_test_preprocess {
# Start the servers needed to run this test case
my ($why, $error) = singletest_startservers($testnum, \%testtimings);
# make sure no locks left for responsive test
waitlockunlock($defserverlogslocktimeout);
if(!$why) {
###############################################################