#289 checksum/compression: - -c/--checksum now implies the incremental content quick-check (without implying -t), so an unchanged file is skipped like rsync. - --checksum-choice/--cc accepts xxh64/xxhash, xxh3, xxh128, md5 and auto; md4/sha1/none and the two-name form are rejected by name. - --compress-choice/--zc rejects lz4/zlib/zlibx by name (zstd/none/auto kept). - --checksum-seed=0 is randomized per transfer and sent on the wire. - --skip-compress uses rsync 3.4.1's default suffix list; slash separators and dot-less suffixes are accepted. - add --no-whole-file. #295 timeouts/alloc/temp-dir: - --timeout default 0 (disabled), --contimeout default 60; 0 disables both, plus --no-timeout/--no-contimeout. - --max-alloc=0 means no allocation limit (was rejected). - --temp-dir accepts any dir, requires it to exist, and falls back to a non-atomic copy on EXDEV instead of aborting. #296 connectivity/daemon: - -M/--remote-option is rejected for daemon/TCP destinations (SSH-only). - --trust-sender clarified as receiver-local; server-path tests added. - --stop-at accepts rsync's full date form (y-m-dTh:m etc.). Adds unit and integration coverage; no wire-field change, PROTOCOL_VERSION stays 2.22.0.
This commit is contained in:
@@ -150,13 +150,36 @@ class TestStopAt:
|
||||
assert _received_files(received) == [], \
|
||||
f"expected nothing transferred, got {_received_files(received)}"
|
||||
|
||||
@pytest.mark.ci
|
||||
def test_stop_at_rsync_date_form(self, shared_server):
|
||||
"""rsync's full date form (Y-M-DTh:m) is accepted; a deadline well in the
|
||||
future lets the transfer complete normally."""
|
||||
source, dest = _make("dateform")
|
||||
_seed_source(source)
|
||||
stamp = time.strftime("%Y-%m-%dT%H:%M", time.localtime(time.time() + 3600))
|
||||
result, _ = run_client(source, dest, flags=[f"--stop-at={stamp}"],
|
||||
port=shared_server.port)
|
||||
assert result.returncode == 0, \
|
||||
f"--stop-at={stamp} should be accepted: " \
|
||||
f"{(result.stderr or result.stdout)[:400]}"
|
||||
received = get_dest_received_dir(dest, source)
|
||||
mismatches, missing = verify_transfer(source, received)
|
||||
assert not mismatches and not missing
|
||||
|
||||
# The slash-separated date spelling is accepted too.
|
||||
slash = time.strftime("%Y/%m/%dT%H:%M", time.localtime(time.time() + 3600))
|
||||
result, _ = run_client(source, dest, flags=[f"--stop-at={slash}"],
|
||||
port=shared_server.port)
|
||||
assert result.returncode == 0, f"--stop-at={slash} should be accepted"
|
||||
|
||||
@pytest.mark.ci
|
||||
def test_stop_rejects_garbage(self, shared_server):
|
||||
"""Malformed --stop-at/--stop-after values are rejected up front."""
|
||||
source, dest = _make("garbage")
|
||||
_seed_source(source)
|
||||
for flag in ("--stop-after=abc", "--stop-at=12:99", "--stop-at=12",
|
||||
"--stop-at=now+5x", "--stop-at=now-5s"):
|
||||
for flag in ("--stop-after=abc", "--stop-at=12:99", "--stop-at=1234",
|
||||
"--stop-at=now+5x", "--stop-at=now-5s",
|
||||
"--stop-at=2000-13-45", "--stop-at=2030-12-31T23:59:59"):
|
||||
result, _ = run_client(source, dest, flags=[flag],
|
||||
port=shared_server.port)
|
||||
assert result.returncode != 0, f"{flag} should be rejected"
|
||||
|
||||
Reference in New Issue
Block a user