Repository navigation
test(interop): tcpdump-based wire-equivalence test against upstream (#2075) - #4239
Merged
Merged
Conversation
Add a daemon-vs-daemon byte equivalence probe that captures upstream rsync 3.4.1 and oc-rsync running the same push scenario via tcpdump, strips IP/TCP framing with tshark, normalizes ephemeral ports, and compares the resulting application payload hashes. * scripts/wire-equivalence-tcpdump.sh - self-contained harness that spins up both daemons on loopback inside a per-invocation scratch directory (never touches the workspace), runs an identical small-tree scenario through each, and exits 0 on match, 1 on divergence, 77 on skip (missing CAP_NET_RAW, no upstream binary, non-Linux host). * tools/ci/run_wire_equivalence.sh - CI wrapper that probes the host for tcpdump/tshark and the two rsync binaries, skipping gracefully on platforms that cannot capture loopback traffic. * crates/protocol/tests/wire_equivalence_tcpdump.rs - integration test that shells out to the harness when prerequisites are present and treats a missing toolchain as a non-fatal skip. Known limitations documented in the test header: per-session random seeds make a full byte match aspirational, so a divergence is a triage signal, not a proof of bug. Retained pcaps under the scratch dir support root-cause analysis.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a daemon-vs-daemon byte equivalence probe that captures upstream rsync 3.4.1 and oc-rsync running the same push scenario via tcpdump, strips IP/TCP framing with tshark, normalizes ephemeral ports, and compares the resulting application payload hashes. * scripts/wire-equivalence-tcpdump.sh - self-contained harness that spins up both daemons on loopback inside a per-invocation scratch directory (never touches the workspace), runs an identical small-tree scenario through each, and exits 0 on match, 1 on divergence, 77 on skip (missing CAP_NET_RAW, no upstream binary, non-Linux host). * tools/ci/run_wire_equivalence.sh - CI wrapper that probes the host for tcpdump/tshark and the two rsync binaries, skipping gracefully on platforms that cannot capture loopback traffic. * crates/protocol/tests/wire_equivalence_tcpdump.rs - integration test that shells out to the harness when prerequisites are present and treats a missing toolchain as a non-fatal skip. Known limitations documented in the test header: per-session random seeds make a full byte match aspirational, so a divergence is a triage signal, not a proof of bug. Retained pcaps under the scratch dir support root-cause analysis.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a daemon-vs-daemon byte equivalence probe that captures upstream rsync 3.4.1 and oc-rsync running the same push scenario via tcpdump, strips IP/TCP framing with tshark, normalizes ephemeral ports, and compares the resulting application payload hashes. * scripts/wire-equivalence-tcpdump.sh - self-contained harness that spins up both daemons on loopback inside a per-invocation scratch directory (never touches the workspace), runs an identical small-tree scenario through each, and exits 0 on match, 1 on divergence, 77 on skip (missing CAP_NET_RAW, no upstream binary, non-Linux host). * tools/ci/run_wire_equivalence.sh - CI wrapper that probes the host for tcpdump/tshark and the two rsync binaries, skipping gracefully on platforms that cannot capture loopback traffic. * crates/protocol/tests/wire_equivalence_tcpdump.rs - integration test that shells out to the harness when prerequisites are present and treats a missing toolchain as a non-fatal skip. Known limitations documented in the test header: per-session random seeds make a full byte match aspirational, so a divergence is a triage signal, not a proof of bug. Retained pcaps under the scratch dir support root-cause analysis.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Add a daemon-vs-daemon byte equivalence probe that captures upstream rsync 3.4.1 and oc-rsync running the same push scenario via tcpdump, strips IP/TCP framing with tshark, normalizes ephemeral ports, and compares the resulting application payload hashes. * scripts/wire-equivalence-tcpdump.sh - self-contained harness that spins up both daemons on loopback inside a per-invocation scratch directory (never touches the workspace), runs an identical small-tree scenario through each, and exits 0 on match, 1 on divergence, 77 on skip (missing CAP_NET_RAW, no upstream binary, non-Linux host). * tools/ci/run_wire_equivalence.sh - CI wrapper that probes the host for tcpdump/tshark and the two rsync binaries, skipping gracefully on platforms that cannot capture loopback traffic. * crates/protocol/tests/wire_equivalence_tcpdump.rs - integration test that shells out to the harness when prerequisites are present and treats a missing toolchain as a non-fatal skip. Known limitations documented in the test header: per-session random seeds make a full byte match aspirational, so a divergence is a triage signal, not a proof of bug. Retained pcaps under the scratch dir support root-cause analysis.
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
scripts/wire-equivalence-tcpdump.sh, a CI wrapper attools/ci/run_wire_equivalence.sh, and a Rust integration test atcrates/protocol/tests/wire_equivalence_tcpdump.rsthat all skip gracefully when prerequisites (Linux, tcpdump, tshark, both binaries) are absent.${TMPDIR:-/tmp}/oc-rsync-wire-equiv.$$and the cleanup trap refuses torm -rfanything outside that scope, so the harness is safe to run inside thersync-profilecontainer with its host bind mount.What the harness asserts
${WIRE_EQUIV_PORT_BASE}(default 28730), oc-rsync on${WIRE_EQUIV_PORT_BASE}+1.tshark -T fieldsreassembles per-stream payload, ephemeral source ports are normalized toS/C, and SHA-256 over the projection is compared.Known limitations
CAP_NET_RAW(root in most containers). The CI wrapper and Rust test skip rather than fail when this is missing.Test plan
rsync-profilecontainer (or any Linux box with tcpdump+tshark+rsync), run:sh scripts/wire-equivalence-tcpdump.shand confirm exit 0 with hashes printed.sh tools/ci/run_wire_equivalence.shprints "skipped" and exits 0.cargo nextest run -p protocol -E 'test(wire_equivalence_tcpdump_harness)'reports a skip on hosts without the prerequisites and passes on hosts with them.