Skip to content

test(uts): port hardlinks.test INC_RECURSE scenario to nextest - #5950

Merged
oferchen merged 2 commits into
masterfrom
test/uts-nextest-hardlinks-inc-recurse
Jun 19, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/uts-nextest-hardlinks-inc-recurse

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Adds a workspace integration test that pins the upstream
testsuite/hardlinks.test scenario end-to-end under INC_RECURSE.
Closes UTS-NEXTEST-EDGE.j by lifting the upstream script into a native
nextest test so per-test regressions are caught as required PR checks
rather than slipping through the runtests.py continue-on-error: true
CI plumbing.

The new test (crates/transfer/tests/uts_nextest_hardlinks_inc_recurse.rs)
covers three escalating shapes from upstream target/interop/upstream-src/rsync-3.4.4/testsuite/hardlinks.test:

  • Flat hardlink pair - name1/name2/name3 share an inode while
    name4 (an independent cp) stays distinct. Asserts inode equality,
    nlink >= 3 on the shared trio, and nlink == 1 on the independent
    copy after a -aH --inc-recursive round-trip.
  • Hardlink spanning a deep subdirectory under INC_RECURSE -
    top-level name1 and subdir/down/deep/new-file share an inode at
    the destination across generator/sender segment boundaries, with
    enough touch-files in subdir/ to put the deep path in a separate
    generator segment.
  • --link-dest re-run inherits hardlinks from the basis - second
    transfer must hardlink each entry into chkdir/ instead of
    allocating fresh inodes; the source's name1/name2 relationship is
    preserved transitively through the link-dest basis, and basis
    nlink grows to reflect the new link-dest references.

Mirrors the sibling UTS-NEXTEST-EDGE ports (.f daemon-munge, .h
delete-missing-args, .i chdir-symlink-race, .k atimes/crtimes,
.l daemon-refuse, .m link-dest-module-escape, .n
compress-zlib-insert): inline locate_oc_rsync() helper, skip
gracefully when the binary is absent, cfg(unix) gate (Windows
MetadataExt::ino() is unavailable to std, and NTFS hardlink
semantics diverge).

Upstream references

  • testsuite/hardlinks.test (canonical 3.4.4 copy)
  • hlink.c::match_hard_links() - leader/follower assignment after the
    file list sort that INC_RECURSE relies on
  • flist.c XMIT_HLINK_FIRST flag wire encoding
  • generator.c / receiver.c hard_link_one() / hard_link_cluster()

Test plan

  • cargo fmt --all -- --check clean on the new file
  • CI fmt+clippy + nextest matrices pass (Linux + macOS gnu/musl,
    Windows excluded by #![cfg(unix)])
  • Test binary discovery falls back to walking target/ when
    CARGO_BIN_EXE_oc-rsync is not injected (matches sibling tests)

oferchen added 2 commits June 19, 2026 06:42
Adds a workspace integration test that pins the upstream
testsuite/hardlinks.test scenario end-to-end under INC_RECURSE. Covers
three escalating shapes lifted from the upstream script:

- Flat hardlink pair (name1/name2/name3 share an inode, name4 is an
  independent copy) survives -aH --inc-recursive round-trip with
  inode + nlink invariants.
- Hardlink spanning a deep subdirectory under INC_RECURSE: top-level
  name1 + subdir/down/deep/new-file share an inode at the destination
  across generator/sender segment boundaries.
- --link-dest re-run hardlinks every locally-inherited entry to the
  basis tree, preserving the source's name1/name2 relationship
  transitively through the link-dest inode.

Runtests.py runs hardlinks.test through continue-on-error CI plumbing,
so per-test regressions on that path do not block PRs. Lifting the
scenario into a native nextest integration test mirrors the
UTS-NEXTEST-EDGE pattern (.f daemon-munge, .h delete-missing-args, .i
chdir-symlink-race, .k atimes/crtimes, .l daemon-refuse, .m
link-dest-module-escape, .n compress-zlib-insert) so it runs as a
required check on every PR.

Upstream references:
- testsuite/hardlinks.test (canonical 3.4.4 copy)
- hlink.c::match_hard_links() - leader/follower assignment under INC_RECURSE
- flist.c XMIT_HLINK_FIRST encoding
- generator.c / receiver.c hard_link_one() / hard_link_cluster()

Test gated on cfg(unix) - Windows hardlink semantics through
MetadataExt::ino() differ; sibling UTS-NEXTEST-EDGE tests use the same
gate.
@oferchen
oferchen force-pushed the test/uts-nextest-hardlinks-inc-recurse branch from 5aa69fd to cdec5b5 Compare June 19, 2026 03:42
@oferchen
oferchen merged commit fd4da6f into master Jun 19, 2026
5 of 6 checks passed
@oferchen
oferchen deleted the test/uts-nextest-hardlinks-inc-recurse branch June 19, 2026 05:06
oferchen added a commit that referenced this pull request Aug 24, 2026
* test: port hardlinks.test INC_RECURSE scenario to nextest

Adds a workspace integration test that pins the upstream
testsuite/hardlinks.test scenario end-to-end under INC_RECURSE. Covers
three escalating shapes lifted from the upstream script:

- Flat hardlink pair (name1/name2/name3 share an inode, name4 is an
  independent copy) survives -aH --inc-recursive round-trip with
  inode + nlink invariants.
- Hardlink spanning a deep subdirectory under INC_RECURSE: top-level
  name1 + subdir/down/deep/new-file share an inode at the destination
  across generator/sender segment boundaries.
- --link-dest re-run hardlinks every locally-inherited entry to the
  basis tree, preserving the source's name1/name2 relationship
  transitively through the link-dest inode.

Runtests.py runs hardlinks.test through continue-on-error CI plumbing,
so per-test regressions on that path do not block PRs. Lifting the
scenario into a native nextest integration test mirrors the
UTS-NEXTEST-EDGE pattern (.f daemon-munge, .h delete-missing-args, .i
chdir-symlink-race, .k atimes/crtimes, .l daemon-refuse, .m
link-dest-module-escape, .n compress-zlib-insert) so it runs as a
required check on every PR.

Upstream references:
- testsuite/hardlinks.test (canonical 3.4.4 copy)
- hlink.c::match_hard_links() - leader/follower assignment under INC_RECURSE
- flist.c XMIT_HLINK_FIRST encoding
- generator.c / receiver.c hard_link_one() / hard_link_cluster()

Test gated on cfg(unix) - Windows hardlink semantics through
MetadataExt::ino() differ; sibling UTS-NEXTEST-EDGE tests use the same
gate.

* style: alphabetise tempfile use group for rustfmt
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