1
0

transfer-ownership.feature 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. # SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: transfer-ownership
  5. Scenario: transferring ownership of a file
  6. Given user "user0" exists
  7. And user "user1" exists
  8. And User "user0" uploads file "data/textfile.txt" to "/somefile.txt"
  9. When transferring ownership from "user0" to "user1"
  10. And the command was successful
  11. And As an "user1"
  12. And using received transfer folder of "user1" as dav path
  13. Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
  14. And using old dav path
  15. And as "user0" the file "/somefile.txt" does not exist
  16. And using received transfer folder of "user1" as dav path
  17. And as "user1" the file "/somefile.txt" exists
  18. Scenario: transferring ownership of a folder
  19. Given user "user0" exists
  20. And user "user1" exists
  21. And User "user0" created a folder "/test"
  22. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  23. When transferring ownership from "user0" to "user1"
  24. And the command was successful
  25. And As an "user1"
  26. And using received transfer folder of "user1" as dav path
  27. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  28. And using old dav path
  29. And as "user0" the folder "/test" does not exist
  30. And using received transfer folder of "user1" as dav path
  31. And as "user1" the folder "/test" exists
  32. Scenario: transferring ownership from user with risky display name
  33. Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists
  34. And user "user1" exists
  35. And User "user0" created a folder "/test"
  36. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  37. When transferring ownership from "user0" to "user1"
  38. And the command was successful
  39. And As an "user1"
  40. And using received transfer folder of "user1" as dav path
  41. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  42. And transfer folder name contains "Transferred from user0 -risky- ヂspḷay -na|-|e- on"
  43. And using old dav path
  44. And as "user0" the folder "/test" does not exist
  45. And using received transfer folder of "user1" as dav path
  46. And as "user1" the folder "/test" exists
  47. Scenario: transferring ownership of file shares
  48. Given user "user0" exists
  49. And user "user1" exists
  50. And user "user2" exists
  51. And User "user0" uploads file "data/textfile.txt" to "/somefile.txt"
  52. And file "/somefile.txt" of user "user0" is shared with user "user2" with permissions 19
  53. And user "user2" accepts last share
  54. When transferring ownership from "user0" to "user1"
  55. And the command was successful
  56. And As an "user2"
  57. Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
  58. And using old dav path
  59. And as "user0" the file "/somefile.txt" does not exist
  60. And using received transfer folder of "user1" as dav path
  61. And as "user1" the file "/somefile.txt" exists
  62. And As an "user1"
  63. And Getting info of last share
  64. And the OCS status code should be "100"
  65. And Share fields of last share match with
  66. | uid_owner | user1 |
  67. | uid_file_owner | user1 |
  68. | share_with | user2 |
  69. Scenario: transferring ownership of folder shared with third user
  70. Given user "user0" exists
  71. And user "user1" exists
  72. And user "user2" exists
  73. And User "user0" created a folder "/test"
  74. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  75. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  76. And user "user2" accepts last share
  77. When transferring ownership from "user0" to "user1"
  78. And the command was successful
  79. And As an "user2"
  80. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  81. And using old dav path
  82. And as "user0" the folder "/test" does not exist
  83. And using received transfer folder of "user1" as dav path
  84. And as "user1" the folder "/test" exists
  85. And As an "user1"
  86. And Getting info of last share
  87. And the OCS status code should be "100"
  88. And Share fields of last share match with
  89. | uid_owner | user1 |
  90. | uid_file_owner | user1 |
  91. | share_with | user2 |
  92. Scenario: transferring ownership of folder shared with transfer recipient
  93. Given user "user0" exists
  94. And user "user1" exists
  95. And User "user0" created a folder "/test"
  96. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  97. And folder "/test" of user "user0" is shared with user "user1" with permissions 31
  98. And user "user1" accepts last share
  99. When transferring ownership from "user0" to "user1"
  100. And the command was successful
  101. And As an "user1"
  102. Then as "user1" the folder "/test" does not exist
  103. And using received transfer folder of "user1" as dav path
  104. And Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  105. And using old dav path
  106. And as "user0" the folder "/test" does not exist
  107. And using received transfer folder of "user1" as dav path
  108. And as "user1" the folder "/test" exists
  109. And Getting info of last share
  110. And the OCS status code should be "404"
  111. Scenario: transferring ownership of folder doubly shared with third user
  112. Given group "group1" exists
  113. And user "user0" exists
  114. And user "user1" exists
  115. And user "user2" exists
  116. And user "user2" belongs to group "group1"
  117. And User "user0" created a folder "/test"
  118. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  119. And folder "/test" of user "user0" is shared with group "group1" with permissions 31
  120. And user "user2" accepts last share
  121. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  122. And user "user2" accepts last share
  123. When transferring ownership from "user0" to "user1"
  124. And the command was successful
  125. And As an "user2"
  126. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  127. And using old dav path
  128. And as "user0" the folder "/test" does not exist
  129. And using received transfer folder of "user1" as dav path
  130. And as "user1" the folder "/test" exists
  131. And As an "user1"
  132. And Getting info of last share
  133. And the OCS status code should be "100"
  134. And Share fields of last share match with
  135. | uid_owner | user1 |
  136. | uid_file_owner | user1 |
  137. | share_with | user2 |
  138. Scenario: transferring ownership of file shares to user with the same id as the group
  139. Given user "user0" exists
  140. And user "test" exists
  141. And user "user2" exists
  142. And group "test" exists
  143. And user "user2" belongs to group "test"
  144. And User "user0" uploads file "data/textfile.txt" to "/somefile.txt"
  145. And file "/somefile.txt" of user "user0" is shared with group "test"
  146. And user "user2" accepts last share
  147. When transferring ownership from "user0" to "test"
  148. And the command was successful
  149. And As an "user2"
  150. Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
  151. And using old dav path
  152. And as "user0" the file "/somefile.txt" does not exist
  153. And using received transfer folder of "user1" as dav path
  154. And as "test" the file "/somefile.txt" exists
  155. And As an "test"
  156. And Getting info of last share
  157. And the OCS status code should be "100"
  158. And Share fields of last share match with
  159. | uid_owner | test |
  160. | uid_file_owner | test |
  161. | share_with | test |
  162. Scenario: transferring ownership of folder reshared with another user
  163. Given user "user0" exists
  164. And user "user1" exists
  165. And user "user2" exists
  166. And user "user3" exists
  167. And User "user3" created a folder "/test"
  168. And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
  169. And folder "/test" of user "user3" is shared with user "user0" with permissions 31
  170. And user "user0" accepts last share
  171. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  172. And user "user2" accepts last share
  173. When transferring ownership from "user0" to "user1"
  174. And the command was successful
  175. And As an "user2"
  176. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  177. And using old dav path
  178. And as "user0" the folder "/test" exists
  179. And using received transfer folder of "user1" as dav path
  180. And as "user1" the folder "/test" does not exist
  181. And As an "user0"
  182. And Getting info of last share
  183. And the OCS status code should be "100"
  184. And Share fields of last share match with
  185. | uid_owner | user0 |
  186. | uid_file_owner | user3 |
  187. | share_with | user2 |
  188. Scenario: transferring ownership of folder reshared with group to a user in the group
  189. Given user "user0" exists
  190. And user "user1" exists
  191. And user "user2" exists
  192. And user "user3" exists
  193. And group "group1" exists
  194. And user "user1" belongs to group "group1"
  195. And User "user3" created a folder "/test"
  196. And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
  197. And folder "/test" of user "user3" is shared with user "user0" with permissions 31
  198. And user "user0" accepts last share
  199. And folder "/test" of user "user0" is shared with group "group1" with permissions 31
  200. And user "user1" accepts last share
  201. When transferring ownership from "user0" to "user1"
  202. And the command was successful
  203. And As an "user1"
  204. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  205. And using old dav path
  206. And as "user0" the folder "/test" exists
  207. And using received transfer folder of "user1" as dav path
  208. And as "user1" the folder "/test" does not exist
  209. And As an "user1"
  210. And Getting info of last share
  211. And the OCS status code should be "100"
  212. And Share fields of last share match with
  213. | uid_owner | user1 |
  214. | uid_file_owner | user3 |
  215. | share_with | group1 |
  216. Scenario: transferring ownership of folder reshared with group to a user not in the group
  217. Given user "user0" exists
  218. And user "user1" exists
  219. And user "user2" exists
  220. And user "user3" exists
  221. And group "group1" exists
  222. And user "user2" belongs to group "group1"
  223. And User "user3" created a folder "/test"
  224. And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
  225. And folder "/test" of user "user3" is shared with user "user0" with permissions 31
  226. And user "user0" accepts last share
  227. And folder "/test" of user "user0" is shared with group "group1" with permissions 31
  228. And user "user2" accepts last share
  229. When transferring ownership from "user0" to "user1"
  230. And the command was successful
  231. And As an "user2"
  232. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  233. And using old dav path
  234. And as "user0" the folder "/test" exists
  235. And using received transfer folder of "user1" as dav path
  236. And as "user1" the folder "/test" does not exist
  237. And As an "user0"
  238. And Getting info of last share
  239. And the OCS status code should be "100"
  240. And Share fields of last share match with
  241. | uid_owner | user0 |
  242. | uid_file_owner | user3 |
  243. | share_with | group1 |
  244. Scenario: transferring ownership does not transfer received shares
  245. Given user "user0" exists
  246. And user "user1" exists
  247. And user "user2" exists
  248. And User "user2" created a folder "/test"
  249. And folder "/test" of user "user2" is shared with user "user0" with permissions 31
  250. And user "user0" accepts last share
  251. When transferring ownership from "user0" to "user1"
  252. And the command was successful
  253. And As an "user1"
  254. And using received transfer folder of "user1" as dav path
  255. Then as "user1" the folder "/test" does not exist
  256. And using old dav path
  257. And as "user0" the folder "/test" exists
  258. And As an "user2"
  259. And Getting info of last share
  260. And the OCS status code should be "100"
  261. And Share fields of last share match with
  262. | uid_owner | user2 |
  263. | uid_file_owner | user2 |
  264. | share_with | user0 |
  265. @local_storage
  266. Scenario: transferring ownership does not transfer external storage
  267. Given user "user0" exists
  268. And user "user1" exists
  269. When transferring ownership from "user0" to "user1"
  270. And the command was successful
  271. And As an "user1"
  272. And using received transfer folder of "user1" as dav path
  273. Then as "user1" the folder "/local_storage" does not exist
  274. Scenario: transferring ownership does not fail with shared trashed files
  275. Given user "user0" exists
  276. And user "user1" exists
  277. And user "user2" exists
  278. And User "user0" created a folder "/sub"
  279. And User "user0" created a folder "/sub/test"
  280. And folder "/sub/test" of user "user0" is shared with user "user2" with permissions 31
  281. And user "user2" accepts last share
  282. And User "user0" deletes folder "/sub"
  283. When transferring ownership from "user0" to "user1"
  284. Then the command was successful
  285. Scenario: transferring ownership fails with invalid source user
  286. Given user "user0" exists
  287. When transferring ownership from "invalid_user" to "user0"
  288. Then the command output contains the text "Unknown source user"
  289. And the command failed with exit code 1
  290. Scenario: transferring ownership fails with invalid target user
  291. Given user "user0" exists
  292. When transferring ownership from "user0" to "invalid_user"
  293. Then the command output contains the text "Unknown destination user invalid_user"
  294. And the command failed with exit code 1
  295. Scenario: transferring ownership of a file
  296. Given user "user0" exists
  297. And user "user1" exists
  298. And User "user0" uploads file "data/textfile.txt" to "/somefile.txt"
  299. When transferring ownership of path "somefile.txt" from "user0" to "user1"
  300. And the command was successful
  301. And As an "user1"
  302. And using received transfer folder of "user1" as dav path
  303. Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
  304. And using old dav path
  305. And as "user0" the file "/somefile.txt" does not exist
  306. And using received transfer folder of "user1" as dav path
  307. And as "user1" the file "/somefile.txt" exists
  308. Scenario: transferring ownership of a folder
  309. Given user "user0" exists
  310. And user "user1" exists
  311. And User "user0" created a folder "/test"
  312. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  313. When transferring ownership of path "test" from "user0" to "user1"
  314. And the command was successful
  315. And As an "user1"
  316. And using received transfer folder of "user1" as dav path
  317. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  318. And using old dav path
  319. And as "user0" the folder "/test" does not exist
  320. And using received transfer folder of "user1" as dav path
  321. And as "user1" the folder "/test" exists
  322. Scenario: transferring ownership from user with risky display name
  323. Given user "user0" with displayname "user0 \"risky\"? ヂspḷay 'na|\/|e':.#" exists
  324. And user "user1" exists
  325. And User "user0" created a folder "/test"
  326. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  327. When transferring ownership of path "test" from "user0" to "user1"
  328. And the command was successful
  329. And As an "user1"
  330. And using received transfer folder of "user1" as dav path
  331. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  332. And transfer folder name contains "Transferred from user0 -risky- ヂspḷay -na|-|e- on"
  333. And using old dav path
  334. And as "user0" the folder "/test" does not exist
  335. And using received transfer folder of "user1" as dav path
  336. And as "user1" the folder "/test" exists
  337. Scenario: transferring ownership of path does not affect other files
  338. Given user "user0" exists
  339. And user "user1" exists
  340. And User "user0" created a folder "/test"
  341. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  342. And User "user0" created a folder "/test2"
  343. And User "user0" uploads file "data/textfile.txt" to "/test2/somefile.txt"
  344. When transferring ownership of path "test" from "user0" to "user1"
  345. And the command was successful
  346. And As an "user1"
  347. And using received transfer folder of "user1" as dav path
  348. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  349. And using old dav path
  350. And as "user0" the folder "/test" does not exist
  351. And as "user0" the folder "/test2" exists
  352. And as "user0" the file "/test2/somefile.txt" exists
  353. And using received transfer folder of "user1" as dav path
  354. And as "user1" the folder "/test" exists
  355. And as "user1" the folder "/test2" does not exist
  356. Scenario: transferring ownership of path does not affect other shares
  357. Given user "user0" exists
  358. And user "user1" exists
  359. And User "user0" created a folder "/test"
  360. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  361. And User "user0" created a folder "/test2"
  362. And User "user0" uploads file "data/textfile.txt" to "/test2/sharedfile.txt"
  363. And file "/test2/sharedfile.txt" of user "user0" is shared with user "user1" with permissions 19
  364. And user "user1" accepts last share
  365. When transferring ownership of path "test" from "user0" to "user1"
  366. And the command was successful
  367. And As an "user1"
  368. And using received transfer folder of "user1" as dav path
  369. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  370. And using old dav path
  371. And as "user0" the folder "/test" does not exist
  372. And as "user0" the folder "/test2" exists
  373. And as "user0" the file "/test2/sharedfile.txt" exists
  374. And using received transfer folder of "user1" as dav path
  375. And as "user1" the folder "/test" exists
  376. And as "user1" the folder "/test2" does not exist
  377. And using old dav path
  378. And as "user1" the file "/sharedfile.txt" exists
  379. And As an "user1"
  380. And Getting info of last share
  381. And the OCS status code should be "100"
  382. And Share fields of last share match with
  383. | uid_owner | user0 |
  384. | uid_file_owner | user0 |
  385. | share_with | user1 |
  386. Scenario: transferring ownership of file shares
  387. Given user "user0" exists
  388. And user "user1" exists
  389. And user "user2" exists
  390. And User "user0" created a folder "/test"
  391. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  392. And file "/test/somefile.txt" of user "user0" is shared with user "user2" with permissions 19
  393. And user "user2" accepts last share
  394. When transferring ownership of path "test" from "user0" to "user1"
  395. And the command was successful
  396. And As an "user2"
  397. Then Downloaded content when downloading file "/somefile.txt" with range "bytes=0-6" should be "This is"
  398. And using old dav path
  399. And as "user0" the folder "/test" does not exist
  400. And using received transfer folder of "user1" as dav path
  401. And as "user1" the folder "/test" exists
  402. And As an "user1"
  403. And Getting info of last share
  404. And the OCS status code should be "100"
  405. And Share fields of last share match with
  406. | uid_owner | user1 |
  407. | uid_file_owner | user1 |
  408. | share_with | user2 |
  409. Scenario: transferring ownership of folder shared with third user
  410. Given user "user0" exists
  411. And user "user1" exists
  412. And user "user2" exists
  413. And User "user0" created a folder "/test"
  414. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  415. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  416. And user "user2" accepts last share
  417. When transferring ownership of path "test" from "user0" to "user1"
  418. And the command was successful
  419. And As an "user2"
  420. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  421. And using old dav path
  422. And as "user0" the folder "/test" does not exist
  423. And using received transfer folder of "user1" as dav path
  424. And as "user1" the folder "/test" exists
  425. And As an "user1"
  426. And Getting info of last share
  427. And the OCS status code should be "100"
  428. And Share fields of last share match with
  429. | uid_owner | user1 |
  430. | uid_file_owner | user1 |
  431. | share_with | user2 |
  432. Scenario: transferring ownership of folder shared with transfer recipient
  433. Given user "user0" exists
  434. And user "user1" exists
  435. And User "user0" created a folder "/test"
  436. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  437. And folder "/test" of user "user0" is shared with user "user1" with permissions 31
  438. And user "user1" accepts last share
  439. When transferring ownership of path "test" from "user0" to "user1"
  440. And the command was successful
  441. And As an "user1"
  442. Then as "user1" the folder "/test" does not exist
  443. And using received transfer folder of "user1" as dav path
  444. And Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  445. And using old dav path
  446. And as "user0" the folder "/test" does not exist
  447. And using received transfer folder of "user1" as dav path
  448. And as "user1" the folder "/test" exists
  449. And Getting info of last share
  450. And the OCS status code should be "404"
  451. Scenario: transferring ownership of folder doubly shared with third user
  452. Given group "group1" exists
  453. And user "user0" exists
  454. And user "user1" exists
  455. And user "user2" exists
  456. And user "user2" belongs to group "group1"
  457. And User "user0" created a folder "/test"
  458. And User "user0" uploads file "data/textfile.txt" to "/test/somefile.txt"
  459. And folder "/test" of user "user0" is shared with group "group1" with permissions 31
  460. And user "user2" accepts last share
  461. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  462. And user "user2" accepts last share
  463. When transferring ownership of path "test" from "user0" to "user1"
  464. And the command was successful
  465. And As an "user2"
  466. Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
  467. And using old dav path
  468. And as "user0" the folder "/test" does not exist
  469. And using received transfer folder of "user1" as dav path
  470. And as "user1" the folder "/test" exists
  471. And As an "user1"
  472. And Getting info of last share
  473. And the OCS status code should be "100"
  474. And Share fields of last share match with
  475. | uid_owner | user1 |
  476. | uid_file_owner | user1 |
  477. | share_with | user2 |
  478. Scenario: transferring ownership of path fails for reshares
  479. Given user "user0" exists
  480. And user "user1" exists
  481. And user "user2" exists
  482. And user "user3" exists
  483. And User "user3" created a folder "/test"
  484. And User "user3" uploads file "data/textfile.txt" to "/test/somefile.txt"
  485. And folder "/test" of user "user3" is shared with user "user0" with permissions 31
  486. And user "user0" accepts last share
  487. And folder "/test" of user "user0" is shared with user "user2" with permissions 31
  488. And user "user2" accepts last share
  489. When transferring ownership of path "test" from "user0" to "user1"
  490. Then the command failed with exit code 1
  491. And the command output contains the text "Could not transfer files."
  492. Scenario: transferring ownership does not transfer received shares
  493. Given user "user0" exists
  494. And user "user1" exists
  495. And user "user2" exists
  496. And User "user2" created a folder "/test"
  497. And User "user0" created a folder "/sub"
  498. And folder "/test" of user "user2" is shared with user "user0" with permissions 31
  499. And user "user0" accepts last share
  500. And User "user0" moved folder "/test" to "/sub/test"
  501. When transferring ownership of path "sub" from "user0" to "user1"
  502. And the command was successful
  503. And As an "user1"
  504. And using received transfer folder of "user1" as dav path
  505. Then as "user1" the folder "/sub" exists
  506. And as "user1" the folder "/sub/test" does not exist
  507. And using old dav path
  508. And as "user0" the folder "/sub" does not exist
  509. And Getting info of last share
  510. And the OCS status code should be "404"
  511. Scenario: transferring ownership transfers received shares into subdir when requested
  512. Given user "user0" exists
  513. And user "user1" exists
  514. And user "user2" exists
  515. And User "user2" created a folder "/transfer-share"
  516. And User "user2" created a folder "/do-not-transfer"
  517. And User "user0" created a folder "/sub"
  518. And folder "/transfer-share" of user "user2" is shared with user "user0" with permissions 31
  519. And user "user0" accepts last share
  520. And User "user0" moved folder "/transfer-share" to "/sub/transfer-share"
  521. And folder "/do-not-transfer" of user "user2" is shared with user "user0" with permissions 31
  522. And user "user0" accepts last share
  523. When transferring ownership of path "sub" from "user0" to "user1" with received shares
  524. And the command was successful
  525. And As an "user1"
  526. And using received transfer folder of "user1" as dav path
  527. Then as "user1" the folder "/sub" exists
  528. And as "user1" the folder "/do-not-transfer" does not exist
  529. And as "user1" the folder "/sub/do-not-transfer" does not exist
  530. And as "user1" the folder "/sub/transfer-share" exists
  531. And using old dav path
  532. And as "user1" the folder "/transfer-share" does not exist
  533. And as "user1" the folder "/do-not-transfer" does not exist
  534. And using old dav path
  535. And as "user0" the folder "/sub" does not exist
  536. And as "user0" the folder "/do-not-transfer" exists
  537. And Getting info of last share
  538. And the OCS status code should be "404"
  539. Scenario: transferring ownership does not transfer external storage
  540. Given user "user0" exists
  541. And user "user1" exists
  542. And User "user0" created a folder "/sub"
  543. When transferring ownership of path "sub" from "user0" to "user1"
  544. And the command was successful
  545. And As an "user1"
  546. And using received transfer folder of "user1" as dav path
  547. Then as "user1" the folder "/local_storage" does not exist
  548. Scenario: transferring ownership fails with invalid source user
  549. Given user "user0" exists
  550. And User "user0" created a folder "/sub"
  551. When transferring ownership of path "sub" from "invalid_user" to "user0"
  552. Then the command output contains the text "Unknown source user"
  553. And the command failed with exit code 1
  554. Scenario: transferring ownership fails with invalid target user
  555. Given user "user0" exists
  556. And User "user0" created a folder "/sub"
  557. When transferring ownership of path "sub" from "user0" to "invalid_user"
  558. Then the command output contains the text "Unknown destination user invalid_user"
  559. And the command failed with exit code 1
  560. Scenario: transferring ownership fails with invalid path
  561. Given user "user0" exists
  562. And user "user1" exists
  563. When transferring ownership of path "test" from "user0" to "user1"
  564. Then the command output contains the text "Unknown path provided: test"
  565. And the command failed with exit code 1