Skip to content

Commit

Permalink
Merge pull request #10516 from owncloud/extend-webdav-test-for-all-paths
Browse files Browse the repository at this point in the history
[tests-only][full-ci] extend webdav tests for old, new and spaces path
  • Loading branch information
PrajwolAmatya authored Nov 19, 2024
2 parents 0fa52f2 + 9d6bd35 commit 32bafde
Show file tree
Hide file tree
Showing 42 changed files with 581 additions and 260 deletions.
53 changes: 7 additions & 46 deletions tests/acceptance/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,6 @@ public function uploadFileWithHeaders(
* @param string $source
* @param string $destination
* @param integer $noOfChunks
* @param string|null $chunkingVersion
* @param boolean $async
* @param array|null $headers
*
Expand All @@ -1745,7 +1744,6 @@ public function userUploadsAFileInChunk(
string $source,
string $destination,
int $noOfChunks = 2,
?string $chunkingVersion = null,
bool $async = false,
?array $headers = []
):void {
Expand All @@ -1755,22 +1753,9 @@ public function userUploadsAFileInChunk(
$noOfChunks,
"What does it mean to have $noOfChunks chunks?"
);
// use the chunking version that works with the set DAV version
if ($chunkingVersion === null) {
if (\in_array($this->currentDAVPath, [WebDavHelper::DAV_VERSION_OLD, WebDavHelper::DAV_VERSION_SPACES])) {
$chunkingVersion = "v1";
} else {
$chunkingVersion = "v2";
}
}
$this->useSpecificChunking($chunkingVersion);
Assert::assertTrue(
WebDavHelper::isValidDavChunkingCombination(
$this->getDavPathVersion(),
$this->chunkingToUse
),
"invalid chunking/webdav version combination"
);

// use chunking version 1 as default, since version 2 uses "remote.php/dav/uploads" endpoint and it doesn't exist in oCIS
$this->chunkingToUse = 1;

if ($async === true) {
$headers['OC-LazyOps'] = 'true';
Expand All @@ -1785,27 +1770,6 @@ public function userUploadsAFileInChunk(
$this->pushToLastStatusCodesArrays();
}

/**
* sets the chunking version from human-readable format
*
* @param string $version (no|v1|v2|new|old)
*
* @return void
*/
public function useSpecificChunking(string $version):void {
if ($version === "v1" || $version === "old") {
$this->chunkingToUse = 1;
} elseif ($version === "v2" || $version === "new") {
$this->chunkingToUse = 2;
} elseif ($version === "no") {
$this->chunkingToUse = null;
} else {
throw new InvalidArgumentException(
"cannot set chunking version to $version"
);
}
}

/**
* Uploading with old/new DAV and chunked/non-chunked.
* Except do not do the new-DAV-new-chunking combination. That is not being
Expand Down Expand Up @@ -1839,13 +1803,12 @@ public function userUploadsAFileToWithAllMechanismsExceptNewChunking(
}

/**
* @When /^user "([^"]*)" uploads file "([^"]*)" to "([^"]*)" in (\d+) chunks (?:with (new|old|v1|v2) chunking and)?\s?using the WebDAV API$/
* @When /^user "([^"]*)" uploads file "([^"]*)" to "([^"]*)" in (\d+) chunks using the WebDAV API$/
*
* @param string $user
* @param string $source
* @param string $destination
* @param int $noOfChunks
* @param string|null $chunkingVersion old|v1|new|v2 null for autodetect
*
* @return void
* @throws Exception
Expand All @@ -1854,10 +1817,9 @@ public function userUploadsAFileToWithChunks(
string $user,
string $source,
string $destination,
int $noOfChunks = 2,
?string $chunkingVersion = null
int $noOfChunks = 2
):void {
$this->userUploadsAFileInChunk($user, $source, $destination, $noOfChunks, $chunkingVersion);
$this->userUploadsAFileInChunk($user, $source, $destination, $noOfChunks);
}

/**
Expand Down Expand Up @@ -3059,7 +3021,7 @@ public function userUploadChunkedFile(
['OC-Chunked' => '1'],
$data,
null,
"uploads",
"files",
null,
false,
null,
Expand Down Expand Up @@ -4430,7 +4392,6 @@ public function theLastPublicDavResponseShouldNotContainTheseNodes(TableNode $ta
*/
public function thePublicListsTheResourcesInTheLastCreatedPublicLinkWithDepthUsingTheWebdavApi(string $depth):void {
$token = ($this->isUsingSharingNG()) ? $this->shareNgGetLastCreatedLinkShareToken() : $this->getLastCreatedPublicShareToken();
// https://drone.owncloud.com/owncloud/ocis/39693/29/6
$response = $this->listFolder(
$token,
'/',
Expand Down
74 changes: 40 additions & 34 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md

Large diffs are not rendered by default.

33 changes: 18 additions & 15 deletions tests/acceptance/expected-failures-without-remotephp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

#### [REPORT request without remote.php returns empty result (only with dav/spaces path)](https://github.com/owncloud/ocis/issues/10329)

- [apiContract/sharesReport.feature:127](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L127)
- [apiContract/sharesReport.feature:156](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L156)
- [apiContract/sharesReport.feature:42](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L42)
- [apiContract/sharesReport.feature:66](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L66)
- [apiContract/sharesReport.feature:130](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L130)
- [apiContract/sharesReport.feature:159](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/sharesReport.feature#L159)
- [apiContract/spacesReport.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesReport.feature#L16)
- [apiContract/spacesReport.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesReport.feature#L34)
- [apiContract/spacesReport.feature:53](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesReport.feature#L53)
- [apiContract/spacesReport.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesReport.feature#L71)
- [apiContract/spacesSharesReport.feature:48](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesSharesReport.feature#L48)
- [apiContract/spacesSharesReport.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/spacesSharesReport.feature#L78)
- [apiSearch1/dateSearch.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearch1/dateSearch.feature#L19)
- [apiSearch1/dateSearch.feature:39](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearch1/dateSearch.feature#L39)
- [apiSearch1/dateSearch.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearch1/dateSearch.feature#L40)
Expand Down Expand Up @@ -193,7 +197,7 @@
- [apiSpaces/publicLink.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/publicLink.feature#L40)
- [apiSpacesShares/shareSpacesViaLink.feature:61](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature#L61)
- [apiDepthInfinity/propfind.feature:74](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiDepthInfinity/propfind.feature#L74)
- [apiDepthInfinity/propfind.feature:125](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiDepthInfinity/propfind.feature#L125)
- [apiDepthInfinity/propfind.feature:124](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiDepthInfinity/propfind.feature#L124)
- [apiLocks/lockFiles.feature:490](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L490)
- [apiLocks/lockFiles.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L487)
- [apiLocks/lockFiles.feature:488](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L488)
Expand All @@ -208,21 +212,21 @@
- [apiLocks/unlockFiles.feature:323](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L323)
- [apiActivities/shareActivities.feature:1775](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1775)
- [apiActivities/shareActivities.feature:1914](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1914)
- [apiAntivirus/antivirus.feature:113](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L113)
- [apiAntivirus/antivirus.feature:114](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L114)
- [apiAntivirus/antivirus.feature:115](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L115)
- [apiAntivirus/antivirus.feature:116](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L116)
- [apiAntivirus/antivirus.feature:117](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L117)
- [apiAntivirus/antivirus.feature:118](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L118)
- [apiAntivirus/antivirus.feature:139](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L139)
- [apiAntivirus/antivirus.feature:119](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L119)
- [apiAntivirus/antivirus.feature:140](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L140)
- [apiAntivirus/antivirus.feature:141](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L141)
- [apiAntivirus/antivirus.feature:142](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L142)
- [apiAntivirus/antivirus.feature:143](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L143)
- [apiAntivirus/antivirus.feature:144](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L144)
- [apiAntivirus/antivirus.feature:401](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L401)
- [apiAntivirus/antivirus.feature:145](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L145)
- [apiAntivirus/antivirus.feature:402](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L402)
- [apiAntivirus/antivirus.feature:403](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L403)
- [apiAntivirus/antivirus.feature:404](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L404)
- [apiCollaboration/wopi.feature:956](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L956)
- [apiCollaboration/wopi.feature:957](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L957)
- [apiCollaboration/wopi.feature:958](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCollaboration/wopi.feature#L958)
Expand Down Expand Up @@ -298,8 +302,7 @@
- [coreApiWebdavEtagPropagation2/copyFileFolder.feature:135](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature#L135)
- [coreApiWebdavEtagPropagation2/copyFileFolder.feature:136](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature#L136)
- [coreApiWebdavEtagPropagation2/copyFileFolder.feature:137](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/copyFileFolder.feature#L137)
- [coreApiWebdavEtagPropagation2/createFolder.feature:130](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature#L130)
- [coreApiWebdavEtagPropagation2/createFolder.feature:131](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature#L131)
- [coreApiWebdavEtagPropagation2/createFolder.feature:111](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/createFolder.feature#L111)
- [coreApiWebdavEtagPropagation2/upload.feature:188](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature#L188)
- [coreApiWebdavEtagPropagation2/upload.feature:189](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature#L189)
- [coreApiWebdavEtagPropagation2/upload.feature:190](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavEtagPropagation2/upload.feature#L190)
Expand Down Expand Up @@ -335,19 +338,19 @@
- [coreApiWebdavUploadTUS/uploadFile.feature:109](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L109)
- [coreApiWebdavUploadTUS/uploadFile.feature:122](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L122)
- [coreApiWebdavUploadTUS/uploadFile.feature:133](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L133)
- [coreApiWebdavUploadTUS/uploadFile.feature:145](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L145)
- [coreApiWebdavUploadTUS/uploadFile.feature:167](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L167)
- [coreApiWebdavUploadTUS/uploadFile.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L186)
- [coreApiWebdavUploadTUS/uploadFile.feature:198](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L198)
- [coreApiWebdavUploadTUS/uploadFile.feature:211](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L211)
- [coreApiWebdavUploadTUS/uploadFile.feature:146](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L146)
- [coreApiWebdavUploadTUS/uploadFile.feature:168](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L168)
- [coreApiWebdavUploadTUS/uploadFile.feature:187](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L187)
- [coreApiWebdavUploadTUS/uploadFile.feature:199](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L199)
- [coreApiWebdavUploadTUS/uploadFile.feature:212](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L212)
- [coreApiWebdavUploadTUS/uploadFileMtime.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtime.feature#L16)
- [coreApiWebdavUploadTUS/uploadFileMtime.feature:27](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtime.feature#L27)
- [coreApiWebdavUploadTUS/uploadFileMtime.feature:39](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtime.feature#L39)
- [coreApiWebdavUploadTUS/uploadFileMtime.feature:51](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtime.feature#L51)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:29](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L29)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:48](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L48)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:68](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L68)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:88](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L88)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:69](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L69)
- [coreApiWebdavUploadTUS/uploadFileMtimeShares.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFileMtimeShares.feature#L89)
- [coreApiWebdavUploadTUS/uploadToMoveFolder.feature:20](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadToMoveFolder.feature#L20)
- [coreApiWebdavUploadTUS/uploadToShare.feature:29](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadToShare.feature#L29)
- [coreApiWebdavUploadTUS/uploadToShare.feature:48](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadToShare.feature#L48)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ Feature: upload file
| ocs-api-version | dav-path-version |
| 1 | old |
| 1 | new |
| 1 | spaces |
| 2 | old |
| 2 | new |
| 2 | spaces |
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: attempt to PUT files with invalid password

Scenario: send PUT requests to webDav endpoints as normal user with wrong password
When user "Alice" requests these endpoints with "PUT" including body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| endpoint |
| /webdav/textfile0.txt |
| /dav/files/%username%/textfile0.txt |
| /webdav/PARENT |
Expand All @@ -25,7 +25,7 @@ Feature: attempt to PUT files with invalid password

Scenario: send PUT requests to webDav endpoints as normal user with no password
When user "Alice" requests these endpoints with "PUT" including body "doesnotmatter" using password "" about user "Alice"
| endpoint |
| endpoint |
| /webdav/textfile0.txt |
| /dav/files/%username%/textfile0.txt |
| /webdav/PARENT |
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/features/apiAntivirus/antivirus.feature
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Feature: antivirus
Examples:
| dav-path-version |
| old |
| new |
| spaces |

@issue-10331
Expand Down
3 changes: 3 additions & 0 deletions tests/acceptance/features/apiContract/sharesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Feature: REPORT request to Shares space
| dav-path-version |
| old |
| new |
| spaces |


Scenario Outline: check the REPORT response of the found file
Expand All @@ -62,6 +63,7 @@ Feature: REPORT request to Shares space
| dav-path-version |
| old |
| new |
| spaces |


Scenario Outline: search for the shared folder when share is not accepted
Expand All @@ -83,6 +85,7 @@ Feature: REPORT request to Shares space
| dav-path-version |
| old |
| new |
| spaces |

@issue-9607 @issue-10329 @env-config
Scenario Outline: check the REPORT response of a folder shared with secure viewer role
Expand Down
Loading

0 comments on commit 32bafde

Please sign in to comment.