Skip to content

Commit

Permalink
allow dot in etag, eos etag for folders: '"2a:0.000"'
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Jul 3, 2020
1 parent 1d7dbb4 commit 50b3dba
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: sharing
When user "Brian" uploads file "filesForUpload/textfile.txt" to "FOLDER (2)/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
Examples:
| dav-path |
| old |
Expand All @@ -61,7 +61,7 @@ Feature: sharing
When user "Brian" uploads file "filesForUpload/textfile.txt" to "FOLDER (2)/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
Examples:
| dav-path |
| old |
Expand Down Expand Up @@ -110,7 +110,7 @@ Feature: sharing
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/myfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
Examples:
| dav-path |
| old |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Feature: delete a public link share
When user "Alice" deletes public link share named "sharedlink" in folder "test-folder" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Alice" should see the following elements
| /test-folder/ |
And as user "Alice" the folder "test-folder" should not have any shares
Examples:
| ocs_api_version | ocs_status_code |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: upload to a public link share
And the public uploads file "test.txt" with content "test2" with auto-rename mode using the old public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

Expand All @@ -30,7 +30,7 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test2" using the new public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

Expand Down Expand Up @@ -98,7 +98,7 @@ Feature: upload to a public link share
When the public uploads file "test-old.txt" with content "test-old" using the old public WebDAV API
Then the content of file "/FOLDER/test-old.txt" for user "Alice" should be "test-old"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |

Scenario: Uploading to a public upload-only share with new public API
Given the administrator has enabled DAV tech_preview
Expand All @@ -108,7 +108,7 @@ Feature: upload to a public link share
When the public uploads file "test-new.txt" with content "test-new" using the new public WebDAV API
Then the content of file "/FOLDER/test-new.txt" for user "Alice" should be "test-new"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |

@skipOnOcis
Scenario: Uploading to a public upload-only share with password with old public API
Expand Down Expand Up @@ -271,7 +271,7 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test" using the old public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
When the public uploads file "test.txt" with content "test2" using the old public WebDAV API
# Uncomment these once the issue is fixed
# Then the HTTP status code should be "201"
Expand All @@ -289,7 +289,7 @@ Feature: upload to a public link share
When the public uploads file "test.txt" with content "test" using the new public WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
When the public uploads file "test.txt" with content "test2" using the new public WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
Expand Down
10 changes: 5 additions & 5 deletions tests/acceptance/features/apiTrashbin/trashbinRestore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: Restore deleted files/folders
When user "Brian" restores the file with original path "/renamed_shared/shared_file.txt" using the trashbin API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Brian" the file with original path "/renamed_shared/shared_file.txt" should not exist in the trashbin
And user "Brian" should see the following elements
| /renamed_shared/ |
Expand All @@ -46,7 +46,7 @@ Feature: Restore deleted files/folders
When user "Alice" restores the folder with original path "/textfile0.txt" using the trashbin API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Alice" the folder with original path "/textfile0.txt" should not exist in the trashbin
And user "Alice" should see the following elements
| /FOLDER/ |
Expand Down Expand Up @@ -102,7 +102,7 @@ Feature: Restore deleted files/folders
When user "Alice" restores the file with original path "<delete-path>" to "<restore-path>" using the trashbin API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Alice" the file with original path "<delete-path>" should not exist in the trashbin
And as "Alice" file "<restore-path>" should exist
And as "Alice" file "<delete-path>" should not exist
Expand Down Expand Up @@ -198,7 +198,7 @@ Feature: Restore deleted files/folders
And user "Alice" restores the file with original path "/new-folder/new-file.txt" using the trashbin API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Alice" the file with original path "/new-folder/new-file.txt" should not exist in the trashbin
And as "Alice" file "/new-folder/new-file.txt" should exist
Examples:
Expand All @@ -219,7 +219,7 @@ Feature: Restore deleted files/folders
When user "Alice" restores the folder with original path "/local_storage/tmp/textfile0.txt" using the trashbin API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Alice" the folder with original path "/local_storage/tmp/textfile0.txt" should not exist in the trashbin
And user "Alice" should see the following elements
| /local_storage/ |
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/apiWebdavMove2/moveFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: move (rename) file
When user "Alice" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile0.txt" for user "Alice" should be "ownCloud test text file 0" plus end-of-line
Examples:
| dav_version |
Expand All @@ -27,7 +27,7 @@ Feature: move (rename) file
When user "Alice" moves file "/textfile0.txt" to "/textfile1.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/textfile1.txt" for user "Alice" should be "ownCloud test text file 0" plus end-of-line
Examples:
| dav_version |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: upload file
Given using <dav_version> DAV path
When user "Alice" uploads file with content "uploaded content" to "<file_name>" using the WebDAV API
Then the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "<file_name>" for user "Alice" should be "uploaded content"
Examples:
| dav_version | file_name |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: upload file using new chunking
| 3 | CCCCC |
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:]{1,32}"$/ |
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And as "Alice" file "/myChunkedFile.txt" should exist
And the content of file "/myChunkedFile.txt" for user "Alice" should be "AAAAABBBBBCCCCC"
And the log file should not contain any log-entries containing these attributes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: upload file using old chunking
| 3 | CCCCC |
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
#| ETag | /^"[a-f0-9:]{1,32}"$/ |
#| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
| ETag | /^[a-f0-9:]{1,32}$/ |
Then as "Alice" file "/myChunkedFile.txt" should exist
And the content of file "/myChunkedFile.txt" for user "Alice" should be "AAAAABBBBBCCCCC"
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function isEtagValid($eTag = null) {
if ($eTag === null) {
$eTag = $this->getEtagFromResponseXmlObject();
}
if (\preg_match("/^\"[a-f0-9:]{1,32}\"$/", $eTag)
if (\preg_match("/^\"[a-f0-9:\.]{1,32}\"$/", $eTag)
) {
return true;
} else {
Expand Down

0 comments on commit 50b3dba

Please sign in to comment.