From: Andrew Tridgell Date: Sat, 23 May 2026 22:48:42 +0000 (+1000) Subject: testsuite: assert absolute --partial-dir delta resume now works X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=340238421dda10ca21477b129e424c3aa0c4abcd;p=thirdparty%2Frsync.git testsuite: assert absolute --partial-dir delta resume now works partial_test.py sub-test 5 deterministically asserts a delta (--no-whole-file) resume from an absolute, outside-tree --partial-dir reproduces the source and consumes the basis -- the regression guard for the receiver fix. Sub-test 4 keeps asserting the cross-directory partial WRITE on interrupt. Drop the --whole-file workaround and the 'broken on master' notes in the docstring and COVERAGE.md. Co-Authored-By: Claude Opus 4.7 (1M context) --- diff --git a/testsuite/COVERAGE.md b/testsuite/COVERAGE.md index 44094b63..6f6e37cf 100644 --- a/testsuite/COVERAGE.md +++ b/testsuite/COVERAGE.md @@ -77,7 +77,7 @@ Status legend: ✓ property asserted · `~` shallow / by an existing ported test |---|---|---|---|---| | -T, --temp-dir | temp-dir*new*, chmod-temp-dir | Y | Y | ✓ cross-dir rename | | --partial | partial*new* | Y | — | ✓ partial kept in dest file | -| --partial-dir | partial*new*, symlink-dirlink-basis | Y | Y | ✓ relative (in-tree) + absolute (outside). Absolute **delta** resume is broken on master — asserts only the cross-dir write | +| --partial-dir | partial*new*, symlink-dirlink-basis | Y | Y | ✓ relative (in-tree) + absolute (outside), incl. delta resume from an absolute outside-tree partial | | --delay-updates | delay-updates, delay-updates-deep*new* | Y | — | ✓ per-dir staging | | --inplace | inplace*new*, alt-dest | Y | — | ✓ inode preserved | | --append / --append-verify | append*new* | Y | — | ✓ verify split is proto 30+ | @@ -202,5 +202,3 @@ Status legend: ✓ property asserted · `~` shallow / by an existing ported test = yes`, daemon uid/gid) skip as non-root; run the suite as root to cover. * `--ignore-errors`, `-x/--one-file-system`, `--numeric-ids` have no dedicated test yet (lower restructure risk). -* Absolute `--partial-dir` + delta resume is broken on master; the test asserts - only the cross-directory write there and completes with `--whole-file`. diff --git a/testsuite/partial_test.py b/testsuite/partial_test.py index 97b6f69a..1c8e9531 100644 --- a/testsuite/partial_test.py +++ b/testsuite/partial_test.py @@ -9,11 +9,6 @@ directory; an ABSOLUTE dir is a reserved location that holds partials by basename. All of this is parent- and cross-directory path resolution -- what the resolver restructure rewrites -- so exercise it on a file several levels deep, with the absolute partial-dir kept OUTSIDE the destination tree. - -Note: a *delta* resume from an absolute partial-dir currently fails whole-file -verification on master (it re-puts the partial and never converges). This test -therefore only asserts the cross-directory WRITE of the partial for that case -and completes it with --whole-file, which is the clearly-correct baseline. """ import os @@ -115,7 +110,7 @@ run_rsync('-a', '--partial-dir=.rsync-partial', '--no-whole-file', f'{src}/', f'{TODIR}/') assert_same(TODIR / deep, src / deep, label='rel partial-dir resume') -# --- 4. absolute --partial-dir OUTSIDE the tree (cross-dir): interrupt ----- +# --- 4. absolute --partial-dir OUTSIDE the tree (cross-dir): interrupt write - ext = SCRATCHDIR / 'partials' # sibling of from/ and to/ -- outside both rmtree(ext) ext.mkdir() @@ -124,7 +119,21 @@ interrupt_transfer([f'--partial-dir={ext}'], ext / 'f3') if not (ext / 'f3').is_file() or not is_prefix(ext / 'f3'): test_fail("absolute --partial-dir did not write the partial to the " "outside-tree dir") -run_rsync('-a', f'--partial-dir={ext}', '--whole-file', f'{src}/', f'{TODIR}/') -assert_same(TODIR / deep, src / deep, label='abs partial-dir resume') + +# --- 5. absolute --partial-dir delta resume completes (regression guard) ---- +# A delta (--no-whole-file) resume from an absolute, outside-tree partial-dir +# used to fail whole-file verification forever: the receiver couldn't open the +# absolute basis, so matched blocks were dropped from the verify checksum. +rmtree(src) +rmtree(TODIR) +rmtree(ext) +makepath(src / deepdir, ext) +make_data_file(src / deep, 1_000_000) +(ext / 'f3').write_bytes((src / deep).read_bytes()[:400_000]) # clean prefix +run_rsync('-a', f'--partial-dir={ext}', '--no-whole-file', f'{src}/', f'{TODIR}/') +assert_same(TODIR / deep, src / deep, label='abs partial-dir delta resume') +if (ext / 'f3').exists(): + test_fail("absolute --partial-dir basis was not consumed after a " + "successful delta resume") print("partial: --partial + relative/absolute --partial-dir verified at depth")