Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorSujith H <sharidasan@owncloud.com>2017-03-09 12:54:33 +0300
committerMorris Jobke <hey@morrisjobke.de>2017-03-21 03:29:21 +0300
commitf654f295329692f537462af51eaea7983af9fdb7 (patch)
treebe62cfdc98fec5c4c5ec480e5ad01ca96f9fcd38 /build
parent3b07731099fb725df9e15ebd762a685f130114ad (diff)
Providing --path option to transfer-ownership
This will help user to selectively move the folders specified using --path option, instead of moving entire folder under files directory. Signed-off-by: Sujith H <sharidasan@owncloud.com> Update the integration test for transfer-ownership Update the integration test for transfer-ownership as the new option --path is introduced in the command. Signed-off-by: Sujith H <sharidasan@owncloud.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/CommandLineContext.php14
-rw-r--r--build/integration/features/transfer-ownership.feature107
2 files changed, 121 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/CommandLineContext.php b/build/integration/features/bootstrap/CommandLineContext.php
index 95f492a62db..c8253966cdb 100644
--- a/build/integration/features/bootstrap/CommandLineContext.php
+++ b/build/integration/features/bootstrap/CommandLineContext.php
@@ -89,6 +89,20 @@ class CommandLineContext implements \Behat\Behat\Context\Context {
}
/**
+ * @When /^transfering ownership of path "([^"]+)" from "([^"]+)" to "([^"]+)"/
+ */
+ public function transferingOwnershipPath($path, $user1, $user2) {
+ $path = '--path=' . $path;
+ if($this->runOcc(['files:transfer-ownership', $path, $user1, $user2]) === 0) {
+ $this->lastTransferPath = $this->findLastTransferFolderForUser($user1, $user2);
+ } else {
+ // failure
+ $this->lastTransferPath = null;
+ }
+ }
+
+
+ /**
* @When /^using received transfer folder of "([^"]+)" as dav path$/
*/
public function usingTransferFolderAsDavPath($user) {
diff --git a/build/integration/features/transfer-ownership.feature b/build/integration/features/transfer-ownership.feature
index 92361f70900..7990eac3280 100644
--- a/build/integration/features/transfer-ownership.feature
+++ b/build/integration/features/transfer-ownership.feature
@@ -117,3 +117,110 @@ Feature: transfer-ownership
Then the command error output contains the text "Unknown target user"
And the command failed with exit code 1
+ Scenario: transfering ownership of a folder
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" created a folder "/test"
+ And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
+ When transfering ownership of path "test" from "user0" to "user1"
+ And the command was successful
+ And As an "user1"
+ And using received transfer folder of "user1" as dav path
+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
+
+ Scenario: transfering ownership of file shares
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And User "user0" created a folder "/test"
+ And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
+ And file "/test/somefile.txt" of user "user0" is shared with user "user2" with permissions 19
+ When transfering ownership of path "test" from "user0" to "user1"
+ And the command was successful
+ And As an "user2"
+ Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
+
+ Scenario: transfering ownership of folder shared with third user
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And User "user0" created a folder "/test"
+ And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
+ And folder "/test" of user "user0" is shared with user "user2" with permissions 31
+ When transfering ownership of path "test" from "user0" to "user1"
+ And the command was successful
+ And As an "user2"
+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
+
+ Scenario: transfering ownership of folder shared with transfer recipient
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" created a folder "/test"
+ And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
+ And folder "/test" of user "user0" is shared with user "user1" with permissions 31
+ When transfering ownership of path "test" from "user0" to "user1"
+ And the command was successful
+ And As an "user1"
+ Then as "user1" the folder "/test" does not exist
+ And using received transfer folder of "user1" as dav path
+ And Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
+
+ Scenario: transfering ownership of folder doubly shared with third user
+ Given group "group1" exists
+ And user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And user "user2" belongs to group "group1"
+ And User "user0" created a folder "/test"
+ And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
+ And folder "/test" of user "user0" is shared with group "group1" with permissions 31
+ And folder "/test" of user "user0" is shared with user "user2" with permissions 31
+ When transfering ownership of path "test" from "user0" to "user1"
+ And the command was successful
+ And As an "user2"
+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
+
+ Scenario: transfering ownership does not transfer received shares
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And User "user2" created a folder "/test"
+ And User "user0" created a folder "/sub"
+ And folder "/test" of user "user2" is shared with user "user0" with permissions 31
+ And User "user0" moved folder "/test" to "/sub/test"
+ When transfering ownership of path "sub" from "user0" to "user1"
+ And the command was successful
+ And As an "user1"
+ And using received transfer folder of "user1" as dav path
+ Then as "user1" the folder "/sub/test" does not exist
+
+ Scenario: transfering ownership does not transfer external storage
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" created a folder "/sub"
+ When transfering ownership of path "sub" from "user0" to "user1"
+ And the command was successful
+ And As an "user1"
+ And using received transfer folder of "user1" as dav path
+ Then as "user1" the folder "/local_storage" does not exist
+
+ Scenario: transfering ownership fails with invalid source user
+ Given user "user0" exists
+ And User "user0" created a folder "/sub"
+ When transfering ownership of path "sub" from "invalid_user" to "user0"
+ Then the command error output contains the text "Unknown source user"
+ And the command failed with exit code 1
+
+ Scenario: transfering ownership fails with invalid target user
+ Given user "user0" exists
+ And User "user0" created a folder "/sub"
+ When transfering ownership of path "sub" from "user0" to "invalid_user"
+ Then the command error output contains the text "Unknown target user"
+ And the command failed with exit code 1
+
+ Scenario: transfering ownership fails with invalid path
+ Given user "user0" exists
+ And user "user1" exists
+ When transfering ownership of path "test" from "user0" to "user1"
+ Then the command error output contains the text "Unknown target user"
+ And the command failed with exit code 1