Skip to content

Commit

Permalink
[tests-only]add tests for issue-ocis-1747
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha committed Mar 11, 2021
1 parent 371a835 commit a35ddbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Feature: checksums
| old | SHA1 8cb2237d0679ca88db6464eac60da96345513964 |
| new | SHA1 8cb2237d0679ca88db6464eac60da96345513964 |


Scenario Outline: Uploading a file with checksum should return the checksum in the propfind
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand All @@ -32,6 +33,7 @@ Feature: checksums
| old |
| new |


Scenario Outline: Uploading a file with checksum should return the checksum in the download header
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand Down Expand Up @@ -61,6 +63,7 @@ Feature: checksums
| old | SHA1 8cb2237d0679ca88db6464eac60da96345513963 |
| new | SHA1 8cb2237d0679ca88db6464eac60da96345513963 |


Scenario Outline: Uploading a chunked file with correct checksum should work
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand All @@ -75,6 +78,7 @@ Feature: checksums
| old |
| new |


Scenario Outline: Uploading a chunked file with correct checksum should return the checksum in the propfind
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand All @@ -89,6 +93,7 @@ Feature: checksums
| old |
| new |


Scenario Outline: Uploading a chunked file with checksum should return the checksum in the download header
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand All @@ -103,6 +108,7 @@ Feature: checksums
| old |
| new |


Scenario Outline: Uploading second chunk of file with incorrect checksum should not work
Given using <dav_version> DAV path
And user "Alice" has created a new TUS resource on the WebDAV API with these headers:
Expand Down
36 changes: 20 additions & 16 deletions tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,35 @@ Feature: OPTIONS request
| /remote.php/webdav/ |
| /remote.php/dav/files/%username%/ |
Then the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload |
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum |
| Tus-Checksum-Algorithm | md5,sha1,adler32 |

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 |
| /remote.php/webdav/ |
| /remote.php/dav/files/%username%/ |
Then the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload |
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum |
| Tus-Checksum-Algorithm | md5,sha1,adler32 |

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 |
| /remote.php/webdav/ |
| /remote.php/dav/files/%username%/ |
Then the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload |
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum |
| Tus-Checksum-Algorithm | md5,sha1,adler32 |

Scenario: send OPTIONS requests to webDav endpoints using valid password and username of different user
Given user "Brian" has been created with default attributes and without skeleton files
Expand All @@ -44,7 +47,8 @@ Feature: OPTIONS request
| /remote.php/webdav/ |
| /remote.php/dav/files/%username%/ |
Then the following headers should be set
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload |
| header | value |
| Tus-Resumable | 1.0.0 |
| Tus-Version | 1.0.0 |
| Tus-Extension | creation,creation-with-upload,checksum |
| Tus-Checksum-Algorithm | md5,sha1,adler32 |

0 comments on commit a35ddbb

Please sign in to comment.