Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/dav/lib/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ public function __construct(IRequest $request, $baseUri) {
)
)
);
$this->server->addPlugin(
new \OCA\DAV\Connector\Sabre\QuotaPlugin($view));

}
});
}
Expand Down
12 changes: 11 additions & 1 deletion build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ public function usingDavPath($davPath) {
$this->davPath = $davPath;
}

public function getFilesPath(){
$basePath = '';
if ($this->davPath === "remote.php/dav"){
$basePath = '/files/' . $this->currentUser . '/';
} else {
$basePath = '/';
}
return $basePath;
}

public function makeDavRequest($user, $method, $path, $headers, $body = null){
$fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path";
$client = new GClient();
Expand Down Expand Up @@ -425,7 +435,7 @@ public function userDeletesFile($user, $file) {
*/
public function userCreatedAFolder($user, $destination){
try {
$this->response = $this->makeDavRequest($user, "MKCOL", '/' . ltrim($destination, '/'), []);
$this->response = $this->makeDavRequest($user, "MKCOL", $this->getFilesPath() . ltrim($destination, $this->getFilesPath()), []);
} catch (\GuzzleHttp\Exception\ServerException $e) {
// 4xx and 5xx responses cause an exception
$this->response = $e->getResponse();
Expand Down
27 changes: 27 additions & 0 deletions build/integration/features/dav-v2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,30 @@ Feature: dav-v2
Given Logging in using web as "admin"
When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken
Then the HTTP status code should be "207"

Scenario: Uploading a file having 0B as quota
Given using dav path "remote.php/dav"
And As an "admin"
And user "user0" exists
And user "user0" has a quota of "0 B"
And As an "user0"
When User "user0" uploads file "data/textfile.txt" to "/files/user0/asdf.txt"
Then the HTTP status code should be "507"

Scenario: Uploading a file as recipient using webdav new endpoint having quota
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this scenario is still valid - it does not match this pr.

The scenario should look like:

  • user0 has 0B quota
  • upload of file with 10B fails with 207

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

507 is the expected code isn't?

Given using dav path "remote.php/dav"
And As an "admin"
And user "user0" exists
And user "user1" exists
And user "user0" has a quota of "10 MB"
And user "user1" has a quota of "10 MB"
And As an "user1"
And user "user1" created a folder "/testquota"
And as "user1" creating a share with
| path | testquota |
| shareType | 0 |
| permissions | 31 |
| shareWith | user0 |
And As an "user0"
When User "user0" uploads file "data/textfile.txt" to "/files/user0/testquota/asdf.txt"
Then the HTTP status code should be "201"