Skip to content

test(interop): live transfer fuzzer with seedable RNG (#1196) - #4185

Merged
oferchen merged 1 commit into
masterfrom
test/live-interop-fuzz-1196
May 16, 2026
Merged

oferchen merged 1 commit into
masterfrom
test/live-interop-fuzz-1196

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/live_interop_fuzz_1196.rs, a randomised integration test that drives oc-rsync and an upstream rsync 3.4.x binary against the same generated tree and verifies both produce a byte-identical copy of the source.
  • Each iteration generates a tree (files, dirs, mtimes, perms, sparse holes, optional symlinks on Unix), runs oc-rsync src/ dst_a/ and rsync src/ dst_b/, then compares src, dst_a, and dst_b snapshots via SHA-256 file-content hashes plus symlink-target equality. About one iteration in three mutates src (add / delete / extend files) and re-runs the transfer under --delete to assert reconciliation.
  • Exposes two tiers, both #[ignore] so they only run with --run-ignored=all:
    • live_interop_fuzz_smoke: 60 s default budget, capped at 120 s, small trees only -- suitable for nightly CI.
    • live_interop_fuzz_extended: budget governed by OC_RSYNC_FUZZ_BUDGET_SECS (set to 3600 for an hour-long extended run), cycles through small / medium / large tree shapes.
  • All randomness flows through a seedable xorshift64* PRNG (no new external crate). Failures print the seed and the env-var command to replay them; pin via OC_RSYNC_FUZZ_SEED=<u64>.
  • Skips cleanly when no upstream binary is available (env OC_RSYNC_FUZZ_UPSTREAM_BIN, target/interop/upstream-install/3.4.{1,2}/bin/rsync, then PATH).

Test plan

  • cargo check --tests succeeds on macOS.
  • cargo clippy --tests --all-features --no-deps is clean for the new file.
  • CI: fmt + clippy, nextest (stable), Windows, macOS, Linux musl.
  • Opt-in smoke run on a machine with upstream rsync installed:
    cargo nextest run --workspace -E 'test(live_interop_fuzz)' --run-ignored=all
  • Extended replay of a seed once we hit a divergence:
    OC_RSYNC_FUZZ_SEED=<seed> OC_RSYNC_FUZZ_BUDGET_SECS=600 cargo nextest run --workspace -E 'test(live_interop_fuzz)' --run-ignored=all

Notes

  • Test module is #![cfg(unix)] so it does not affect Windows builds; this matches the pattern other interop tests use because upstream rsync is Unix-only.
  • Uses only existing dev-dependencies (checksums::strong::Sha256, filetime, tempfile via the shared integration::helpers). No new external crates added.

@oferchen
oferchen force-pushed the test/live-interop-fuzz-1196 branch from 07ea461 to eb46e7d Compare May 16, 2026 20:44
@github-actions github-actions Bot added the test label May 16, 2026
@oferchen
oferchen force-pushed the test/live-interop-fuzz-1196 branch 3 times, most recently from 823a6de to 7d0b0ee Compare May 16, 2026 22:38
Add tests/live_interop_fuzz_1196.rs: a randomised, seedable integration
test that drives local transfers through both oc-rsync and an upstream
rsync 3.4.x binary, then compares the resulting trees via SHA-256
file-content hashes plus symlink-target equality.

Each iteration generates a random tree (files, dirs, mtimes, perms,
sparse holes, optional symlinks), runs oc-rsync src->dst_a, runs
upstream src->dst_b, and asserts both destinations match the source and
each other. About one iteration in three then mutates the source and
re-runs to verify reconciliation under --delete.

Two tiers are exposed, both #[ignore] so they only run via
--run-ignored=all:

- live_interop_fuzz_smoke: budget capped at 120 s, small trees only.
- live_interop_fuzz_extended: budget governed by
  OC_RSYNC_FUZZ_BUDGET_SECS (default 60, recommended 3600 for nightly).

Reproducibility is via a seedable xorshift64* PRNG; failures print the
seed and the env-var command to replay them. The harness skips cleanly
when no upstream rsync is available (env OC_RSYNC_FUZZ_UPSTREAM_BIN,
target/interop/upstream-install/3.4.x/bin/rsync, or PATH).

This complements the static adversarial corpus work by exercising
dynamic edge cases the fixed corpus cannot cover.
@oferchen
oferchen force-pushed the test/live-interop-fuzz-1196 branch from 7d0b0ee to b82946c Compare May 16, 2026 23:19
@oferchen
oferchen merged commit 4d1ef49 into master May 16, 2026
11 checks passed
@oferchen
oferchen deleted the test/live-interop-fuzz-1196 branch May 16, 2026 23:19
oferchen added a commit that referenced this pull request May 18, 2026
Add tests/live_interop_fuzz_1196.rs: a randomised, seedable integration
test that drives local transfers through both oc-rsync and an upstream
rsync 3.4.x binary, then compares the resulting trees via SHA-256
file-content hashes plus symlink-target equality.

Each iteration generates a random tree (files, dirs, mtimes, perms,
sparse holes, optional symlinks), runs oc-rsync src->dst_a, runs
upstream src->dst_b, and asserts both destinations match the source and
each other. About one iteration in three then mutates the source and
re-runs to verify reconciliation under --delete.

Two tiers are exposed, both #[ignore] so they only run via
--run-ignored=all:

- live_interop_fuzz_smoke: budget capped at 120 s, small trees only.
- live_interop_fuzz_extended: budget governed by
  OC_RSYNC_FUZZ_BUDGET_SECS (default 60, recommended 3600 for nightly).

Reproducibility is via a seedable xorshift64* PRNG; failures print the
seed and the env-var command to replay them. The harness skips cleanly
when no upstream rsync is available (env OC_RSYNC_FUZZ_UPSTREAM_BIN,
target/interop/upstream-install/3.4.x/bin/rsync, or PATH).

This complements the static adversarial corpus work by exercising
dynamic edge cases the fixed corpus cannot cover.
oferchen added a commit that referenced this pull request May 18, 2026
Add tests/live_interop_fuzz_1196.rs: a randomised, seedable integration
test that drives local transfers through both oc-rsync and an upstream
rsync 3.4.x binary, then compares the resulting trees via SHA-256
file-content hashes plus symlink-target equality.

Each iteration generates a random tree (files, dirs, mtimes, perms,
sparse holes, optional symlinks), runs oc-rsync src->dst_a, runs
upstream src->dst_b, and asserts both destinations match the source and
each other. About one iteration in three then mutates the source and
re-runs to verify reconciliation under --delete.

Two tiers are exposed, both #[ignore] so they only run via
--run-ignored=all:

- live_interop_fuzz_smoke: budget capped at 120 s, small trees only.
- live_interop_fuzz_extended: budget governed by
  OC_RSYNC_FUZZ_BUDGET_SECS (default 60, recommended 3600 for nightly).

Reproducibility is via a seedable xorshift64* PRNG; failures print the
seed and the env-var command to replay them. The harness skips cleanly
when no upstream rsync is available (env OC_RSYNC_FUZZ_UPSTREAM_BIN,
target/interop/upstream-install/3.4.x/bin/rsync, or PATH).

This complements the static adversarial corpus work by exercising
dynamic edge cases the fixed corpus cannot cover.
oferchen added a commit that referenced this pull request Aug 24, 2026
Add tests/live_interop_fuzz_1196.rs: a randomised, seedable integration
test that drives local transfers through both oc-rsync and an upstream
rsync 3.4.x binary, then compares the resulting trees via SHA-256
file-content hashes plus symlink-target equality.

Each iteration generates a random tree (files, dirs, mtimes, perms,
sparse holes, optional symlinks), runs oc-rsync src->dst_a, runs
upstream src->dst_b, and asserts both destinations match the source and
each other. About one iteration in three then mutates the source and
re-runs to verify reconciliation under --delete.

Two tiers are exposed, both #[ignore] so they only run via
--run-ignored=all:

- live_interop_fuzz_smoke: budget capped at 120 s, small trees only.
- live_interop_fuzz_extended: budget governed by
  OC_RSYNC_FUZZ_BUDGET_SECS (default 60, recommended 3600 for nightly).

Reproducibility is via a seedable xorshift64* PRNG; failures print the
seed and the env-var command to replay them. The harness skips cleanly
when no upstream rsync is available (env OC_RSYNC_FUZZ_UPSTREAM_BIN,
target/interop/upstream-install/3.4.x/bin/rsync, or PATH).

This complements the static adversarial corpus work by exercising
dynamic edge cases the fixed corpus cannot cover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant