Repository navigation
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
vszakats
force-pushed
the
ac-test-order
branch
3 times, most recently
from
April 22, 2023 01:15
d62ab7a to
67dfe02
Compare
This comment was marked as resolved.
This comment was marked as resolved.
vszakats
marked this pull request as draft
April 22, 2023 09:05
vszakats
force-pushed
the
ac-test-order
branch
6 times, most recently
from
April 23, 2023 19:09
4750eac to
66cc424
Compare
vszakats
force-pushed
the
ac-test-order
branch
3 times, most recently
from
April 23, 2023 22:50
cc3e677 to
970c091
Compare
Also add `tests/ssh2.sh` to CMake. This makes `test_aa_warmup` the first test with autotools too. Just in case. Closes #xxx
Unused since cf80f2f
fixes there warnings when running `ssh2.sh` (e.g. in GitHub Actions): ``` 43: command-line line 0: Deprecated option UsePrivilegeSeparation 43: command-line line 0: Deprecated option UsePrivilegeSeparation ``` Ref: https://github.com/libssh2/libssh2/actions/runs/4768463292/jobs/8477816945#step:6:919
Sync with sshdwrap.
Also cleanup the way we call mansyntax.sh. This does not change the end result.
test_ssh2 can and should be added to TEST_TARGETS just like any other test binaries we build.
With a few small changes, ssh2.sh can server the same purpose.
using OPENSSH_SERVER_PORT does not work because in AppVeyor, it holds the port used by the dockerized server.
This reverts commit 4ca9bb0.
Replacing the non-portable fcntl() call.
Member
Author
|
@dfandrich Such test would only confirm that these static lines are present in the source. Repeat dynamic tests for this seem overkill. The bigger issue is that OpenSSH deleted this alias in v8.5 (shipping with the next Debian stable and now in |
Contributor
|
If we can't even test it properly any more, then I agree, we just leave it as-is.
|
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
TL;DR: Sync test builds between autotools and CMake. Sync sshd
configuration between Docker and non-Docker fixtures. Bump up
sshd_config for recent OpenSSH releases.
This also opens up the path to have non-Docker tests that use a
local sshd process. Though sshd is practically unusable on Windows
CI machines out of the box, so this will need further efforts.
Details:
- cmake: run sshd fixture test just like autotool did already.
- sync tests and their order between autotools and CMake.
It makes `test_aa_warmup` the first test with both.
- cmake: load test lists from `Makefile.am`.
Needed to update the loader to throw away certain lines to keep the
converted output conform CMake syntax. Using regexp might be an
alternative way of doing this, but couldn't make it work.
- cmake: use the official way to configure test environment variables.
Switch to syntax that's extendable.
- cmake: allow to run the same test both under Docker and sshd fixture.
Useful for testing the sshd fixture runner, or how the same test
behaves in each fixture.
- update test fixture to read the username from `USER` envvar instead of
using the Dockfile-specific hardwired one, when running outside Docker.
- rework `ssh2.sh` into `sshd_fixture.sh`, to:
- allow running any tests (not just `test_ssh2`).
- configure Docker tests for running outside Docker.
- fixup `SSHD` path when running on Windows (e.g. in AppVeyor CI).
Fixes: `sshd re-exec requires execution with an absolute path`
- allow overriding `PUBKEY` and `PRIVKEY` envvars.
- allow overriding `ssh_config` via `SSHD_FIXTURE_CONFIG`.
- prepare support for running multiple tests via sshd_fixture.
Add a TAP runner for autotools and extend CMake logic. The TAP runner
loads the test list from `Makefile.am`.
Notice however that on Windows, `sshd_fixture.sh` is very flaky with
GitHub Actions. And consistently broken for subsequent tests in
AppVeyor CI:
'libssh2_session_handshake failed (-43): Failed getting banner'
Another way to try is a single sshd instance serving all tests.
For CMake this would probably mean using an external script.
- ed25519 test keys were identical for auth and host. Regenerate the
auth keypair to make them distinct.
- sync the sshd environment between Docker and sshd_fixture.
- use common via `openssh_server/sshd_config`.
- accept same auth keys.
- offer the same host keys.
- sync TrustedUserCAKeys.
- delete now unused keypairs: `etc/host*`, `etc/user*`.
- bump up startup delay for Windows (randomly, to 5 secs, from 3).
- delete `UsePrivilegeSeparation no` to avoid deprecation warnings.
`command-line line 0: Deprecated option UsePrivilegeSeparation`
- delete `Protocol 2` to avoid deprecation warnings.
It has been the default since OpenSSH 3.0 (2001-11-06).
- delete `StrictModes no` (CI tests work without it, Docker tests
never used it).
- bump `Dockerfile` base image to `testing-slim` (from `bullseye-slim`).
It needed `sshd_config` updates to keep things working with
OpenSSH 9.2 (compared to bullseye's 8.4).
- replace `ChallengeResponseAuthentication` alias with
`KbdInteractiveAuthentication`.
The former is no longer present in default `sshd_config` since
OpenSSH 8.7 (2021-08-20). This broke the `Dockerfile` script.
The new name is documented since OpenSSH 4.9 (2008-03-31)
- add `PubkeyAcceptedKeyTypes +ssh-rsa,ssh-dss,[email protected]`
and `HostKeyAlgorithms +ssh-rsa`.
Original-patch-by: Eric van Gyzen (@vangyzen on github)
Fixes libssh2#691
There is a new name for `PubkeyAcceptedKeyTypes`:
`PubkeyAcceptedAlgorithms`.
It requires OpenSSH 8.5 (2021-03-03) and breaks some envs so we're
not using it just yet.
- drop `[email protected]` tests and references from config.
This is a draft alias for `aes256-cbc`. No need to test it twice.
Also this alias is no longer recognized by OpenSSH 8.5 (2021-03-03).
- update `mansyntax.sh` and `sshd_fixture.sh` to not rely on `srcdir`.
Hopefully this works with out-of-tree builds.
- fix `test_read_algos.test` to honor CRLF EOLs in their inputs
(necessary when running on Windows.)
- fix `test_read_algos.test` to honor `EXEEXT`. Might be useful when
running tests under cross-builds?
- `test_ssh2.c`:
- use libssh2 API to set blocking mode. This makes it support all
platforms.
- adapt socket open timeout logic from `openssh_fixture.c`.
Sadly this did not help fix flakiness on GHA Windows.
- tests: delete unused C headers and variable initialization.
- delete unused test files: `sshd_fixture.sh.in`, `sshdwrap`,
`etc/sshd_config`.
Ref: cf80f2f
- autotools: delete stray `.c` test sources from `EXTRA_DIST` in tests.
- `tests/.gitignore`: drop two stray tests.
- autotools: fix passing `SSHD` containing space (Windows needs this).
- autotools: sort `EXTRA_DIST` in tests.
- cmake: fix to add `test_ssh2` to `TEST_TARGETS`.
- fix `authorized_key` order in `tests/gen_keys.sh`.
- silence shellcheck warning in `ci/checksrc.sh`.
- set `SSHD` for autotools on GitHub Actions Windows. [skipped]
Auto-detection doesn't work (maybe because sshd is installed via
Git for Windows and we're using MSYS2's shell.)
It enables running sshd fixture (non-Docker) tests in these jobs.
I did not include this in the final patch due to flakiness:
```
Connection to 127.0.0.1:4711 attempt #0 failed: retrying...
Connection to 127.0.0.1:4711 attempt libssh2#1 failed: retrying...
Connection to 127.0.0.1:4711 attempt libssh2#2 failed: retrying...
Failure establishing SSH session: -43
```
Can be enabled with:
`export SSHD='C:/Program Files/Git/usr/bin/sshd.exe'`
Closes libssh2#996
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 11, 2026
Follow-up to a459a25 libssh2#996 Follwo-up to a88a727 Follow-up to 984d008 libssh2#490
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 11, 2026
Follow-up to a459a25 libssh2#996 Follwo-up to a88a727 Follow-up to 984d008 libssh2#490
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 12, 2026
- openssh_fixture: fix overly long retry delay on non-Windows, when acquiring docker machine IP. - test_ssh2: fix overly short retry delay on Windows, on connect. Follow-up to a459a25 libssh2#996 Follow-up to a88a727 Follow-up to 984d008 libssh2#490 Follow-up to cf80f2f Closes libssh2#1853
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Sync test builds between autotools and CMake. Sync sshd
configuration between Docker and non-Docker fixtures. Bump up
sshd_config for recent OpenSSH releases.
This also opens up the path to have non-Docker tests that use a
local sshd process. Though sshd is practically unusable on Windows
CI machines out of the box, so this will need further efforts.
Details:
cmake: run sshd fixture test just like autotool did already.
sync tests and their order between autotools and CMake.
It makes
test_aa_warmupthe first test with both.cmake: load test lists from
Makefile.am.Needed to update the loader to throw away certain lines to keep the
converted output conform CMake syntax. Using regexp might be an
alternative way of doing this, but couldn't make it work.
cmake: use the official way to configure test environment variables.
Switch to syntax that's extendable.
cmake: allow to run the same test both under Docker and sshd fixture.
Useful for testing the sshd fixture runner, or how the same test
behaves in each fixture.
update test fixture to read the username from
USERenvvar instead ofusing the Dockfile-specific hardwired one, when running outside Docker.
rework
ssh2.shintosshd_fixture.sh, to:test_ssh2).SSHDpath when running on Windows (e.g. in AppVeyor CI).Fixes:
sshd re-exec requires execution with an absolute pathPUBKEYandPRIVKEYenvvars.ssh_configviaSSHD_FIXTURE_CONFIG.prepare support for running multiple tests via sshd_fixture.
Add a TAP runner for autotools and extend CMake logic. The TAP runner
loads the test list from
Makefile.am.Notice however that on Windows,
sshd_fixture.shis very flaky withGitHub Actions. And consistently broken for subsequent tests in
AppVeyor CI:
'libssh2_session_handshake failed (-43): Failed getting banner'
Another way to try is a single sshd instance serving all tests.
For CMake this would probably mean using an external script.
ed25519 test keys were identical for auth and host. Regenerate the
auth keypair to make them distinct.
sync the sshd environment between Docker and sshd_fixture.
openssh_server/sshd_config.etc/host*,etc/user*.UsePrivilegeSeparation noto avoid deprecation warnings.command-line line 0: Deprecated option UsePrivilegeSeparationProtocol 2to avoid deprecation warnings.It has been the default since OpenSSH 3.0 (2001-11-06).
StrictModes no(CI tests work without it, Docker testsnever used it).
bump
Dockerfilebase image totesting-slim(frombullseye-slim).It needed
sshd_configupdates to keep things working withOpenSSH 9.2 (compared to bullseye's 8.4).
replace
ChallengeResponseAuthenticationalias withKbdInteractiveAuthentication.The former is no longer present in default
sshd_configsinceOpenSSH 8.7 (2021-08-20). This broke the
Dockerfilescript.The new name is documented since OpenSSH 4.9 (2008-03-31)
add
PubkeyAcceptedKeyTypes +ssh-rsa,ssh-dss,[email protected]and
HostKeyAlgorithms +ssh-rsa.Original-patch-by: Eric van Gyzen (@vangyzen on github)
Fixes tests: fix ssh2.sh for OpenSSH 8.8 and newer #691
There is a new name for
PubkeyAcceptedKeyTypes:PubkeyAcceptedAlgorithms.It requires OpenSSH 8.5 (2021-03-03) and breaks some envs so we're
not using it just yet.
drop
[email protected]tests and references from config.This is a draft alias for
aes256-cbc. No need to test it twice.Also this alias is no longer recognized by OpenSSH 8.5 (2021-03-03).
update
mansyntax.shandsshd_fixture.shto not rely onsrcdir.Hopefully this works with out-of-tree builds.
fix
test_read_algos.testto honor CRLF EOLs in their inputs(necessary when running on Windows.)
fix
test_read_algos.testto honorEXEEXT. Might be useful whenrunning tests under cross-builds?
test_ssh2.c:platforms.
openssh_fixture.c.Sadly this did not help fix flakiness on GHA Windows.
tests: delete unused C headers and variable initialization.
delete unused test files:
sshd_fixture.sh.in,sshdwrap,etc/sshd_config.Ref: cf80f2f
autotools: delete stray
.ctest sources fromEXTRA_DISTin tests.tests/.gitignore: drop two stray tests.autotools: fix passing
SSHDcontaining space (Windows needs this).autotools: sort
EXTRA_DISTin tests.cmake: fix to add
test_ssh2toTEST_TARGETS.fix
authorized_keyorder intests/gen_keys.sh.silence shellcheck warning in
ci/checksrc.sh.set
SSHDfor autotools on GitHub Actions Windows. [skipped]Auto-detection doesn't work (maybe because sshd is installed via
Git for Windows and we're using MSYS2's shell.)
It enables running sshd fixture (non-Docker) tests in these jobs.
I did not include this in the final patch due to flakiness:
Can be enabled with:
export SSHD='C:/Program Files/Git/usr/bin/sshd.exe'Closes #996