Repository navigation
test(ssh): add proxy-jump (--jump-host) interop test (#1882) - #3542
Merged
Merged
Conversation
oferchen
force-pushed
the
test/ssh-proxy-jump-interop-1882
branch
2 times, most recently
from
May 1, 2026 22:15
f4f6d99 to
d9ec650
Compare
Verifies that --jump-host=<value> propagates as `-J <value>` to the spawned SSH subprocess in the correct argv position (before the destination operand). A POSIX shell-script wrapper named `ssh` records its argv to a temp file and exits 255 so we can assert the wire-level contract without standing up a real two-hop sshd topology. Scenarios covered: - single hop: --jump-host=bastion.example.com - multi-hop chain: --jump-host=alice@a,bob@b - host with port: --jump-host=user@bastion:2200 - absent flag: no -J emitted - empty value: no -J emitted An end-to-end test that exercises a real two-hop SSH transfer through localhost is included but marked #[ignore] (requires sshd + remote rsync). The whole module is #[cfg(unix)] - the recorder relies on a Bourne shell wrapper. Closes #1882; references #1881 (implementation).
oferchen
force-pushed
the
test/ssh-proxy-jump-interop-1882
branch
from
May 2, 2026 01:27
d9ec650 to
b69aa5d
Compare
oferchen
added a commit
that referenced
this pull request
May 5, 2026
Verifies that --jump-host=<value> propagates as `-J <value>` to the spawned SSH subprocess in the correct argv position (before the destination operand). A POSIX shell-script wrapper named `ssh` records its argv to a temp file and exits 255 so we can assert the wire-level contract without standing up a real two-hop sshd topology. Scenarios covered: - single hop: --jump-host=bastion.example.com - multi-hop chain: --jump-host=alice@a,bob@b - host with port: --jump-host=user@bastion:2200 - absent flag: no -J emitted - empty value: no -J emitted An end-to-end test that exercises a real two-hop SSH transfer through localhost is included but marked #[ignore] (requires sshd + remote rsync). The whole module is #[cfg(unix)] - the recorder relies on a Bourne shell wrapper. Closes #1882; references #1881 (implementation).
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
Closes #1882 by adding integration tests that exercise the SSH proxy-jump
(
--jump-host) propagation introduced in #1881.The new file
tests/ssh_proxy_jump.rsverifies that--jump-host=<value>becomes-J <value>on the spawned SSH child'sargv in the correct position (after SSH options, before the destination
operand). A POSIX shell-script wrapper named exactly
sshis droppedinto a
tempfile::TempDir, set as the remote shell via--rsh=<path>,and records its argv before exiting 255. Each test asserts on the
recorded argv, so we exercise the full CLI parser → SSH spawn pipeline
without standing up two real sshd instances.
Hops exercised
--jump-host=bastion.example.com[email protected],[email protected][email protected]:2200-Jmust not appear-Jmust not appearEnd-to-end transfer
end_to_end_proxy_jump_through_localhostis included but marked#[ignore]because a real two-hop topology requires a running sshdplus an installed
rsyncon the remote side; CI workers vary inavailability. The test loops the jump through
localhostso it can berun on any machine that has key-based SSH access to itself:
Skip conditions
#[cfg(unix)](the recorder relies on aBourne shell wrapper). OpenSSH's path semantics on Windows differ
enough that we keep that out of scope here.
ssh localhost trueorremote
rsyncare unreachable.need
/bin/shand a writable tempdir.Notes
--jump-hostflag has no-Jshort alias - upstream rsync3.4.1 reserves
-Jfor--omit-link-times, and oc-rsync mirrorsthat (see
crates/cli/src/frontend/command_builder/sections/transfer_behavior_options.rs).The
-J <value>we assert on is the OpenSSH child argv, not theoc-rsync CLI argv.
-Jwhen the configured remoteshell program's basename is
sshorssh.exe. The recorder scriptis named
sshprecisely so this gate fires.Test plan
cargo nextest run --test ssh_proxy_jumpcargo nextest run --test ssh_proxy_jump -- --ignored