test: Edge-Case-Dateien + Tests (leer/gross/verschluesselt/Sonderzeichen)

/testdata/edge/: empty.txt, leer.bin (0 Byte), Name mit Umlauten+Leerzeichen+
Klammern, Unicode/Emoji/RTL-Inhalt, Datei ohne Endung, passwortgeschuetztes
PDF (pikepdf) + ZIP, riesig.dat (26 MB > MAX_BIN_SIZE). TestFileEdgeCases prueft
graceful Handling (kein Crash, 'Datei zu gross', PDF-Lesefehler sauber gemeldet).
gen_edge.py + upload_ocis.sh erweitert. 76 Tests gruen.
This commit is contained in:
Stefan Lohmaier
2026-06-19 08:05:25 +02:00
parent 1b50e1ef6e
commit 85f5e26384
4 changed files with 84 additions and 0 deletions
+10
View File
@@ -9,3 +9,13 @@ curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/" || true
for d in images audio video documents text archives; do curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/$d/" || true; done
for f in /tmp/mcptest-files/*; do n=$(basename "$f"); curl -s -o /dev/null -u "$AUTH" -T "$f" "$BASE/testdata/$(sub "$n")/$n"; done
echo "Upload fertig."
# Edge-Cases (/tmp/mcptest-files-edge -> /testdata/edge/, URL-encoded)
if [ -d /tmp/mcptest-files-edge ]; then
curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/edge/" || true
python3 - "$OCIS_PW" <<'PYEOF'
import os,sys,subprocess,urllib.parse
pw=sys.argv[1]; B="http://127.0.0.1:9200/remote.php/dav/files/mcptest/testdata/edge"
for f in sorted(os.listdir("/tmp/mcptest-files-edge")):
subprocess.run(["curl","-s","-o","/dev/null","-u",f"mcptest:{pw}","-T",f"/tmp/mcptest-files-edge/{f}",f"{B}/{urllib.parse.quote(f)}"])
PYEOF
fi