mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-02-06 20:48:32 +00:00
parent
f26a0aa71d
commit
3af17c3019
@ -670,7 +670,13 @@ function test_open_second_fd {
|
||||
|
||||
function test_write_multiple_offsets {
|
||||
describe "test writing to multiple offsets"
|
||||
../../write_multiple_offsets.py ${TEST_TEXT_FILE}
|
||||
../../write_multiple_offsets.py ${TEST_TEXT_FILE} 1024 1 $((16 * 1024 * 1024)) 1 $((18 * 1024 * 1024)) 1
|
||||
rm_test_file ${TEST_TEXT_FILE}
|
||||
}
|
||||
|
||||
function test_write_multiple_offsets_backwards {
|
||||
describe "test writing to multiple offsets"
|
||||
../../write_multiple_offsets.py ${TEST_TEXT_FILE} $((20 * 1024 * 1024 + 1)) 1 $((10 * 1024 * 1024)) 1
|
||||
rm_test_file ${TEST_TEXT_FILE}
|
||||
}
|
||||
|
||||
@ -780,6 +786,7 @@ function add_all_tests {
|
||||
add_tests test_concurrent_writes
|
||||
add_tests test_open_second_fd
|
||||
add_tests test_write_multiple_offsets
|
||||
add_tests test_write_multiple_offsets_backwards
|
||||
add_tests test_content_type
|
||||
add_tests test_truncate_cache
|
||||
}
|
||||
|
@ -3,16 +3,15 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 4 or len(sys.argv) % 2 != 0:
|
||||
sys.exit("Usage: %s OUTFILE OFFSET_1 SIZE_1 [OFFSET_N SIZE_N]...")
|
||||
|
||||
filename = sys.argv[1]
|
||||
data = bytes('a', 'utf-8')
|
||||
|
||||
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
|
||||
try:
|
||||
os.pwrite(fd, data, 1024)
|
||||
os.pwrite(fd, data, 16 * 1024 * 1024)
|
||||
os.pwrite(fd, data, 18 * 1024 * 1024)
|
||||
for i in range(2, len(sys.argv), 2):
|
||||
data = bytes("a" * int(sys.argv[i+1]), 'utf-8')
|
||||
os.pwrite(fd, data, int(sys.argv[i]))
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
stat = os.lstat(filename)
|
||||
assert stat.st_size == 18 * 1024 * 1024 + 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user