webdav-related.feature 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: webdav-related
  4. Background:
  5. Given using api version "1"
  6. Scenario: Unauthenticated call old dav path
  7. Given using old dav path
  8. When connecting to dav endpoint
  9. Then the HTTP status code should be "401"
  10. And there are no duplicate headers
  11. And The following headers should be set
  12. |WWW-Authenticate|Basic realm="Nextcloud", charset="UTF-8"|
  13. Scenario: Unauthenticated call new dav path
  14. Given using new dav path
  15. When connecting to dav endpoint
  16. Then the HTTP status code should be "401"
  17. And there are no duplicate headers
  18. And The following headers should be set
  19. |WWW-Authenticate|Basic realm="Nextcloud", charset="UTF-8"|
  20. Scenario: Moving a file
  21. Given using old dav path
  22. And As an "admin"
  23. And user "user0" exists
  24. And As an "user0"
  25. When User "user0" moves file "/welcome.txt" to "/FOLDER/welcome.txt"
  26. Then the HTTP status code should be "201"
  27. And Downloaded content when downloading file "/FOLDER/welcome.txt" with range "bytes=0-6" should be "Welcome"
  28. Scenario: Moving and overwriting a file old way
  29. Given using old dav path
  30. And As an "admin"
  31. And user "user0" exists
  32. And As an "user0"
  33. When User "user0" moves file "/welcome.txt" to "/textfile0.txt"
  34. Then the HTTP status code should be "204"
  35. And Downloaded content when downloading file "/textfile0.txt" with range "bytes=0-6" should be "Welcome"
  36. Scenario: Moving a file to a folder with no permissions
  37. Given using old dav path
  38. And As an "admin"
  39. And user "user0" exists
  40. And user "user1" exists
  41. And As an "user1"
  42. And user "user1" created a folder "/testshare"
  43. And as "user1" creating a share with
  44. | path | testshare |
  45. | shareType | 0 |
  46. | permissions | 1 |
  47. | shareWith | user0 |
  48. And user "user0" accepts last share
  49. And As an "user0"
  50. And User "user0" moves file "/textfile0.txt" to "/testshare/textfile0.txt"
  51. And the HTTP status code should be "403"
  52. When Downloading file "/testshare/textfile0.txt"
  53. Then the HTTP status code should be "404"
  54. Scenario: Moving a file to overwrite a file in a folder with no permissions
  55. Given using old dav path
  56. And As an "admin"
  57. And user "user0" exists
  58. And user "user1" exists
  59. And As an "user1"
  60. And user "user1" created a folder "/testshare"
  61. And as "user1" creating a share with
  62. | path | testshare |
  63. | shareType | 0 |
  64. | permissions | 1 |
  65. | shareWith | user0 |
  66. And user "user0" accepts last share
  67. And User "user1" copies file "/welcome.txt" to "/testshare/overwritethis.txt"
  68. And As an "user0"
  69. When User "user0" moves file "/textfile0.txt" to "/testshare/overwritethis.txt"
  70. Then the HTTP status code should be "403"
  71. And Downloaded content when downloading file "/testshare/overwritethis.txt" with range "bytes=0-6" should be "Welcome"
  72. Scenario: Copying a file
  73. Given using old dav path
  74. And As an "admin"
  75. And user "user0" exists
  76. And As an "user0"
  77. When User "user0" copies file "/welcome.txt" to "/FOLDER/welcome.txt"
  78. Then the HTTP status code should be "201"
  79. And Downloaded content when downloading file "/FOLDER/welcome.txt" with range "bytes=0-6" should be "Welcome"
  80. Scenario: Copying and overwriting a file
  81. Given using old dav path
  82. And As an "admin"
  83. And user "user0" exists
  84. And As an "user0"
  85. When User "user0" copies file "/welcome.txt" to "/textfile1.txt"
  86. Then the HTTP status code should be "204"
  87. And Downloaded content when downloading file "/textfile1.txt" with range "bytes=0-6" should be "Welcome"
  88. Scenario: Copying a file to a folder with no permissions
  89. Given using old dav path
  90. And As an "admin"
  91. And user "user0" exists
  92. And user "user1" exists
  93. And As an "user1"
  94. And user "user1" created a folder "/testshare"
  95. And as "user1" creating a share with
  96. | path | testshare |
  97. | shareType | 0 |
  98. | permissions | 1 |
  99. | shareWith | user0 |
  100. And user "user0" accepts last share
  101. And As an "user0"
  102. When User "user0" copies file "/textfile0.txt" to "/testshare/textfile0.txt"
  103. Then the HTTP status code should be "403"
  104. And Downloading file "/testshare/textfile0.txt"
  105. And the HTTP status code should be "404"
  106. Scenario: Copying a file to overwrite a file into a folder with no permissions
  107. Given using old dav path
  108. And As an "admin"
  109. And user "user0" exists
  110. And user "user1" exists
  111. And As an "user1"
  112. And user "user1" created a folder "/testshare"
  113. And as "user1" creating a share with
  114. | path | testshare |
  115. | shareType | 0 |
  116. | permissions | 1 |
  117. | shareWith | user0 |
  118. And user "user0" accepts last share
  119. And User "user1" copies file "/welcome.txt" to "/testshare/overwritethis.txt"
  120. And As an "user0"
  121. When User "user0" copies file "/textfile0.txt" to "/testshare/overwritethis.txt"
  122. Then the HTTP status code should be "403"
  123. And Downloaded content when downloading file "/testshare/overwritethis.txt" with range "bytes=0-6" should be "Welcome"
  124. Scenario: download a file with range
  125. Given using old dav path
  126. And As an "admin"
  127. When Downloading file "/welcome.txt" with range "bytes=52-78"
  128. Then Downloaded content should be "example file for developers"
  129. Scenario: Upload forbidden if quota is 0
  130. Given using old dav path
  131. And As an "admin"
  132. And user "user0" exists
  133. And user "user0" has a quota of "0"
  134. When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
  135. Then the HTTP status code should be "507"
  136. Scenario: Retrieving folder quota when no quota is set
  137. Given using old dav path
  138. And As an "admin"
  139. And user "user0" exists
  140. When user "user0" has unlimited quota
  141. Then as "user0" gets properties of folder "/" with
  142. |{DAV:}quota-available-bytes|
  143. And the single response should contain a property "{DAV:}quota-available-bytes" with value "-3"
  144. Scenario: Retrieving folder quota when quota is set
  145. Given using old dav path
  146. And As an "admin"
  147. And user "user0" exists
  148. When user "user0" has a quota of "10 MB"
  149. Then as "user0" gets properties of folder "/" with
  150. |{DAV:}quota-available-bytes|
  151. And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485421"
  152. Scenario: Retrieving folder quota of shared folder with quota when no quota is set for recipient
  153. Given using old dav path
  154. And As an "admin"
  155. And user "user0" exists
  156. And user "user1" exists
  157. And user "user0" has unlimited quota
  158. And user "user1" has a quota of "10 MB"
  159. And As an "user1"
  160. And user "user1" created a folder "/testquota"
  161. And as "user1" creating a share with
  162. | path | testquota |
  163. | shareType | 0 |
  164. | permissions | 31 |
  165. | shareWith | user0 |
  166. And user "user0" accepts last share
  167. Then as "user0" gets properties of folder "/testquota" with
  168. |{DAV:}quota-available-bytes|
  169. And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485421"
  170. Scenario: Uploading a file as recipient using webdav having quota
  171. Given using old dav path
  172. And As an "admin"
  173. And user "user0" exists
  174. And user "user1" exists
  175. And user "user0" has a quota of "10 MB"
  176. And user "user1" has a quota of "10 MB"
  177. And As an "user1"
  178. And user "user1" created a folder "/testquota"
  179. And as "user1" creating a share with
  180. | path | testquota |
  181. | shareType | 0 |
  182. | permissions | 31 |
  183. | shareWith | user0 |
  184. And user "user0" accepts last share
  185. And As an "user0"
  186. When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
  187. Then the HTTP status code should be "201"
  188. Scenario: Retrieving folder quota when quota is set and a file was uploaded
  189. Given using old dav path
  190. And As an "admin"
  191. And user "user0" exists
  192. And user "user0" has a quota of "1 KB"
  193. And user "user0" adds a file of 93 bytes to "/prueba.txt"
  194. When as "user0" gets properties of folder "/" with
  195. |{DAV:}quota-available-bytes|
  196. Then the single response should contain a property "{DAV:}quota-available-bytes" with value "592"
  197. Scenario: Retrieving folder quota when quota is set and a file was received
  198. Given using old dav path
  199. And As an "admin"
  200. And user "user0" exists
  201. And user "user1" exists
  202. And user "user1" has a quota of "1 KB"
  203. And user "user0" adds a file of 93 bytes to "/user0.txt"
  204. And file "user0.txt" of user "user0" is shared with user "user1"
  205. And user "user1" accepts last share
  206. When as "user1" gets properties of folder "/" with
  207. |{DAV:}quota-available-bytes|
  208. Then the single response should contain a property "{DAV:}quota-available-bytes" with value "685"
  209. Scenario: download a public shared file with range
  210. Given user "user0" exists
  211. And As an "user0"
  212. When creating a share with
  213. | path | welcome.txt |
  214. | shareType | 3 |
  215. And Downloading last public shared file with range "bytes=52-78"
  216. Then Downloaded content should be "example file for developers"
  217. Scenario: download a public shared file inside a folder with range
  218. Given user "user0" exists
  219. And As an "user0"
  220. When creating a share with
  221. | path | PARENT |
  222. | shareType | 3 |
  223. And Downloading last public shared file inside a folder "/parent.txt" with range "bytes=1-8"
  224. Then Downloaded content should be "extcloud"
  225. Scenario: Downloading a file on the old endpoint should serve security headers
  226. Given using old dav path
  227. And As an "admin"
  228. When Downloading file "/welcome.txt"
  229. Then The following headers should be set
  230. |Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
  231. |Content-Security-Policy|default-src 'none';|
  232. |X-Content-Type-Options |nosniff|
  233. |X-Frame-Options|SAMEORIGIN|
  234. |X-Permitted-Cross-Domain-Policies|none|
  235. |X-Robots-Tag|noindex, nofollow|
  236. |X-XSS-Protection|1; mode=block|
  237. And Downloaded content should start with "Welcome to your Nextcloud account!"
  238. Scenario: Doing a GET with a web login should work without CSRF token on the old backend
  239. Given Logging in using web as "admin"
  240. When Sending a "GET" to "/remote.php/webdav/welcome.txt" without requesttoken
  241. Then Downloaded content should start with "Welcome to your Nextcloud account!"
  242. Then the HTTP status code should be "200"
  243. Scenario: Doing a GET with a web login should work with CSRF token on the old backend
  244. Given Logging in using web as "admin"
  245. When Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  246. Then Downloaded content should start with "Welcome to your Nextcloud account!"
  247. Then the HTTP status code should be "200"
  248. Scenario: Doing a PROPFIND with a web login should not work without CSRF token on the old backend
  249. Given Logging in using web as "admin"
  250. When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" without requesttoken
  251. Then the HTTP status code should be "401"
  252. Scenario: Doing a PROPFIND with a web login should work with CSRF token on the old backend
  253. Given Logging in using web as "admin"
  254. When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" with requesttoken
  255. Then the HTTP status code should be "207"
  256. Scenario: Upload chunked file asc
  257. Given user "user0" exists
  258. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  259. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  260. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  261. When As an "user0"
  262. And Downloading file "/myChunkedFile.txt"
  263. Then Downloaded content should be "AAAAABBBBBCCCCC"
  264. Scenario: Upload chunked file desc
  265. Given user "user0" exists
  266. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  267. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  268. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  269. When As an "user0"
  270. And Downloading file "/myChunkedFile.txt"
  271. Then Downloaded content should be "AAAAABBBBBCCCCC"
  272. Scenario: Upload chunked file random
  273. Given user "user0" exists
  274. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  275. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  276. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  277. When As an "user0"
  278. And Downloading file "/myChunkedFile.txt"
  279. Then Downloaded content should be "AAAAABBBBBCCCCC"
  280. Scenario: A file that is not shared does not have a share-types property
  281. Given user "user0" exists
  282. And user "user0" created a folder "/test"
  283. When as "user0" gets properties of folder "/test" with
  284. |{http://owncloud.org/ns}share-types|
  285. Then the response should contain an empty property "{http://owncloud.org/ns}share-types"
  286. Scenario: A file that is shared to a user has a share-types property
  287. Given user "user0" exists
  288. And user "user1" exists
  289. And user "user0" created a folder "/test"
  290. And as "user0" creating a share with
  291. | path | test |
  292. | shareType | 0 |
  293. | permissions | 31 |
  294. | shareWith | user1 |
  295. When as "user0" gets properties of folder "/test" with
  296. |{http://owncloud.org/ns}share-types|
  297. Then the response should contain a share-types property with
  298. | 0 |
  299. Scenario: A file that is shared to a group has a share-types property
  300. Given user "user0" exists
  301. And group "group1" exists
  302. And user "user0" created a folder "/test"
  303. And as "user0" creating a share with
  304. | path | test |
  305. | shareType | 1 |
  306. | permissions | 31 |
  307. | shareWith | group1 |
  308. When as "user0" gets properties of folder "/test" with
  309. |{http://owncloud.org/ns}share-types|
  310. Then the response should contain a share-types property with
  311. | 1 |
  312. Scenario: A file that is shared by link has a share-types property
  313. Given user "user0" exists
  314. And user "user0" created a folder "/test"
  315. And as "user0" creating a share with
  316. | path | test |
  317. | shareType | 3 |
  318. | permissions | 31 |
  319. When as "user0" gets properties of folder "/test" with
  320. |{http://owncloud.org/ns}share-types|
  321. Then the response should contain a share-types property with
  322. | 3 |
  323. Scenario: A file that is shared by user,group and link has a share-types property
  324. Given user "user0" exists
  325. And user "user1" exists
  326. And group "group2" exists
  327. And user "user0" created a folder "/test"
  328. And as "user0" creating a share with
  329. | path | test |
  330. | shareType | 0 |
  331. | permissions | 31 |
  332. | shareWith | user1 |
  333. And as "user0" creating a share with
  334. | path | test |
  335. | shareType | 1 |
  336. | permissions | 31 |
  337. | shareWith | group2 |
  338. And as "user0" creating a share with
  339. | path | test |
  340. | shareType | 3 |
  341. | permissions | 31 |
  342. When as "user0" gets properties of folder "/test" with
  343. |{http://owncloud.org/ns}share-types|
  344. Then the response should contain a share-types property with
  345. | 0 |
  346. | 1 |
  347. | 3 |
  348. Scenario: Upload chunked file asc with new chunking
  349. Given using new dav path
  350. And user "user0" exists
  351. And user "user0" creates a new chunking upload with id "chunking-42"
  352. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  353. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  354. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  355. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  356. When As an "user0"
  357. And Downloading file "/myChunkedFile.txt"
  358. Then Downloaded content should be "AAAAABBBBBCCCCC"
  359. Scenario: Upload chunked file desc with new chunking
  360. Given using new dav path
  361. And user "user0" exists
  362. And user "user0" creates a new chunking upload with id "chunking-42"
  363. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  364. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  365. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  366. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  367. When As an "user0"
  368. And Downloading file "/myChunkedFile.txt"
  369. Then Downloaded content should be "AAAAABBBBBCCCCC"
  370. Scenario: Upload chunked file random with new chunking
  371. Given using new dav path
  372. And user "user0" exists
  373. And user "user0" creates a new chunking upload with id "chunking-42"
  374. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  375. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  376. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  377. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  378. When As an "user0"
  379. And Downloading file "/myChunkedFile.txt"
  380. Then Downloaded content should be "AAAAABBBBBCCCCC"
  381. Scenario: A disabled user cannot use webdav
  382. Given user "userToBeDisabled" exists
  383. And As an "admin"
  384. And assure user "userToBeDisabled" is disabled
  385. When Downloading file "/welcome.txt" as "userToBeDisabled"
  386. Then the HTTP status code should be "503"
  387. Scenario: Copying files into a folder with edit permissions
  388. Given using dav path "remote.php/webdav"
  389. And user "user0" exists
  390. And user "user1" exists
  391. And As an "user1"
  392. And user "user1" created a folder "/testcopypermissionsAllowed"
  393. And as "user1" creating a share with
  394. | path | testcopypermissionsAllowed |
  395. | shareType | 0 |
  396. | permissions | 31 |
  397. | shareWith | user0 |
  398. And user "user0" accepts last share
  399. And User "user0" uploads file with content "copytest" to "/copytest.txt"
  400. When User "user0" copies file "/copytest.txt" to "/testcopypermissionsAllowed/copytest.txt"
  401. Then the HTTP status code should be "201"
  402. Scenario: Copying files into a folder without edit permissions
  403. Given using dav path "remote.php/webdav"
  404. And user "user0" exists
  405. And user "user1" exists
  406. And As an "user1"
  407. And user "user1" created a folder "/testcopypermissionsNotAllowed"
  408. And as "user1" creating a share with
  409. | path | testcopypermissionsNotAllowed |
  410. | shareType | 0 |
  411. | permissions | 1 |
  412. | shareWith | user0 |
  413. And user "user0" accepts last share
  414. And User "user0" uploads file with content "copytest" to "/copytest.txt"
  415. When User "user0" copies file "/copytest.txt" to "/testcopypermissionsNotAllowed/copytest.txt"
  416. Then the HTTP status code should be "403"
  417. Scenario: Uploading a file as recipient with limited permissions
  418. Given using new dav path
  419. And As an "admin"
  420. And user "user0" exists
  421. And user "user1" exists
  422. And user "user0" has a quota of "10 MB"
  423. And user "user1" has a quota of "10 MB"
  424. And As an "user1"
  425. And user "user1" created a folder "/testfolder"
  426. And as "user1" creating a share with
  427. | path | testfolder |
  428. | shareType | 0 |
  429. | permissions | 23 |
  430. | shareWith | user0 |
  431. And user "user0" accepts last share
  432. And As an "user0"
  433. And User "user0" uploads file "data/textfile.txt" to "/testfolder/asdf.txt"
  434. And As an "user1"
  435. When User "user1" deletes file "/testfolder/asdf.txt"
  436. Then the HTTP status code should be "204"
  437. Scenario: Creating a folder
  438. Given using old dav path
  439. And user "user0" exists
  440. And user "user0" created a folder "/test_folder"
  441. When as "user0" gets properties of folder "/test_folder" with
  442. |{DAV:}resourcetype|
  443. Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"
  444. Scenario: Creating a folder with special chars
  445. Given using old dav path
  446. And user "user0" exists
  447. And user "user0" created a folder "/test_folder:5"
  448. When as "user0" gets properties of folder "/test_folder:5" with
  449. |{DAV:}resourcetype|
  450. Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"
  451. Scenario: Removing everything of a folder
  452. Given using old dav path
  453. And As an "admin"
  454. And user "user0" exists
  455. And As an "user0"
  456. And User "user0" moves file "/welcome.txt" to "/FOLDER/welcome.txt"
  457. And user "user0" created a folder "/FOLDER/SUBFOLDER"
  458. And User "user0" copies file "/textfile0.txt" to "/FOLDER/SUBFOLDER/testfile0.txt"
  459. When User "user0" deletes everything from folder "/FOLDER/"
  460. Then user "user0" should see following elements
  461. | /FOLDER/ |
  462. | /PARENT/ |
  463. | /PARENT/parent.txt |
  464. | /textfile0.txt |
  465. | /textfile1.txt |
  466. | /textfile2.txt |
  467. | /textfile3.txt |
  468. | /textfile4.txt |
  469. Scenario: Removing everything of a folder using new dav path
  470. Given using new dav path
  471. And As an "admin"
  472. And user "user0" exists
  473. And As an "user0"
  474. And User "user0" moves file "/welcome.txt" to "/FOLDER/welcome.txt"
  475. And user "user0" created a folder "/FOLDER/SUBFOLDER"
  476. And User "user0" copies file "/textfile0.txt" to "/FOLDER/SUBFOLDER/testfile0.txt"
  477. When User "user0" deletes everything from folder "/FOLDER/"
  478. Then user "user0" should see following elements
  479. | /FOLDER/ |
  480. | /PARENT/ |
  481. | /PARENT/parent.txt |
  482. | /textfile0.txt |
  483. | /textfile1.txt |
  484. | /textfile2.txt |
  485. | /textfile3.txt |
  486. | /textfile4.txt |
  487. Scenario: Checking file id after a move using new endpoint
  488. Given using new dav path
  489. And user "user0" exists
  490. And User "user0" stores id of file "/textfile0.txt"
  491. When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  492. Then User "user0" checks id of file "/FOLDER/textfile0.txt"
  493. Scenario: Checking file id after a move overwrite using new chunking endpoint
  494. Given using new dav path
  495. And user "user0" exists
  496. And User "user0" copies file "/textfile0.txt" to "/existingFile.txt"
  497. And User "user0" stores id of file "/existingFile.txt"
  498. And user "user0" creates a new chunking upload with id "chunking-42"
  499. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  500. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  501. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  502. When user "user0" moves new chunk file with id "chunking-42" to "/existingFile.txt"
  503. Then User "user0" checks id of file "/existingFile.txt"
  504. Scenario: Renaming a folder to a backslash encoded should return an error using old endpoint
  505. Given using old dav path
  506. And user "user0" exists
  507. And user "user0" created a folder "/testshare"
  508. When User "user0" moves folder "/testshare" to "/%5C"
  509. Then the HTTP status code should be "400"
  510. Scenario: Renaming a folder beginning with a backslash encoded should return an error using old endpoint
  511. Given using old dav path
  512. And user "user0" exists
  513. And user "user0" created a folder "/testshare"
  514. When User "user0" moves folder "/testshare" to "/%5Ctestshare"
  515. Then the HTTP status code should be "400"
  516. Scenario: Renaming a folder including a backslash encoded should return an error using old endpoint
  517. Given using old dav path
  518. And user "user0" exists
  519. And user "user0" created a folder "/testshare"
  520. When User "user0" moves folder "/testshare" to "/hola%5Chola"
  521. Then the HTTP status code should be "400"
  522. Scenario: Renaming a folder to a backslash encoded should return an error using new endpoint
  523. Given using new dav path
  524. And user "user0" exists
  525. And user "user0" created a folder "/testshare"
  526. When User "user0" moves folder "/testshare" to "/%5C"
  527. Then the HTTP status code should be "400"
  528. Scenario: Renaming a folder beginning with a backslash encoded should return an error using new endpoint
  529. Given using new dav path
  530. And user "user0" exists
  531. And user "user0" created a folder "/testshare"
  532. When User "user0" moves folder "/testshare" to "/%5Ctestshare"
  533. Then the HTTP status code should be "400"
  534. Scenario: Renaming a folder including a backslash encoded should return an error using new endpoint
  535. Given using new dav path
  536. And user "user0" exists
  537. And user "user0" created a folder "/testshare"
  538. When User "user0" moves folder "/testshare" to "/hola%5Chola"
  539. Then the HTTP status code should be "400"
  540. Scenario: Upload file via new chunking endpoint with wrong size header
  541. Given using new dav path
  542. And user "user0" exists
  543. And user "user0" creates a new chunking upload with id "chunking-42"
  544. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  545. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  546. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  547. When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 5
  548. Then the HTTP status code should be "400"
  549. Scenario: Upload file via new chunking endpoint with correct size header
  550. Given using new dav path
  551. And user "user0" exists
  552. And user "user0" creates a new chunking upload with id "chunking-42"
  553. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  554. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  555. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  556. When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 15
  557. Then the HTTP status code should be "201"
  558. Scenario: Upload bulked files
  559. Given user "user0" exists
  560. And user "user0" uploads bulked files "A.txt" with "AAAAA" and "B.txt" with "BBBBB" and "C.txt" with "CCCCC"
  561. When As an "user0"
  562. Then Downloading file "/A.txt"
  563. And Downloaded content should be "AAAAA"
  564. And File "/A.txt" should have prop "d:getlastmodified" equal to "Fri, 18 Mar 2005 01:58:31 GMT"
  565. And Downloading file "/B.txt"
  566. And Downloaded content should be "BBBBB"
  567. And File "/B.txt" should have prop "d:getlastmodified" equal to "Sat, 02 Jun 2040 03:57:02 GMT"
  568. And Downloading file "/C.txt"
  569. And Downloaded content should be "CCCCC"
  570. And File "/C.txt" should have prop "d:getlastmodified" equal to "Sun, 18 Aug 2075 05:55:33 GMT"
  571. Scenario: Creating a folder with invalid characters
  572. Given using new dav path
  573. And As an "admin"
  574. And user "user0" exists
  575. And user "user1" exists
  576. And As an "user1"
  577. And user "user1" created a folder "/testshare "
  578. Then the HTTP status code should be "400"
  579. @s3-multipart
  580. Scenario: Upload chunked file asc with new chunking v2
  581. Given using new dav path
  582. And user "user0" exists
  583. And user "user0" creates a file locally with "3" x 5 MB chunks
  584. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/myChunkedFile1.txt"
  585. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  586. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  587. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  588. And user "user0" moves new chunk v2 file with id "chunking-42"
  589. Then the S3 multipart upload was successful with status "201"
  590. When As an "user0"
  591. And Downloading file "/myChunkedFile1.txt"
  592. Then Downloaded content should be the created file
  593. @s3-multipart
  594. Scenario: Upload chunked file desc with new chunking v2
  595. Given using new dav path
  596. And user "user0" exists
  597. And user "user0" creates a file locally with "3" x 5 MB chunks
  598. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/myChunkedFile.txt"
  599. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  600. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  601. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  602. And user "user0" moves new chunk v2 file with id "chunking-42"
  603. Then the S3 multipart upload was successful with status "201"
  604. When As an "user0"
  605. And Downloading file "/myChunkedFile.txt"
  606. Then Downloaded content should be the created file
  607. @s3-multipart
  608. Scenario: Upload chunked file with random chunk sizes
  609. Given using new dav path
  610. And user "user0" exists
  611. And user "user0" creates a new chunking v2 upload with id "chunking-random" and destination "/myChunkedFile.txt"
  612. And user user0 creates the chunk 1 with a size of 5 MB
  613. And user user0 creates the chunk 2 with a size of 7 MB
  614. And user user0 creates the chunk 3 with a size of 9 MB
  615. And user user0 creates the chunk 4 with a size of 1 MB
  616. And user "user0" uploads new chunk v2 file "1" to id "chunking-random"
  617. And user "user0" uploads new chunk v2 file "3" to id "chunking-random"
  618. And user "user0" uploads new chunk v2 file "2" to id "chunking-random"
  619. And user "user0" uploads new chunk v2 file "4" to id "chunking-random"
  620. And user "user0" moves new chunk v2 file with id "chunking-random"
  621. Then the S3 multipart upload was successful with status "201"
  622. When As an "user0"
  623. And Downloading file "/myChunkedFile.txt"
  624. Then Downloaded content should be the created file
  625. @s3-multipart
  626. Scenario: Upload chunked file with too low chunk sizes
  627. Given using new dav path
  628. And user "user0" exists
  629. And user "user0" creates a new chunking v2 upload with id "chunking-random" and destination "/myChunkedFile.txt"
  630. And user user0 creates the chunk 1 with a size of 5 MB
  631. And user user0 creates the chunk 2 with a size of 2 MB
  632. And user user0 creates the chunk 3 with a size of 5 MB
  633. And user user0 creates the chunk 4 with a size of 1 MB
  634. And user "user0" uploads new chunk v2 file "1" to id "chunking-random"
  635. And user "user0" uploads new chunk v2 file "3" to id "chunking-random"
  636. And user "user0" uploads new chunk v2 file "2" to id "chunking-random"
  637. And user "user0" uploads new chunk v2 file "4" to id "chunking-random"
  638. And user "user0" moves new chunk v2 file with id "chunking-random"
  639. Then the upload should fail on object storage
  640. @s3-multipart
  641. Scenario: Upload chunked file with special characters with new chunking v2
  642. Given using new dav path
  643. And user "user0" exists
  644. And user "user0" creates a file locally with "3" x 5 MB chunks
  645. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/äöü.txt"
  646. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  647. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  648. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  649. And user "user0" moves new chunk v2 file with id "chunking-42"
  650. Then the S3 multipart upload was successful with status "201"
  651. When As an "user0"
  652. And Downloading file "/äöü.txt"
  653. Then Downloaded content should be the created file
  654. @s3-multipart
  655. Scenario: Upload chunked file with special characters in path with new chunking v2
  656. Given using new dav path
  657. And user "user0" exists
  658. And User "user0" created a folder "üäöé"
  659. And user "user0" creates a file locally with "3" x 5 MB chunks
  660. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/üäöé/äöü.txt"
  661. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  662. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  663. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  664. And user "user0" moves new chunk v2 file with id "chunking-42"
  665. Then the S3 multipart upload was successful with status "201"
  666. When As an "user0"
  667. And Downloading file "/üäöé/äöü.txt"
  668. Then Downloaded content should be the created file