@@ -9,6 +9,10 @@ Feature: transfer-ownership
99 And As an "user1"
1010 And using received transfer folder of "user1" as dav path
1111 Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
12+ And using old dav path
13+ And as "user0" the file "/somefile.txt" does not exist
14+ And using received transfer folder of "user1" as dav path
15+ And as "user1" the file "/somefile.txt" exists
1216
1317 Scenario : transferring ownership of a folder
1418 Given user "user0" exists
@@ -20,6 +24,10 @@ Feature: transfer-ownership
2024 And As an "user1"
2125 And using received transfer folder of "user1" as dav path
2226 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
27+ And using old dav path
28+ And as "user0" the folder "/test" does not exist
29+ And using received transfer folder of "user1" as dav path
30+ And as "user1" the folder "/test" exists
2331
2432 Scenario : transferring ownership of file shares
2533 Given user "user0" exists
@@ -32,6 +40,17 @@ Feature: transfer-ownership
3240 And the command was successful
3341 And As an "user2"
3442 Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
43+ And using old dav path
44+ And as "user0" the file "/somefile.txt" does not exist
45+ And using received transfer folder of "user1" as dav path
46+ And as "user1" the file "/somefile.txt" exists
47+ And As an "user1"
48+ And Getting info of last share
49+ And the OCS status code should be "100"
50+ And Share fields of last share match with
51+ | uid_owner | user1 |
52+ | uid_file_owner | user1 |
53+ | share_with | user2 |
3554
3655 Scenario : transferring ownership of folder shared with third user
3756 Given user "user0" exists
@@ -45,6 +64,17 @@ Feature: transfer-ownership
4564 And the command was successful
4665 And As an "user2"
4766 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
67+ And using old dav path
68+ And as "user0" the folder "/test" does not exist
69+ And using received transfer folder of "user1" as dav path
70+ And as "user1" the folder "/test" exists
71+ And As an "user1"
72+ And Getting info of last share
73+ And the OCS status code should be "100"
74+ And Share fields of last share match with
75+ | uid_owner | user1 |
76+ | uid_file_owner | user1 |
77+ | share_with | user2 |
4878
4979 Scenario : transferring ownership of folder shared with transfer recipient
5080 Given user "user0" exists
@@ -59,6 +89,12 @@ Feature: transfer-ownership
5989 Then as "user1" the folder "/test" does not exist
6090 And using received transfer folder of "user1" as dav path
6191 And Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
92+ And using old dav path
93+ And as "user0" the folder "/test" does not exist
94+ And using received transfer folder of "user1" as dav path
95+ And as "user1" the folder "/test" exists
96+ And Getting info of last share
97+ And the OCS status code should be "404"
6298
6399 Scenario : transferring ownership of folder doubly shared with third user
64100 Given group "group1" exists
@@ -76,6 +112,17 @@ Feature: transfer-ownership
76112 And the command was successful
77113 And As an "user2"
78114 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
115+ And using old dav path
116+ And as "user0" the folder "/test" does not exist
117+ And using received transfer folder of "user1" as dav path
118+ And as "user1" the folder "/test" exists
119+ And As an "user1"
120+ And Getting info of last share
121+ And the OCS status code should be "100"
122+ And Share fields of last share match with
123+ | uid_owner | user1 |
124+ | uid_file_owner | user1 |
125+ | share_with | user2 |
79126
80127 Scenario : transferring ownership of file shares to user with the same id as the group
81128 Given user "user0" exists
@@ -90,6 +137,102 @@ Feature: transfer-ownership
90137 And the command was successful
91138 And As an "user2"
92139 Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
140+ And using old dav path
141+ And as "user0" the file "/somefile.txt" does not exist
142+ And using received transfer folder of "user1" as dav path
143+ And as "test" the file "/somefile.txt" exists
144+ And As an "test"
145+ And Getting info of last share
146+ And the OCS status code should be "100"
147+ And Share fields of last share match with
148+ | uid_owner | test |
149+ | uid_file_owner | test |
150+ | share_with | test |
151+
152+ Scenario : transferring ownership of folder reshared with another user
153+ Given user "user0" exists
154+ And user "user1" exists
155+ And user "user2" exists
156+ And user "user3" exists
157+ And User "user3" created a folder "/test"
158+ And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
159+ And folder "/test" of user "user3" is shared with user "user0" with permissions 31
160+ And user "user0" accepts last share
161+ And folder "/test" of user "user0" is shared with user "user2" with permissions 31
162+ And user "user2" accepts last share
163+ When transferring ownership from "user0" to "user1"
164+ And the command was successful
165+ And As an "user2"
166+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
167+ And using old dav path
168+ And as "user0" the folder "/test" exists
169+ And using received transfer folder of "user1" as dav path
170+ And as "user1" the folder "/test" does not exist
171+ And As an "user0"
172+ And Getting info of last share
173+ And the OCS status code should be "100"
174+ And Share fields of last share match with
175+ | uid_owner | user0 |
176+ | uid_file_owner | user3 |
177+ | share_with | user2 |
178+
179+ Scenario : transferring ownership of folder reshared with group to a user in the group
180+ Given user "user0" exists
181+ And user "user1" exists
182+ And user "user2" exists
183+ And user "user3" exists
184+ And group "group1" exists
185+ And user "user1" belongs to group "group1"
186+ And User "user3" created a folder "/test"
187+ And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
188+ And folder "/test" of user "user3" is shared with user "user0" with permissions 31
189+ And user "user0" accepts last share
190+ And folder "/test" of user "user0" is shared with group "group1" with permissions 31
191+ And user "user1" accepts last share
192+ When transferring ownership from "user0" to "user1"
193+ And the command was successful
194+ And As an "user1"
195+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
196+ And using old dav path
197+ And as "user0" the folder "/test" exists
198+ And using received transfer folder of "user1" as dav path
199+ And as "user1" the folder "/test" does not exist
200+ And As an "user1"
201+ And Getting info of last share
202+ And the OCS status code should be "100"
203+ And Share fields of last share match with
204+ | uid_owner | user1 |
205+ | uid_file_owner | user3 |
206+ | share_with | group1 |
207+
208+ Scenario : transferring ownership of folder reshared with group to a user not in the group
209+ Given user "user0" exists
210+ And user "user1" exists
211+ And user "user2" exists
212+ And user "user3" exists
213+ And group "group1" exists
214+ And user "user2" belongs to group "group1"
215+ And User "user3" created a folder "/test"
216+ And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
217+ And folder "/test" of user "user3" is shared with user "user0" with permissions 31
218+ And user "user0" accepts last share
219+ And folder "/test" of user "user0" is shared with group "group1" with permissions 31
220+ And user "user2" accepts last share
221+ When transferring ownership from "user0" to "user1"
222+ And the command was successful
223+ And As an "user2"
224+ Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
225+ And using old dav path
226+ And as "user0" the folder "/test" exists
227+ And using received transfer folder of "user1" as dav path
228+ And as "user1" the folder "/test" does not exist
229+ And As an "user0"
230+ And Getting info of last share
231+ And the OCS status code should be "100"
232+ And Share fields of last share match with
233+ | uid_owner | user0 |
234+ | uid_file_owner | user3 |
235+ | share_with | group1 |
93236
94237 Scenario : transferring ownership does not transfer received shares
95238 Given user "user0" exists
@@ -103,6 +246,15 @@ Feature: transfer-ownership
103246 And As an "user1"
104247 And using received transfer folder of "user1" as dav path
105248 Then as "user1" the folder "/test" does not exist
249+ And using old dav path
250+ And as "user0" the folder "/test" exists
251+ And As an "user2"
252+ And Getting info of last share
253+ And the OCS status code should be "100"
254+ And Share fields of last share match with
255+ | uid_owner | user2 |
256+ | uid_file_owner | user2 |
257+ | share_with | user0 |
106258
107259 @local_storage
108260 Scenario : transferring ownership does not transfer external storage
@@ -148,6 +300,10 @@ Feature: transfer-ownership
148300 And As an "user1"
149301 And using received transfer folder of "user1" as dav path
150302 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
303+ And using old dav path
304+ And as "user0" the folder "/test" does not exist
305+ And using received transfer folder of "user1" as dav path
306+ And as "user1" the folder "/test" exists
151307
152308 Scenario : transferring ownership of file shares
153309 Given user "user0" exists
@@ -161,6 +317,17 @@ Feature: transfer-ownership
161317 And the command was successful
162318 And As an "user2"
163319 Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
320+ And using old dav path
321+ And as "user0" the folder "/test" does not exist
322+ And using received transfer folder of "user1" as dav path
323+ And as "user1" the folder "/test" exists
324+ And As an "user1"
325+ And Getting info of last share
326+ And the OCS status code should be "100"
327+ And Share fields of last share match with
328+ | uid_owner | user1 |
329+ | uid_file_owner | user1 |
330+ | share_with | user2 |
164331
165332 Scenario : transferring ownership of folder shared with third user
166333 Given user "user0" exists
@@ -174,6 +341,17 @@ Feature: transfer-ownership
174341 And the command was successful
175342 And As an "user2"
176343 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
344+ And using old dav path
345+ And as "user0" the folder "/test" does not exist
346+ And using received transfer folder of "user1" as dav path
347+ And as "user1" the folder "/test" exists
348+ And As an "user1"
349+ And Getting info of last share
350+ And the OCS status code should be "100"
351+ And Share fields of last share match with
352+ | uid_owner | user1 |
353+ | uid_file_owner | user1 |
354+ | share_with | user2 |
177355
178356 Scenario : transferring ownership of folder shared with transfer recipient
179357 Given user "user0" exists
@@ -188,6 +366,12 @@ Feature: transfer-ownership
188366 Then as "user1" the folder "/test" does not exist
189367 And using received transfer folder of "user1" as dav path
190368 And Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
369+ And using old dav path
370+ And as "user0" the folder "/test" does not exist
371+ And using received transfer folder of "user1" as dav path
372+ And as "user1" the folder "/test" exists
373+ And Getting info of last share
374+ And the OCS status code should be "404"
191375
192376 Scenario : transferring ownership of folder doubly shared with third user
193377 Given group "group1" exists
@@ -205,6 +389,32 @@ Feature: transfer-ownership
205389 And the command was successful
206390 And As an "user2"
207391 Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
392+ And using old dav path
393+ And as "user0" the folder "/test" does not exist
394+ And using received transfer folder of "user1" as dav path
395+ And as "user1" the folder "/test" exists
396+ And As an "user1"
397+ And Getting info of last share
398+ And the OCS status code should be "100"
399+ And Share fields of last share match with
400+ | uid_owner | user1 |
401+ | uid_file_owner | user1 |
402+ | share_with | user2 |
403+
404+ Scenario : transferring ownership of path fails for reshares
405+ Given user "user0" exists
406+ And user "user1" exists
407+ And user "user2" exists
408+ And user "user3" exists
409+ And User "user3" created a folder "/test"
410+ And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
411+ And folder "/test" of user "user3" is shared with user "user0" with permissions 31
412+ And user "user0" accepts last share
413+ And folder "/test" of user "user0" is shared with user "user2" with permissions 31
414+ And user "user2" accepts last share
415+ When transferring ownership of path "test" from "user0" to "user1"
416+ Then the command failed with exit code 1
417+ And the command error output contains the text "Could not transfer files."
208418
209419 Scenario : transferring ownership does not transfer received shares
210420 Given user "user0" exists
@@ -219,7 +429,12 @@ Feature: transfer-ownership
219429 And the command was successful
220430 And As an "user1"
221431 And using received transfer folder of "user1" as dav path
222- Then as "user1" the folder "/sub/test" does not exist
432+ Then as "user1" the folder "/sub" exists
433+ And as "user1" the folder "/sub/test" does not exist
434+ And using old dav path
435+ And as "user0" the folder "/sub" does not exist
436+ And Getting info of last share
437+ And the OCS status code should be "404"
223438
224439 Scenario : transferring ownership does not transfer external storage
225440 Given user "user0" exists
0 commit comments