mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-21 06:16:25 +00:00
- Make the test runner fail on failed tests and report explicit skips - Strengthen assertions for O_DIRECT, LUP policy, EXDEV fallback, and xattrs - Fix cleanup and file descriptor handling across test scripts
35 lines
732 B
Python
Executable File
35 lines
732 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
import tempfile
|
|
|
|
|
|
def main():
|
|
(fd, filepath) = tempfile.mkstemp(dir=sys.argv[1])
|
|
|
|
os.posix_fallocate(fd, 0, 1024)
|
|
|
|
st1 = os.fstat(fd)
|
|
if st1.st_size < 1024:
|
|
os.close(fd)
|
|
os.unlink(filepath)
|
|
print("fallocate before unlink: expected size >= 1024, got {}".format(st1.st_size), end='')
|
|
return 1
|
|
|
|
os.unlink(filepath)
|
|
|
|
os.posix_fallocate(fd, 1024, 2048)
|
|
|
|
st2 = os.fstat(fd)
|
|
if st2.st_size < 1024 + 2048:
|
|
os.close(fd)
|
|
print("fallocate after unlink: expected size >= 3072, got {}".format(st2.st_size), end='')
|
|
return 1
|
|
|
|
os.close(fd)
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main()) |