Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions testsuite/batch-only-remove-source-regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
destination_link_a.write_bytes(destination_bytes)
destination_link_b.write_bytes(destination_bytes)

# The batch option limits the name to 256 bytes, including directory names.
# Run in base and pass only the leaf name so long build paths work too.
batch = base / 'transfer.batch'
write = subprocess.run(
rsync_argv('-aH', f'--only-write-batch={batch}',
rsync_argv('-aH', f'--only-write-batch={batch.name}',
'--remove-source-files', f'{source}/', f'{destination}/'),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, cwd=base)
if write.returncode != 0:
test_fail(f'batch-only transfer exited {write.returncode}:\n{write.stdout}')
if destination_file.read_bytes() != destination_bytes:
Expand All @@ -56,8 +58,8 @@
test_fail('batch-only transfer broke the retained source hard link')

replay = subprocess.run(
rsync_argv('-aH', f'--read-batch={batch}', f'{destination}/'),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
rsync_argv('-aH', f'--read-batch={batch.name}', f'{destination}/'),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, cwd=base)
if replay.returncode != 0:
test_fail(f'batch replay exited {replay.returncode}:\n{replay.stdout}')
if destination_file.read_bytes() != source_bytes:
Expand Down