runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)
No binary (build failed)
—
(log yok)
| @@ -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: | |
| @@ -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` | |
| @@ -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> | |
| @@ -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); |
| } | |
| } | |
| } | |