Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,245 @@
Feature: checksums
As a user
I want to upload resources with checksum
So that the integrity of the uploaded resources is maintained
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: uploading a file with checksum should work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
When user "Alice" uploads file with checksum "<checksum>" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/textFile.txt" for user "Alice" should be "12345"
Examples:
| dav-path-version | checksum |
| old | MD5 827ccb0eea8a706c4c34a16891f84e7b |
| new | MD5 827ccb0eea8a706c4c34a16891f84e7b |
| old | SHA1 8cb2237d0679ca88db6464eac60da96345513964 |
| new | SHA1 8cb2237d0679ca88db6464eac60da96345513964 |
| spaces | MD5 827ccb0eea8a706c4c34a16891f84e7b |
| spaces | SHA1 8cb2237d0679ca88db6464eac60da96345513964 |
Scenario Outline: uploading a file with checksum should return the checksum in the propfind
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
When user "Alice" uploads file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e7b" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
And user "Alice" requests the checksum of "/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964 MD5:827ccb0eea8a706c4c34a16891f84e7b ADLER32:02f80100"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading a file with checksum should return the checksum in the download header
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e7b" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
When user "Alice" downloads file "/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the header checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-1755
Scenario Outline: uploading a file with incorrect checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
When user "Alice" uploads file with checksum "<checksum>" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "460"
And as "Alice" file "textFile.txt" should not exist
Examples:
| dav-path-version | checksum |
| old | MD5 827ccb0eea8a706c4c34a16891f84e7a |
| new | MD5 827ccb0eea8a706c4c34a16891f84e7a |
| old | SHA1 8cb2237d0679ca88db6464eac60da96345513963 |
| new | SHA1 8cb2237d0679ca88db6464eac60da96345513963 |
| spaces | MD5 827ccb0eea8a706c4c34a16891f84e7a |
| spaces | SHA1 8cb2237d0679ca88db6464eac60da96345513963 |
Scenario Outline: uploading a chunked file with correct checksum should work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/textFile.txt" for user "Alice" should be "0123456789"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading a chunked file with correct checksum should return the checksum in the propfind
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
When user "Alice" requests the checksum of "/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:87acec17cd9dcd20a716cc2cf67417b71c8a7016 MD5:781e5e245d69b566979b86e28d23f2c7 ADLER32:0aff020e"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading a chunked file with checksum should return the checksum in the download header
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
When user "Alice" downloads file "/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the header checksum should match "SHA1:87acec17cd9dcd20a716cc2cf67417b71c8a7016"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-1755
Scenario Outline: uploading second chunk of file with incorrect checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
When user "Alice" sends a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 781e5e245d69b566979b86e28d23f2c7" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "460"
And as "Alice" file "textFile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading a file with correct checksum and overwriting an existing file should return the checksum for new data in the propfind
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
When user "Alice" overwrites existing file with offset "0" and data "hello" with checksum "<checksum>" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 5 |
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" requests the checksum of "/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d MD5:5d41402abc4b2a76b9719d911017c592 ADLER32:062c0215"
And the content of file "/textFile.txt" for user "Alice" should be "hello"
Examples:
| dav-path-version | checksum |
| old | MD5 5d41402abc4b2a76b9719d911017c592 |
| new | MD5 5d41402abc4b2a76b9719d911017c592 |
| old | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| new | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| spaces | MD5 5d41402abc4b2a76b9719d911017c592 |
| spaces | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
@issue-1755
Scenario Outline: uploading a file with correct checksum and overwriting an existing file with invalid checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" has uploaded a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
When user "Alice" overwrites existing file with offset "0" and data "hello" with checksum "<checksum>" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 5 |
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
Then the HTTP status code should be "460"
And the content of file "/textFile.txt" for user "Alice" should be "0123456789"
Examples:
| dav-path-version | checksum |
| old | MD5 5d41402abc4b2a76b9719d911017c593 |
| new | MD5 5d41402abc4b2a76b9719d911017c593 |
| old | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
| new | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
| spaces | MD5 5d41402abc4b2a76b9719d911017c593 |
| spaces | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
Scenario Outline: overwriting an existing file with new data and checksum should return the checksum of new data in the propfind
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e7b" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
When user "Alice" overwrites existing file with offset "0" and data "hello" with checksum "<checksum>" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" requests the checksum of "/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d MD5:5d41402abc4b2a76b9719d911017c592 ADLER32:062c0215"
And the content of file "/textFile.txt" for user "Alice" should be "hello"
Examples:
| dav-path-version | checksum |
| old | MD5 5d41402abc4b2a76b9719d911017c592 |
| new | MD5 5d41402abc4b2a76b9719d911017c592 |
| old | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| new | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| spaces | MD5 5d41402abc4b2a76b9719d911017c592 |
| spaces | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
@issue-1755
Scenario Outline: overwriting an existing file with new data and invalid checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e7b" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
When user "Alice" overwrites existing file with offset "0" and data "hello" with checksum "<checksum>" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
Then the HTTP status code should be "406"
And the content of file "/textFile.txt" for user "Alice" should be "12345"
Examples:
| dav-path-version | checksum |
| old | MD5 5d41402abc4b2a76b9719d911017c593 |
| new | MD5 5d41402abc4b2a76b9719d911017c593 |
| old | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
| new | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
| spaces | MD5 5d41402abc4b2a76b9719d911017c593 |
| spaces | SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434a |
@@ -0,0 +1,40 @@
Feature: tests of the creation extension see https://tus.io/protocols/resumable-upload.html#creation-with-upload
As a user
I want to be able to include parts of upload while creating resources
So that I can provide basic information about the resources to the server
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: creating a new upload resource using creation with upload extension
Given using <dav-path-version> DAV path
When user "Alice" creates a new TUS resource with content "uploaded content" on the WebDAV API with these headers:
| Upload-Length | 16 |
| Tus-Resumable | 1.0.0 |
| Content-Type | application/offset+octet-stream |
# dGVzdC50eHQ= is the base64 encode of test.txt
| Upload-Metadata | filename dGVzdC50eHQ= |
| Tus-Extension | creation-with-upload |
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| Tus-Resumable | /1\.0\.0/ |
| Location | /http[s]?:\/\/.*:\d+\/data\/.*/ |
| Upload-Offset | /\d+/ |
And the content of file "/test.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: creating a new resource and upload data in multiple bytes using creation with upload extension
Given using <dav-path-version> DAV path
When user "Alice" creates file "textFile.txt" and uploads content "12345" in the same request using the TUS protocol on the WebDAV API
Then the content of file "/textFile.txt" for user "Alice" should be "12345"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,42 @@
Feature: low level tests of the creation extension see https://tus.io/protocols/resumable-upload.html#creation
As a user
I want to able to create resources
So that I can manage my resources
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: creating a new upload resource
Given using <dav-path-version> DAV path
When user "Alice" creates a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 100 |
# d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg== is the base64 encode of world_domination_plan.pdf
| Upload-Metadata | filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg== |
| Tus-Resumable | 1.0.0 |
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| Tus-Resumable | /1\.0\.0/ |
| Location | /http[s]?:\/\/.*:\d+\/data\/.*/ |
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: creating a new upload resource without upload length
Given using <dav-path-version> DAV path
When user "Alice" creates a new TUS resource on the WebDAV API with these headers:
| Tus-Resumable | 1.0.0 |
# d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg== is the base64 encode of world_domination_plan.pdf
| Upload-Metadata | filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg== |
Then the HTTP status code should be "412"
And the following headers should not be set
| header |
| Location |
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,92 @@
Feature: low level tests for upload of chunks
As a user
I want to be able to upload resources in chunks
So that I can manage my resources
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: upload a chunk twice
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# ZmlsZS50eHQ= is the base64 encode of file.txt
| Upload-Metadata | filename ZmlsZS50eHQ= |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "123" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "000" using the WebDAV API
Then the HTTP status code should be "409"
And as "Alice" file "file.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: finalize file upload after uploading a chunk twice
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# ZmlsZS50eHQ= is the base64 encode of file.txt
| Upload-Metadata | filename ZmlsZS50eHQ= |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "123" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "000" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "3" and data "4567890" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/file.txt" for user "Alice" should be "1234567890"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: send last chunk twice
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# ZmlsZS50eHQ= is the base64 encode of file.txt
| Upload-Metadata | filename ZmlsZS50eHQ= |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "123" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "3" and data "4567890" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "3" and data "0000000" with retry on offset mismatch using the WebDAV API
Then the HTTP status code should be "404"
And the content of file "/file.txt" for user "Alice" should be "1234567890"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: send last chunk with mismatch offset
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# ZmlsZS50eHQ= is the base64 encode of file.txt
| Upload-Metadata | filename ZmlsZS50eHQ= |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "123" using the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "2" and data "34567890" using the WebDAV API
Then the HTTP status code should be "409"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: start with uploading not at the beginning of the file
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# ZmlsZS50eHQ= is the base64 encode of file.txt
| Upload-Metadata | filename ZmlsZS50eHQ= |
When user "Alice" sends a chunk to the last created TUS Location with offset "1" and data "123" using the WebDAV API
Then the HTTP status code should be "409"
And as "Alice" file "file.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,68 @@
Feature: OPTIONS request
As a user
I want to check OPTIONS request
So that I can get information about communication options for target resource
Background:
Given user "Alice" has been created with default attributes
Scenario: send OPTIONS request to webDav endpoints using the TUS protocol with valid password and username
When user "Alice" requests these endpoints with "OPTIONS" including body "doesnotmatter" using the password of user "Alice"
| endpoint |
| /webdav/ |
| /dav/files/%username%/ |
| /dav/spaces/%spaceid%/ |
Then the HTTP status code should be "204"
And the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum,expiration |
| Tus-Checksum-Algorithm | md5,sha1,crc32 |
Scenario: send OPTIONS request to webDav endpoints using the TUS protocol without any authentication
When a user requests these endpoints with "OPTIONS" with body "doesnotmatter" and no authentication about user "Alice"
| endpoint |
| /webdav/ |
| /dav/files/%username%/ |
| /dav/spaces/%spaceid%/ |
Then the HTTP status code should be "204"
And the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum,expiration |
| Tus-Checksum-Algorithm | md5,sha1,crc32 |
@issue-1012
Scenario: send OPTIONS request to webDav endpoints using the TUS protocol with valid username and wrong password
When user "Alice" requests these endpoints with "OPTIONS" including body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /webdav/ |
| /dav/files/%username%/ |
| /dav/spaces/%spaceid%/ |
Then the HTTP status code should be "204"
And the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum,expiration |
| Tus-Checksum-Algorithm | md5,sha1,crc32 |
@issue-1012
Scenario: send OPTIONS requests to webDav endpoints using valid password and username of different user
Given user "Brian" has been created with default attributes
When user "Brian" requests these endpoints with "OPTIONS" including body "doesnotmatter" using the password of user "Alice"
| endpoint |
| /webdav/ |
| /dav/files/%username%/ |
| /dav/spaces/%spaceid%/ |
Then the HTTP status code should be "204"
And the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum,expiration |
| Tus-Checksum-Algorithm | md5,sha1,crc32 |
@@ -0,0 +1,237 @@
Feature: upload file
As a user
I want to be able to upload files
So that I can store and share files between multiple client systems
Background:
Given user "Alice" has been created with default attributes
@issue-10346
Scenario Outline: upload a file and check download content
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "<file-name>" using the TUS protocol on the WebDAV API
Then the content of file "<file-name>" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | file-name |
| old | /upload.txt |
| old | /.txt |
| old | /strängé file.txt |
| old | /s,a,m,p,l,e.txt |
| old | /C++ file.cpp |
| old | /?fi=le&%#2 . txt |
| old | /# %ab ab?=ed |
| new | /upload.txt |
| new | /strängé file.txt |
| new | /.txt |
| new | /s,a,m,p,l,e.txt |
| new | /C++ file.cpp |
| new | /?fi=le&%#2 . txt |
| new | /# %ab ab?=ed |
| spaces | /upload.txt |
| spaces | /strängé file.txt |
| spaces | /.txt |
| spaces | /s,a,m,p,l,e.txt |
| spaces | /C++ file.cpp |
| spaces | /?fi=le&%#2 . txt |
| spaces | /# %ab ab?=ed |
@issue-10346
Scenario Outline: upload a file into a folder and check download content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "<folder-name>"
When user "Alice" uploads file with content "uploaded content" to "<folder-name>/<file-name>" using the TUS protocol on the WebDAV API
Then the content of file "<folder-name>/<file-name>" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | folder-name | file-name |
| old | /upload | abc.txt |
| old | /strängé folder | strängé file.txt |
| old | /C++ folder | C++ file.cpp |
| old | / | |
| old | /folder #2.txt | file #2.txt |
| old | /folder ?2.txt | file ?2.txt |
| old | /?fi=le&%#2 . txt | # %ab ab?=ed |
| new | /upload | abc.txt |
| new | /strängé folder (duplicate #2 &) | strängé file (duplicate #2 &) |
| new | /C++ folder | C++ file.cpp |
| new | / | |
| new | /folder #2.txt | file #2.txt |
| new | /folder ?2.txt | file ?2.txt |
| new | /?fi=le&%#2 . txt | # %ab ab?=ed |
| spaces | /upload | abc.txt |
| spaces | /strängé folder (duplicate #2 &) | strängé file (duplicate #2 &) |
| spaces | /C++ folder | C++ file.cpp |
| spaces | / | |
| spaces | /folder #2.txt | file #2.txt |
| spaces | /folder ?2.txt | file ?2.txt |
| spaces | /?fi=le&%#2 . txt | # %ab ab?=ed |
@issue-10346
Scenario Outline: upload chunked file with TUS
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" in 3 chunks to "/myChunkedFile.txt" using the TUS protocol on the WebDAV API
Then the content of file "/myChunkedFile.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload 1 byte chunks with TUS
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "0123456789" in 10 chunks to "/myChunkedFile.txt" using the TUS protocol on the WebDAV API
Then the content of file "/myChunkedFile.txt" for user "Alice" should be "0123456789"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload to overwriting a file
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "original content" to "textfile.txt"
When user "Alice" uploads file with content "overwritten content" to "textfile.txt" using the TUS protocol on the WebDAV API
Then the content of file "textfile.txt" for user "Alice" should be "overwritten content"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a file and no version is available
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "/upload.txt" using the TUS protocol on the WebDAV API
Then the version folder of file "/upload.txt" for user "Alice" should contain "0" elements
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a file twice and versions are available
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "/upload.txt" using the TUS protocol on the WebDAV API
And user "Alice" uploads file with content "re-uploaded content" to "/upload.txt" using the TUS protocol on the WebDAV API
Then the version folder of file "/upload.txt" for user "Alice" should contain "1" element
And the content of file "/upload.txt" for user "Alice" should be "re-uploaded content"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a file in chunks with TUS and no version is available
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "0123456789" in 10 chunks to "/myChunkedFile.txt" using the TUS protocol on the WebDAV API
Then the version folder of file "/myChunkedFile.txt" for user "Alice" should contain "0" elements
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a twice file in chunks with TUS and versions are available
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "0123456789" in 10 chunks to "/myChunkedFile.txt" using the TUS protocol on the WebDAV API
And user "Alice" uploads file with content "01234" in 5 chunks to "/myChunkedFile.txt" using the TUS protocol on the WebDAV API
Then the version folder of file "/myChunkedFile.txt" for user "Alice" should contain "1" elements
And the content of file "/myChunkedFile.txt" for user "Alice" should be "01234"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10334
Scenario Outline: upload a file with invalid-name
Given using <dav-path-version> DAV path
When user "Alice" creates a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 100 |
| Upload-Metadata | filename <metadata> |
| Tus-Resumable | 1.0.0 |
Then the HTTP status code should be "412"
And the following headers should not be set
| header |
| Location |
And as "Alice" file <file-name> should not exist
Examples:
| dav-path-version | file-name | metadata |
| old | " " | IA== |
| old | "filewithLF-and-CR\r\n" | ZmlsZXdpdGhMRi1hbmQtQ1INCgo= |
| old | "folder/file" | Zm9sZGVyL2ZpbGU= |
| old | "my\\file" | bXkMaWxl |
| old | ".." | Li4= |
| new | " " | IA== |
| new | "filewithLF-and-CR\r\n" | ZmlsZXdpdGhMRi1hbmQtQ1INCgo= |
| new | "folder/file" | Zm9sZGVyL2ZpbGU= |
| new | "my\\file" | bXkMaWxl |
| new | ".." | Li4= |
| spaces | " " | IA== |
| spaces | "filewithLF-and-CR\r\n" | ZmlsZXdpdGhMRi1hbmQtQ1INCgo= |
| spaces | "folder/file" | Zm9sZGVyL2ZpbGU= |
| spaces | "my\\file" | bXkMaWxl |
| spaces | ".." | Li4= |
@issue-10346
Scenario Outline: upload a zero-byte file
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "textfile.txt" using the TUS protocol on the WebDAV API
Then the content of file "textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-8003 @issue-10346
Scenario Outline: replace a file with zero-byte file
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "This is TUS upload" to "textfile.txt"
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "textfile.txt" using the TUS protocol on the WebDAV API
Then the content of file "textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-8003 @issue-10346
Scenario Outline: replace a file inside a folder with zero-byte file
Given using <dav-path-version> DAV path
And user "Alice" has created folder "testFolder"
And user "Alice" has uploaded file with content "This is TUS upload" to "testFolder/textfile.txt"
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "testFolder/textfile.txt" using the TUS protocol on the WebDAV API
Then the content of file "testFolder/textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-8804
Scenario Outline: multiple upload locations of the same file
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# bG9yZW0udHh0 is the base64 encode of lorem.txt
| Upload-Metadata | filename bG9yZW0udHh0 |
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# bG9yZW0udHh0 is the base64 encode of lorem.txt
| Upload-Metadata | filename bG9yZW0udHh0 |
When user "Alice" uploads content "lorem" with checksum "MD5 d2e16e6ef52a45b7468f1da56bba1953" and offset "0" to the index "1" location of file "lorem.txt" using the TUS protocol
Then the HTTP status code should be "204"
And the content of file "lorem.txt" for user "Alice" should be "lorem"
When user "Alice" tries to upload content "epsum" with checksum "MD5 d6145e3d2ced88009796acae1dc7929f" and offset "0" to the index "0" location of file "lorem.txt" using the TUS protocol
Then the HTTP status code should be "409"
And the content of file "lorem.txt" for user "Alice" should be "lorem"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,81 @@
Feature: upload file
As a user
I want the mtime of an uploaded file to be the creation date on upload source not the upload date
So that I can find files by their real creation date
Background:
Given user "Alice" has been created with default attributes
@issue-10346
Scenario Outline: upload file with mtime
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload file with future mtime
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2129 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2129 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a file with mtime in a folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "testFolder"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/testFolder/file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: overwriting a file changes its mtime
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "first time upload content" to "file.txt"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: upload a file with the same mtime and same content multiple times (atleast 3 times)
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
And the version folder of file "file.txt" for user "Alice" should contain "2" element
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346 @issue-10496
Scenario Outline: upload a file with the same mtime and different content multiple times (atleast 3 times)
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol
And user "Alice" has uploaded file "filesForUpload/davtest.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol
When user "Alice" uploads file "filesForUpload/lorem.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
And the version folder of file "file.txt" for user "Alice" should contain "2" element
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,91 @@
@skipOnReva
Feature: upload file
As a user
I want the mtime of an uploaded file to be the creation date on upload source not the upload date
So that I can find files by their real creation date
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
@issue-10346
Scenario Outline: upload file with mtime to a received share
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/toShare"
And user "Alice" has sent the following resource share invitation:
| resource | toShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "toShare" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/toShare/file.txt" with mtime "Thu, 08 Aug 2012 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
And as "Brian" the mtime of the file "/Shares/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: upload file with mtime to a send share
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/toShare"
And user "Alice" has sent the following resource share invitation:
| resource | toShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "toShare" synced
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/toShare/file.txt" with mtime "Thu, 08 Aug 2012 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
And as "Brian" the mtime of the file "/Shares/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-10346
Scenario Outline: overwriting a file with mtime in a received share
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/toShare"
And user "Alice" has sent the following resource share invitation:
| resource | toShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "toShare" synced
And user "Alice" has uploaded file with content "uploaded content" to "/toShare/file.txt"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/toShare/file.txt" with mtime "Thu, 08 Aug 2012 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
And as "Brian" the mtime of the file "/Shares/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: overwriting a file with mtime in a send share
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/toShare"
And user "Alice" has sent the following resource share invitation:
| resource | toShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "toShare" synced
And user "Brian" has uploaded file with content "uploaded content" to "/Shares/toShare/file.txt"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/toShare/file.txt" with mtime "Thu, 08 Aug 2012 04:18:13 GMT" using the TUS protocol on the WebDAV API
Then as "Alice" the mtime of the file "/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
And as "Brian" the mtime of the file "/Shares/toShare/file.txt" should be "Thu, 08 Aug 2012 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,23 @@
Feature: move folders
As a user
I want to be able to move and upload files/folders
So that I can organise my data structure
Background:
Given user "Alice" has been created with default attributes
@issue-10346
Scenario Outline: uploading file into a moved folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/test"
And user "Alice" has created folder "/test-moved"
And user "Alice" has moved folder "/test-moved" to "/test/test-moved"
When user "Alice" uploads file with content "uploaded content" to "/test/test-moved/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" file "/test/test-moved/textfile.txt" should exist
And the content of file "/test/test-moved/textfile.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,82 @@
Feature: upload file
As a user
I want to try uploading files to a nonexistent folder
So that I can check if the uploading works in such case
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes
Scenario Outline: attempt to upload a file into a nonexistent shares
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" folder "/Shares/FOLDER/" should not exist
And as "Alice" file "/Shares/FOLDER/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
@skipOnReva
Examples:
| dav-path-version |
| spaces |
Scenario Outline: attempt to upload a file into a nonexistent folder
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "/nonExistentFolder/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" folder "/nonExistentFolder" should not exist
And as "Alice" file "/nonExistentFolder/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
@skipOnReva
Examples:
| dav-path-version |
| spaces |
@skipOnReva
Scenario Outline: attempt to upload a file into a nonexistent folder within correctly received share
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/nonExistentFolder/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Brian" folder "/Shares/FOLDER/nonExistentFolder" should not exist
And as "Brian" file "/Shares/FOLDER/nonExistentFolder/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva
Scenario Outline: attempt to upload a file into a nonexistent folder within correctly received read only share
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/nonExistentFolder/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Brian" folder "/Shares/FOLDER/nonExistentFolder" should not exist
And as "Brian" file "/Shares/FOLDER/nonExistentFolder/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@@ -0,0 +1,377 @@
@skipOnReva
Feature: upload file to shared folder
As a user
I want to upload files on a shared folder
So that other user with access on the shared folder can access the resource
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
@issue-10346
Scenario Outline: uploading file to a received share folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" file "/FOLDER/textfile.txt" should exist
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: uploading file to a user read/write share folder works
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" file "/FOLDER/textfile.txt" should exist
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: uploading a file into a group share as share receiver
Given using <dav-path-version> DAV path
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" file "/FOLDER/textfile.txt" should exist
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: overwrite file to a received share folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has uploaded file with content "original content" to "/FOLDER/textfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "overwritten content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Alice" file "/FOLDER/textfile.txt" should exist
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "overwritten content"
Examples:
| dav-path-version |
| old |
| new |
@issue-10346
Scenario Outline: attempt to upload a file into a folder within correctly received read only share
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "uploaded content" to "/Shares/FOLDER/textfile.txt" using the TUS protocol on the WebDAV API
Then as "Brian" file "/Shares/FOLDER/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: upload a file to shared folder with checksum should return the checksum in the propfind for sharee
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# L0ZPTERFUi90ZXh0RmlsZS50eHQ= is the base64 encode of /FOLDER/textFile.txt
| Upload-Metadata | filename L0ZPTERFUi90ZXh0RmlsZS50eHQ= |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
When user "Brian" requests the checksum of "/Shares/FOLDER/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964 MD5:827ccb0eea8a706c4c34a16891f84e7b ADLER32:02f80100"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: upload a file to shared folder with checksum should return the checksum in the download header for sharee
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# L0ZPTERFUi90ZXh0RmlsZS50eHQ= is the base64 encode of /FOLDER/textFile.txt
| Upload-Metadata | filename L0ZPTERFUi90ZXh0RmlsZS50eHQ= |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d069ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
When user "Brian" downloads file "/Shares/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the header checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: sharer shares a file with correct checksum should return the checksum in the propfind for sharee
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
And user "Alice" has sent the following resource share invitation:
| resource | textFile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textFile.txt" synced
When user "Brian" requests the checksum of "/Shares/textFile.txt" via propfind
Then the HTTP status code should be "207"
And the webdav checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964 MD5:827ccb0eea8a706c4c34a16891f84e7b ADLER32:02f80100"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: sharer shares a file with correct checksum should return the checksum in the download header for sharee
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 5 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" using the TUS protocol on the WebDAV API
And user "Alice" has sent the following resource share invitation:
| resource | textFile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textFile.txt" synced
When user "Brian" downloads file "/Shares/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the header checksum should match "SHA1:8cb2237d0679ca88db6464eac60da96345513964"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: sharee uploads a file to a received share folder with correct checksum
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Brian" has created a new TUS resource on the WebDAV API with these headers:
| Tus-Resumable | 1.0.0 |
| Upload-Length | 16 |
# L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 is the base64 encode of /Shares/FOLDER/textFile.txt
| Upload-Metadata | filename L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 |
When user "Brian" uploads file with checksum "MD5 8a4e0407dcda7872d44dada38887b8ae" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "204"
And the content of file "FOLDER/textFile.txt" for user "Alice" should be "uploaded content"
And the content of file "Shares/FOLDER/textFile.txt" for user "Brian" should be "uploaded content"
Examples:
| dav-path-version |
| old |
| new |
@issue-1755
Scenario Outline: sharee uploads a file to a received share folder with wrong checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Brian" has created a new TUS resource on the WebDAV API with these headers:
| Tus-Resumable | 1.0.0 |
| Upload-Length | 16 |
# L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 is the base64 encode of /Shares/FOLDER/textFile.txt
| Upload-Metadata | filename L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 |
And user "Brian" uploads file with checksum "MD5 827ccb0eea8a706c4c34a16891f84e8c" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "460"
And as "Alice" file "/FOLDER/textFile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
@issue-1755
Scenario Outline: sharer uploads a file to shared folder with wrong checksum should not work
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 16 |
# L0ZPTERFUi90ZXh0RmlsZS50eHQ= is the base64 encode of /FOLDER/textFile.txt
| Upload-Metadata | filename L0ZPTERFUi90ZXh0RmlsZS50eHQ= |
When user "Alice" uploads file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513954" to the last created TUS Location with offset "0" and content "uploaded content" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "460"
And as "Alice" file "/FOLDER/textFile.txt" should not exist
And as "Brian" file "/Shares/FOLDER/textFile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
Scenario Outline: sharer uploads a chunked file with correct checksum and share it with sharee should work
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Alice" sends a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
And user "Alice" shares file "textFile.txt" with user "Brian" using the sharing API
Then the HTTP status code should be "200"
And user "Brian" has a share "textFile.txt" synced
And the content of file "/Shares/textFile.txt" for user "Brian" should be "0123456789"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: sharee uploads a chunked file with correct checksum to a received share folder should work
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Brian" has created a new TUS resource on the WebDAV API with these headers:
| Tus-Resumable | 1.0.0 |
| Upload-Length | 10 |
# L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 is the base64 encode of /Shares/FOLDER/textFile.txt
| Upload-Metadata | filename L1NoYXJlcy9GT0xERVIvdGV4dEZpbGUudHh0 |
When user "Brian" sends a chunk to the last created TUS Location with offset "0" and data "01234" with checksum "MD5 4100c4d44da9177247e44a5fc1546778" using the TUS protocol on the WebDAV API
And user "Brian" sends a chunk to the last created TUS Location with offset "5" and data "56789" with checksum "MD5 099ebea48ea9666a7da2177267983138" using the TUS protocol on the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/FOLDER/textFile.txt" for user "Alice" should be "0123456789"
And the content of file "Shares/FOLDER/textFile.txt" for user "Brian" should be "0123456789"
Examples:
| dav-path-version |
| old |
| new |
Scenario Outline: sharer uploads a file with checksum and as a sharee overwrites the shared file with new data and correct checksum
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 16 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "SHA1 c1dab0c0864b6ac9bdd3743a1408d679f1acd823" to the last created TUS Location with offset "0" and content "original content" using the TUS protocol on the WebDAV API
And user "Alice" has sent the following resource share invitation:
| resource | textFile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textFile.txt" synced
When user "Brian" overwrites recently shared file with offset "0" and data "overwritten content" with checksum "SHA1 fe990d2686a0fc86004efc31f5bf2475a45d4905" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 19 |
# dGV4dEZpbGUudHh0 is the base64 encode of /Shares/textFile.txt
| Upload-Metadata | filename L1NoYXJlcy90ZXh0RmlsZS50eHQ= |
Then the HTTP status code should be "204"
And the content of file "/textFile.txt" for user "Alice" should be "overwritten content"
Examples:
| dav-path-version |
| old |
| new |
@issue-1755
Scenario Outline: sharer uploads a file with checksum and as a sharee overwrites the shared file with new data and invalid checksum
Given using <dav-path-version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
| Upload-Length | 16 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
And user "Alice" has uploaded file with checksum "SHA1 c1dab0c0864b6ac9bdd3743a1408d679f1acd823" to the last created TUS Location with offset "0" and content "original content" using the TUS protocol on the WebDAV API
And user "Alice" has sent the following resource share invitation:
| resource | textFile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textFile.txt" synced
When user "Brian" overwrites recently shared file with offset "0" and data "overwritten content" with checksum "SHA1 fe990d2686a0fc86004efc31f5bf2475a45d4906" using the TUS protocol on the WebDAV API with these headers:
| Upload-Length | 19 |
# dGV4dEZpbGUudHh0 is the base64 encode of /Shares/textFile.txt
| Upload-Metadata | filename L1NoYXJlcy90ZXh0RmlsZS50eHQ= |
Then the HTTP status code should be "460"
And the content of file "/textFile.txt" for user "Alice" should be "original content"
Examples:
| dav-path-version |
| old |
| new |