Skip to content

Commit

Permalink
Merge pull request #33009 from owncloud/API-test-shareFilesAndFolderW…
Browse files Browse the repository at this point in the history
…ithLongName

API test to check that share can be made with file names more than 64 chars long
  • Loading branch information
phil-davis authored Oct 5, 2018
2 parents df1eac1 + 4be3530 commit bb2e54e
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
85 changes: 85 additions & 0 deletions tests/acceptance/features/apiShareManagement/createShare.feature
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,88 @@ Feature: sharing
| ocs_api_version | ocs_status_code |
| 1 | 400 |
| 2 | 400 |

Scenario Outline: user shares a file with file name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a file with file name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "user1" has been created
And user "user1" has been added to group "grp1"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a folder with folder name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt"
When user "user0" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the downloaded content when downloading file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt" for user "user1" with range "bytes=1-6" should be "elcome"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a folder with folder name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "user1" has been created
And user "user1" has been added to group "grp1"
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt"
When user "user0" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the downloaded content when downloading file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt" for user "user1" with range "bytes=1-6" should be "elcome"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user creates a public link share of a file with file name longer than 64 chars
Given using OCS API version "<ocs_api_version>"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" creates a public link share using the sharing API with settings
| path | /aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the last public shared file should be able to be downloaded without a password
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user creates a public link share of a folder with folder name longer than 64 chars
Given using OCS API version "<ocs_api_version>"
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt"
When user "user0" creates a public link share using the sharing API with settings
| path | /aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Then the public should be able to download the range "bytes=1-6" of file "/welcome.txt" from inside the last public shared folder and the content should be "elcome"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
18 changes: 18 additions & 0 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,24 @@ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPassword(
$this->downloadedContentShouldBe($content);
}

/**
* @Then /^the public should be able to download the range "([^"]*)" of file "([^"]*)" from inside the last public shared folder and the content should be "([^"]*)"$/
*
* @param string $range
* @param string $path
* @param string $content
*
* @return void
*/
public function shouldBeAbleToDownloadFileInsidePublicSharedFolder(
$range, $path, $content
) {
$this->publicDownloadsTheFileInsideThePublicSharedFolderWithPassword(
$path, null, $range
);
$this->downloadedContentShouldBe($content);
}

/**
* @Then /^user "([^"]*)" using password "([^"]*)" should not be able to download file "([^"]*)"$/
*
Expand Down

0 comments on commit bb2e54e

Please sign in to comment.