Files
Antonio SJ Musumeci 943f91ff98 Strengthen mergerfs integration tests
- 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
2026-04-29 20:25:20 -04:00

47 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
import os
import sys
import subprocess
SKIP = 77
if len(sys.argv) != 2:
print('usage: run-tests <mountpoint>\n', file=sys.stderr)
sys.exit(1)
test_path = os.path.realpath(sys.argv[0])
test_path = os.path.dirname(test_path)
failed = False
for entry in os.scandir(test_path):
if not entry.name.startswith('TEST_'):
continue
try:
print(entry.name + ': ', end='')
fullpath = os.path.join(test_path, entry.name)
args = [fullpath, sys.argv[1]]
rv = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output, _ = rv.communicate(timeout=120)
if rv.returncode == SKIP:
print('SKIP - {}'.format(output.decode(errors='replace')))
elif rv.returncode:
print('FAIL - {}'.format(output.decode(errors='replace')))
failed = True
else:
print('PASS')
except subprocess.TimeoutExpired:
rv.kill()
rv.wait()
print('FAIL - timeout')
failed = True
except Exception as e:
print('FAIL - {}'.format(e))
failed = True
sys.exit(1 if failed else 0)