mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48:55 +00:00
parent
1db94a0b30
commit
80162c126b
@ -650,6 +650,12 @@ function test_open_second_fd {
|
||||
rm_test_file second_fd_file
|
||||
}
|
||||
|
||||
function test_write_multiple_offsets {
|
||||
describe "test writing to multiple offsets"
|
||||
../../write_multiple_offsets.py ${TEST_TEXT_FILE}
|
||||
rm_test_file
|
||||
}
|
||||
|
||||
function add_all_tests {
|
||||
add_tests test_append_file
|
||||
add_tests test_truncate_file
|
||||
@ -681,6 +687,7 @@ function add_all_tests {
|
||||
add_tests test_concurrency
|
||||
add_tests test_concurrent_writes
|
||||
add_tests test_open_second_fd
|
||||
add_tests test_write_multiple_offsets
|
||||
}
|
||||
|
||||
init_suite
|
||||
|
18
test/write_multiple_offsets.py
Executable file
18
test/write_multiple_offsets.py
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
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)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
stat = os.lstat(filename)
|
||||
assert stat.st_size == 18 * 1024 * 1024 + 1
|
Loading…
Reference in New Issue
Block a user