You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.6 KiB
1.6 KiB
TUS Protocol Integration Tests
This directory contains integration tests for the TUS (resumable upload) protocol support in SeaweedFS Filer.
TUS Protocol Overview
TUS is an open protocol for resumable file uploads. It allows clients to upload files in chunks and resume uploads after network failures.
Key endpoints:
OPTIONS /tus/- Server capability discoveryPOST /tus/{path}- Create new upload sessionHEAD /tus/{upload-id}- Get current upload offsetPATCH /tus/{upload-id}- Upload data at offsetDELETE /tus/{upload-id}- Cancel upload
Prerequisites
- Build the weed binary:
cd ../../weed
go build
- The tests will automatically start required servers (master, volume, filer).
Running Tests
Run all TUS tests:
go test -v ./test/tus/...
Run specific test:
go test -v ./test/tus -run TestTusBasicUpload
Skip integration tests (short mode):
go test -v -short ./test/tus/...
Test Coverage
The tests cover:
- Basic upload creation and completion
- Chunked/resumable uploads
- Upload offset tracking (HEAD requests)
- Upload cancellation (DELETE requests)
- Error handling (invalid offsets, missing uploads)
- Large file uploads with multiple chunks
- Concurrent uploads
- Metadata handling
TUS Protocol Headers
Required headers for TUS requests:
Tus-Resumable: 1.0.0- Protocol versionUpload-Length- Total file size (on creation)Upload-Offset- Current byte offset (on PATCH)Content-Type: application/offset+octet-stream(on PATCH)
Optional headers:
Upload-Metadata- Base64-encoded key-value pairs