← Commit list

c07a7f6bf8

Viktor Szakats
Viktor Szakats
2025-11-16
SUCCESS Duration: 150s

Subject

runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.circleci/config.yml+4 -0
@@ -105,6 +105,10 @@ commands:
- run:
command: |
source ~/venv/bin/activate
+ # Revert a CircleCI-specific local setting that makes test 1459
+ # return 67 (CURLE_LOGIN_DENIED) instead of the
+ # expected 60 (CURLE_PEER_FAILED_VERIFICATION).
+ echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
executors:
docs/tests/FILEFORMAT.md+1 -1
@@ -504,7 +504,7 @@ Features testable here are:
- `large-size` (size_t is larger than 32-bit)
- `libssh2`
- `libssh`
-- `oldlibssh` (versions before 0.9.4)
+- `badlibssh` (libssh configuration incompatible with the test suite)
- `libz`
- `local-http`. The HTTP server runs on 127.0.0.1
- `manual`
tests/data/test1459+3 -2
@@ -14,7 +14,7 @@ sftp
</server>
<features>
sftp
-!oldlibssh
+!badlibssh
</features>
<name>
SFTP with corrupted known_hosts
@@ -30,7 +30,8 @@ R93Ey5VtBeBblYTRlFXBWJgKFcTKBRJ/O4qBZwbUgt10AHj31i6h8NehfT19tR8wG/YCmj3KtYLHmwdz
# Verify data after the test has been "shot"
<verify>
-# old libssh installs return the wrong thing
+# badlibssh configurations return the wrong thing: 67 CURLE_LOGIN_DENIED,
+# instead of 60 CURLE_PEER_FAILED_VERIFICATION.
<errorcode>
60
</errorcode>
tests/runtests.pl+14 -5
@@ -632,11 +632,20 @@ sub checksystemfeatures {
}
if($libcurl =~ /libssh\/([0-9.]*)\//i) {
$feature{"libssh"} = 1;
- if($1 =~ /(\d+)\.(\d+).(\d+)/) {
- my $v = $1 * 100 + $2 * 10 + $3;
- if($v < 94) {
- # before 0.9.4
- $feature{"oldlibssh"} = 1;
+ # Detect simple cases of default libssh configuration files ending up
+ # setting `StrictHostKeyChecking no`. include files, quoted values,
+ # '=value' format not implemented.
+ $feature{"badlibssh"} = 0;
+ foreach my $libssh_configfile (('/etc/ssh/ssh_config', $ENV{'HOME'} . '/.ssh/config')) {
+ if(open(my $fd, '<', $libssh_configfile)) {
+ while(my $line = <$fd>) {
+ chomp $line;
+ if($line =~ /^\s*StrictHostKeyChecking\s+(yes|no)\s*$/) {
+ $feature{"badlibssh"} = ($1 eq 'no' ? 1 : 0);
+ last; # Do as openssh and libssh
+ }
+ }
+ close($fd);
}
}
}