chore: resolve host key verification follow-ups - #260
Merged
Conversation
Serialize HOME-sensitive tests with a shared helper lock, remove the known_hosts fast-path serialization for definite matches, and keep fresh known_hosts files from starting with a blank line. Bring the shared ServerCheckMethod mirror back in sync with the client enum and make socket-address slice hostnames use one recordable address instead of a comma-separated host list. Validation: CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib ssh::tokio_client::host_verification; focused HOME tilde test passed 10 consecutive runs; CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo check --lib --tests; CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo clippy --lib --tests -- -D warnings. Closes #243
inureyes
added a commit
that referenced
this pull request
Aug 3, 2026
## Summary - Restore `&[SocketAddr]::host_port` to the trait implementation after the PR #260 / PR #258 auto-merge placed it inside the test module. - Merge the #243 first-address hostname tests and #257 host-port parsing tests into one valid `tests` module so both behavior checks remain compiled. ## Validation - `cargo fmt --check` - `CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib to_socket_addrs_with_hostname` - `CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo check --lib --tests` - `CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo clippy --lib --tests -- -D warnings` Refs #243. Refs #257.
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.
Summary
Resolve the host-key follow-ups from #243: HOME-sensitive tests now share a lock, known-host matches avoid the write-side lock, fresh known_hosts files no longer start with a blank line, the shared server-check enum mirrors the client enum, and socket-address slices now return one recordable hostname.
What changed
EnvGuardplus a read-side lock for the tilde expansion test.learn_known_hosts_pathcan add to a pre-created empty file.AcceptNewKnownHostsFileandAcceptNewInMemoryto the sharedServerCheckMethodmirror with conversions to and from the client enum.ToSocketAddrsWithHostname for &[SocketAddr]to use the first address IP instead of joining all IPs with commas.Test plan
CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib test_helpers::env_guard::testsCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib commands::interactive::utils::tests::test_expand_path_with_tildefor i in 1 2 3 4 5 6 7 8 9 10; do CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib commands::interactive::utils::tests::test_expand_path_with_tilde || exit 1; doneCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib shared::auth_types::tests::test_server_check_methodCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib ssh::tokio_client::to_socket_addrs_with_hostname::testsCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --lib ssh::tokio_client::host_verificationCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo check --lib --testsCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo clippy --lib --tests -- -D warningsNote: the issue asked for repeated full
cargo test --lib, but this chain unit explicitly forbids broadcargo test --lib; the repeated validation above uses the focused tilde regression instead.Closes #243