Extend multipart.vtc

parent 68e07d49
......@@ -15,7 +15,7 @@ server s2 {
txresp
expect req.method == PUT
expect req.url == /vtc
expect req.bodylen == 100
expect req.bodylen == 10240
} -start
server s3 {
......@@ -40,8 +40,8 @@ varnish v1 -vcl+backend {
sub vcl_init {
new test = tus.server("https://my.origin");
new tmp = tus.server("http://localhost",
basedir="/tmp/tus", max = 3145B,
multipart = 10B);
basedir="/tmp/tus", max = 314500B,
multipart = 8192B);
}
sub vcl_backend_fetch {
if (bereq.url ~ "^/tus") {
......@@ -128,7 +128,7 @@ client c1 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 100
expect resp.http.Upload-Length == 100
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -147,20 +147,20 @@ client c2 {
# partial Upload with create
txreq -method POST \
-hdr "Upload-Metadata: filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential" \
-hdr "Upload-Length: 100" \
-hdr "Upload-Length: 10240" \
-hdr "Tus-Resumable: 1.0.0" \
-hdr "Content-Type: application/offset+octet-stream" \
-hdr "Id: vtc" \
-bodylen 40
-bodylen 4096
rxresp
expect resp.status == 201
expect resp.http.Tus-Resumable == "1.0.0"
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Upload-Offset == 40
expect resp.http.Upload-Length == 100
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 4096
expect resp.http.Upload-Length == 10240
expect resp.http.Upload-Expires ~ "GMT$"
## XXX only for HEAD?
expect resp.http.Upload-Metadata == "filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential"
......@@ -176,22 +176,37 @@ client c2 {
rxresp
expect resp.status == 400
# HEAD on upload in progress
txreq -method HEAD -url "/vtc" \
-hdr "Tus-Resumable: 1.0.0"
rxresp
expect resp.status == 200
# finish upload
txreq -method PATCH -url "/vtc" \
-hdr "Tus-Resumable: 1.0.0" \
-hdr "Content-Type: application/offset+octet-stream" \
-hdr "Upload-Length: 100" \
-hdr "Upload-Offset: 40" \
-bodylen 60
-hdr "Upload-Length: 10240" \
-hdr "Upload-Offset: 4096" \
-bodylen 4096
rxresp
expect resp.status == 204
txreq -method PATCH -url "/vtc" \
-hdr "Tus-Resumable: 1.0.0" \
-hdr "Content-Type: application/offset+octet-stream" \
-hdr "Upload-Length: 10240" \
-hdr "Upload-Offset: 8192" \
-bodylen 2048
rxresp
expect resp.status == 204
expect resp.http.Tus-Resumable == "1.0.0"
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Upload-Offset == 100
expect resp.http.Upload-Length == 100
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 10240
expect resp.http.Upload-Length == 10240
expect resp.http.Upload-Expires ~ "GMT$"
## XXX only for HEAD?
expect resp.http.Upload-Metadata == "filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,is_confidential"
......@@ -200,6 +215,17 @@ client c2 {
expect resp.http.has-is_confidential == true
expect resp.http.has-filenamee == false
expect resp.http.has-filenam == false
# repeated PATCH after completed
txreq -method PATCH -url "/vtc" \
-hdr "Tus-Resumable: 1.0.0" \
-hdr "Content-Type: application/offset+octet-stream" \
-hdr "Upload-Length: 2048" \
-hdr "Upload-Offset: 8192" \
-bodylen 2048
rxresp
expect resp.status == 409
} -start
# part1
......@@ -227,7 +253,7 @@ client c3 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 40
expect resp.http.Upload-Length == 100
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -243,7 +269,7 @@ client c3 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 40
expect resp.http.Upload-Length == 100
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -261,7 +287,7 @@ client c3 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 100
expect resp.http.Upload-Length == 100
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -290,7 +316,7 @@ client c4 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Defer-Length == 1
expect resp.http.Upload-Length == <undef>
expect resp.http.Upload-Offset == 0
......@@ -306,7 +332,7 @@ client c4 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Defer-Length == 1
expect resp.http.Upload-Length == <undef>
expect resp.http.Upload-Offset == 0
......@@ -326,7 +352,7 @@ client c4 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 100
expect resp.http.Upload-Length == 100
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -355,7 +381,7 @@ client c5 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 200
expect resp.http.Upload-Length == 200
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -370,7 +396,7 @@ client c5 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 200
expect resp.http.Upload-Length == 200
expect resp.http.Upload-Expires ~ "GMT$"
......@@ -403,7 +429,7 @@ client c6 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == <undef>
expect resp.http.Upload-Length == <undef>
expect resp.http.Upload-Expires == <undef>
......@@ -420,7 +446,7 @@ client c6 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == <undef>
expect resp.http.Upload-Length == <undef>
expect resp.http.Upload-Expires == <undef>
......@@ -430,10 +456,10 @@ client c6 {
# exceeding max size
client c7 {
txreq -method POST \
-hdr "Upload-Length: 3146" \
-hdr "Upload-Length: 314501" \
-hdr "Tus-Resumable: 1.0.0" \
-hdr "Content-Type: application/offset+octet-stream" \
-bodylen 3146
-bodylen 314501
rxresp
expect resp.status == 413
expect resp.http.Tus-Resumable == "1.0.0"
......@@ -441,7 +467,7 @@ client c7 {
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
## XXX correct?
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == <undef>
expect resp.http.Upload-Length == <undef>
expect resp.http.Upload-Expires == <undef>
......@@ -480,7 +506,7 @@ client c9 {
expect resp.http.Tus-Version == "1.0.0"
expect resp.http.Tus-Extension == "creation,creation-with-upload,expiration,termination,concatenation"
expect resp.http.Tus-Checksum-Algorithm == <undef>
expect resp.http.Tus-Max-Size == 3145
expect resp.http.Tus-Max-Size == 314500
expect resp.http.Upload-Offset == 0
expect resp.http.Upload-Length == 0
expect resp.http.Upload-Expires ~ "GMT$"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment