diff --git a/testsuite/batch-only-remove-source-regression_test.py b/testsuite/batch-only-remove-source-regression_test.py index f5868adb3..8fe2c8625 100644 --- a/testsuite/batch-only-remove-source-regression_test.py +++ b/testsuite/batch-only-remove-source-regression_test.py @@ -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: @@ -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: