test: umfangreiche Testdaten (alle Dateitypen + Mail-Anhaenge)
- oCIS /testdata/: Bilder (jpg/png/webp/bmp/gif/tiff/svg), Audio (mp3/ogg/m4a/ flac/wav), Video (mp4), PDFs (Text + Scan), Office (docx/xlsx/pptx), Text/Daten (md/txt/csv/json/xml/yaml/html/py/vcf/ics), Archive (zip/tar.gz). - Maildir: Mails mit diversen Anhaengen (PDF/Bild/Word/Excel/MP3/MP4/PPTX/ZIP). - TestFileTypes: read_file je Typ -> Content-Typ pruefen (image/text/resource). - Generatoren tests/testdata/gen_testfiles.py + gen_maildir.py + upload_ocis.sh. 68 Tests gruen (vorher 54). Doku in MCPTEST.md.
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Laedt die generierten Testdateien (/tmp/mcptest-files, via gen_testfiles.py)
|
||||
# in mcptests oCIS unter /testdata/<typ>/ hoch.
|
||||
set -euo pipefail
|
||||
OCIS_PW=$(sudo sed -n 's/OCIS_PW=//p' /root/.mcptest-creds)
|
||||
BASE="http://127.0.0.1:9200/remote.php/dav/files/mcptest"; AUTH="mcptest:$OCIS_PW"
|
||||
sub(){ case "$1" in *.jpg|*.png|*.webp|*.bmp|*.gif|*.tiff|*.svg) echo images;; *.mp3|*.ogg|*.m4a|*.flac|*.wav) echo audio;; *.mp4) echo video;; *.pdf|*.docx|*.xlsx|*.pptx) echo documents;; *.zip|*.gz) echo archives;; *) echo text;; esac; }
|
||||
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."
|
||||
Reference in New Issue
Block a user