webdav-related.feature 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  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: A file that is not shared does not have a share-types property
  257. Given user "user0" exists
  258. And user "user0" created a folder "/test"
  259. When as "user0" gets properties of folder "/test" with
  260. |{http://owncloud.org/ns}share-types|
  261. Then the response should contain an empty property "{http://owncloud.org/ns}share-types"
  262. Scenario: A file that is shared to a user has a share-types property
  263. Given user "user0" exists
  264. And user "user1" exists
  265. And user "user0" created a folder "/test"
  266. And as "user0" creating a share with
  267. | path | test |
  268. | shareType | 0 |
  269. | permissions | 31 |
  270. | shareWith | user1 |
  271. When as "user0" gets properties of folder "/test" with
  272. |{http://owncloud.org/ns}share-types|
  273. Then the response should contain a share-types property with
  274. | 0 |
  275. Scenario: A file that is shared to a group has a share-types property
  276. Given user "user0" exists
  277. And group "group1" exists
  278. And user "user0" created a folder "/test"
  279. And as "user0" creating a share with
  280. | path | test |
  281. | shareType | 1 |
  282. | permissions | 31 |
  283. | shareWith | group1 |
  284. When as "user0" gets properties of folder "/test" with
  285. |{http://owncloud.org/ns}share-types|
  286. Then the response should contain a share-types property with
  287. | 1 |
  288. Scenario: A file that is shared by link has a share-types property
  289. Given user "user0" exists
  290. And user "user0" created a folder "/test"
  291. And as "user0" creating a share with
  292. | path | test |
  293. | shareType | 3 |
  294. | permissions | 31 |
  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. | 3 |
  299. Scenario: A file that is shared by user,group and link has a share-types property
  300. Given user "user0" exists
  301. And user "user1" exists
  302. And group "group2" exists
  303. And user "user0" created a folder "/test"
  304. And as "user0" creating a share with
  305. | path | test |
  306. | shareType | 0 |
  307. | permissions | 31 |
  308. | shareWith | user1 |
  309. And as "user0" creating a share with
  310. | path | test |
  311. | shareType | 1 |
  312. | permissions | 31 |
  313. | shareWith | group2 |
  314. And as "user0" creating a share with
  315. | path | test |
  316. | shareType | 3 |
  317. | permissions | 31 |
  318. When as "user0" gets properties of folder "/test" with
  319. |{http://owncloud.org/ns}share-types|
  320. Then the response should contain a share-types property with
  321. | 0 |
  322. | 1 |
  323. | 3 |
  324. Scenario: Upload chunked file asc with new chunking
  325. Given using new dav path
  326. And user "user0" exists
  327. And user "user0" creates a new chunking upload with id "chunking-42"
  328. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  329. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  330. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  331. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  332. When As an "user0"
  333. And Downloading file "/myChunkedFile.txt"
  334. Then Downloaded content should be "AAAAABBBBBCCCCC"
  335. Scenario: Upload chunked file desc with new chunking
  336. Given using new dav path
  337. And user "user0" exists
  338. And user "user0" creates a new chunking upload with id "chunking-42"
  339. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  340. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  341. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  342. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  343. When As an "user0"
  344. And Downloading file "/myChunkedFile.txt"
  345. Then Downloaded content should be "AAAAABBBBBCCCCC"
  346. Scenario: Upload chunked file random with new chunking
  347. Given using new dav path
  348. And user "user0" exists
  349. And user "user0" creates a new chunking upload with id "chunking-42"
  350. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  351. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  352. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  353. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  354. When As an "user0"
  355. And Downloading file "/myChunkedFile.txt"
  356. Then Downloaded content should be "AAAAABBBBBCCCCC"
  357. Scenario: A disabled user cannot use webdav
  358. Given user "userToBeDisabled" exists
  359. And As an "admin"
  360. And assure user "userToBeDisabled" is disabled
  361. When Downloading file "/welcome.txt" as "userToBeDisabled"
  362. Then the HTTP status code should be "503"
  363. Scenario: Copying files into a folder with edit permissions
  364. Given using dav path "remote.php/webdav"
  365. And user "user0" exists
  366. And user "user1" exists
  367. And As an "user1"
  368. And user "user1" created a folder "/testcopypermissionsAllowed"
  369. And as "user1" creating a share with
  370. | path | testcopypermissionsAllowed |
  371. | shareType | 0 |
  372. | permissions | 31 |
  373. | shareWith | user0 |
  374. And user "user0" accepts last share
  375. And User "user0" uploads file with content "copytest" to "/copytest.txt"
  376. When User "user0" copies file "/copytest.txt" to "/testcopypermissionsAllowed/copytest.txt"
  377. Then the HTTP status code should be "201"
  378. Scenario: Copying files into a folder without edit permissions
  379. Given using dav path "remote.php/webdav"
  380. And user "user0" exists
  381. And user "user1" exists
  382. And As an "user1"
  383. And user "user1" created a folder "/testcopypermissionsNotAllowed"
  384. And as "user1" creating a share with
  385. | path | testcopypermissionsNotAllowed |
  386. | shareType | 0 |
  387. | permissions | 1 |
  388. | shareWith | user0 |
  389. And user "user0" accepts last share
  390. And User "user0" uploads file with content "copytest" to "/copytest.txt"
  391. When User "user0" copies file "/copytest.txt" to "/testcopypermissionsNotAllowed/copytest.txt"
  392. Then the HTTP status code should be "403"
  393. Scenario: Uploading a file as recipient with limited permissions
  394. Given using new dav path
  395. And As an "admin"
  396. And user "user0" exists
  397. And user "user1" exists
  398. And user "user0" has a quota of "10 MB"
  399. And user "user1" has a quota of "10 MB"
  400. And As an "user1"
  401. And user "user1" created a folder "/testfolder"
  402. And as "user1" creating a share with
  403. | path | testfolder |
  404. | shareType | 0 |
  405. | permissions | 23 |
  406. | shareWith | user0 |
  407. And user "user0" accepts last share
  408. And As an "user0"
  409. And User "user0" uploads file "data/textfile.txt" to "/testfolder/asdf.txt"
  410. And As an "user1"
  411. When User "user1" deletes file "/testfolder/asdf.txt"
  412. Then the HTTP status code should be "204"
  413. Scenario: Creating a folder
  414. Given using old dav path
  415. And user "user0" exists
  416. And user "user0" created a folder "/test_folder"
  417. When as "user0" gets properties of folder "/test_folder" with
  418. |{DAV:}resourcetype|
  419. Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"
  420. Scenario: Creating a folder with special chars
  421. Given using old dav path
  422. And user "user0" exists
  423. And user "user0" created a folder "/test_folder:5"
  424. When as "user0" gets properties of folder "/test_folder:5" with
  425. |{DAV:}resourcetype|
  426. Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"
  427. Scenario: Removing everything of a folder
  428. Given using old dav path
  429. And As an "admin"
  430. And user "user0" exists
  431. And As an "user0"
  432. And User "user0" moves file "/welcome.txt" to "/FOLDER/welcome.txt"
  433. And user "user0" created a folder "/FOLDER/SUBFOLDER"
  434. And User "user0" copies file "/textfile0.txt" to "/FOLDER/SUBFOLDER/testfile0.txt"
  435. When User "user0" deletes everything from folder "/FOLDER/"
  436. Then user "user0" should see following elements
  437. | /FOLDER/ |
  438. | /PARENT/ |
  439. | /PARENT/parent.txt |
  440. | /textfile0.txt |
  441. | /textfile1.txt |
  442. | /textfile2.txt |
  443. | /textfile3.txt |
  444. | /textfile4.txt |
  445. Scenario: Removing everything of a folder using new dav path
  446. Given using new dav path
  447. And As an "admin"
  448. And user "user0" exists
  449. And As an "user0"
  450. And User "user0" moves file "/welcome.txt" to "/FOLDER/welcome.txt"
  451. And user "user0" created a folder "/FOLDER/SUBFOLDER"
  452. And User "user0" copies file "/textfile0.txt" to "/FOLDER/SUBFOLDER/testfile0.txt"
  453. When User "user0" deletes everything from folder "/FOLDER/"
  454. Then user "user0" should see following elements
  455. | /FOLDER/ |
  456. | /PARENT/ |
  457. | /PARENT/parent.txt |
  458. | /textfile0.txt |
  459. | /textfile1.txt |
  460. | /textfile2.txt |
  461. | /textfile3.txt |
  462. | /textfile4.txt |
  463. Scenario: Checking file id after a move using new endpoint
  464. Given using new dav path
  465. And user "user0" exists
  466. And User "user0" stores id of file "/textfile0.txt"
  467. When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  468. Then User "user0" checks id of file "/FOLDER/textfile0.txt"
  469. Scenario: Checking file id after a move overwrite using new chunking endpoint
  470. Given using new dav path
  471. And user "user0" exists
  472. And User "user0" copies file "/textfile0.txt" to "/existingFile.txt"
  473. And User "user0" stores id of file "/existingFile.txt"
  474. And user "user0" creates a new chunking upload with id "chunking-42"
  475. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  476. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  477. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  478. When user "user0" moves new chunk file with id "chunking-42" to "/existingFile.txt"
  479. Then User "user0" checks id of file "/existingFile.txt"
  480. Scenario: Renaming a folder to a backslash encoded should return an error using old endpoint
  481. Given using old dav path
  482. And user "user0" exists
  483. And user "user0" created a folder "/testshare"
  484. When User "user0" moves folder "/testshare" to "/%5C"
  485. Then the HTTP status code should be "400"
  486. Scenario: Renaming a folder beginning with a backslash encoded should return an error using old endpoint
  487. Given using old dav path
  488. And user "user0" exists
  489. And user "user0" created a folder "/testshare"
  490. When User "user0" moves folder "/testshare" to "/%5Ctestshare"
  491. Then the HTTP status code should be "400"
  492. Scenario: Renaming a folder including a backslash encoded should return an error using old endpoint
  493. Given using old dav path
  494. And user "user0" exists
  495. And user "user0" created a folder "/testshare"
  496. When User "user0" moves folder "/testshare" to "/hola%5Chola"
  497. Then the HTTP status code should be "400"
  498. Scenario: Renaming a folder to a backslash encoded should return an error using new endpoint
  499. Given using new dav path
  500. And user "user0" exists
  501. And user "user0" created a folder "/testshare"
  502. When User "user0" moves folder "/testshare" to "/%5C"
  503. Then the HTTP status code should be "400"
  504. Scenario: Renaming a folder beginning with a backslash encoded should return an error using new endpoint
  505. Given using new dav path
  506. And user "user0" exists
  507. And user "user0" created a folder "/testshare"
  508. When User "user0" moves folder "/testshare" to "/%5Ctestshare"
  509. Then the HTTP status code should be "400"
  510. Scenario: Renaming a folder including a backslash encoded should return an error using new endpoint
  511. Given using new dav path
  512. And user "user0" exists
  513. And user "user0" created a folder "/testshare"
  514. When User "user0" moves folder "/testshare" to "/hola%5Chola"
  515. Then the HTTP status code should be "400"
  516. Scenario: Upload file via new chunking endpoint with wrong size header
  517. Given using new dav path
  518. And user "user0" exists
  519. And user "user0" creates a new chunking upload with id "chunking-42"
  520. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  521. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  522. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  523. When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 5
  524. Then the HTTP status code should be "400"
  525. Scenario: Upload file via new chunking endpoint with correct size header
  526. Given using new dav path
  527. And user "user0" exists
  528. And user "user0" creates a new chunking upload with id "chunking-42"
  529. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  530. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  531. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  532. When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 15
  533. Then the HTTP status code should be "201"
  534. Scenario: Upload bulked files
  535. Given user "user0" exists
  536. And user "user0" uploads bulked files "A.txt" with "AAAAA" and "B.txt" with "BBBBB" and "C.txt" with "CCCCC"
  537. When As an "user0"
  538. Then Downloading file "/A.txt"
  539. And Downloaded content should be "AAAAA"
  540. And File "/A.txt" should have prop "d:getlastmodified" equal to "Fri, 18 Mar 2005 01:58:31 GMT"
  541. And Downloading file "/B.txt"
  542. And Downloaded content should be "BBBBB"
  543. And File "/B.txt" should have prop "d:getlastmodified" equal to "Sat, 02 Jun 2040 03:57:02 GMT"
  544. And Downloading file "/C.txt"
  545. And Downloaded content should be "CCCCC"
  546. And File "/C.txt" should have prop "d:getlastmodified" equal to "Sun, 18 Aug 2075 05:55:33 GMT"
  547. Scenario: Creating a folder with invalid characters
  548. Given using new dav path
  549. And As an "admin"
  550. And user "user0" exists
  551. And user "user1" exists
  552. And As an "user1"
  553. And user "user1" created a folder "/testshare "
  554. Then the HTTP status code should be "400"
  555. @s3-multipart
  556. Scenario: Upload chunked file asc with new chunking v2
  557. Given using new dav path
  558. And user "user0" exists
  559. And user "user0" creates a file locally with "3" x 5 MB chunks
  560. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/myChunkedFile1.txt"
  561. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  562. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  563. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  564. And user "user0" moves new chunk v2 file with id "chunking-42"
  565. Then the S3 multipart upload was successful with status "201"
  566. When As an "user0"
  567. And Downloading file "/myChunkedFile1.txt"
  568. Then Downloaded content should be the created file
  569. @s3-multipart
  570. Scenario: Upload chunked file desc with new chunking v2
  571. Given using new dav path
  572. And user "user0" exists
  573. And user "user0" creates a file locally with "3" x 5 MB chunks
  574. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/myChunkedFile.txt"
  575. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  576. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  577. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  578. And user "user0" moves new chunk v2 file with id "chunking-42"
  579. Then the S3 multipart upload was successful with status "201"
  580. When As an "user0"
  581. And Downloading file "/myChunkedFile.txt"
  582. Then Downloaded content should be the created file
  583. @s3-multipart
  584. Scenario: Upload chunked file with random chunk sizes
  585. Given using new dav path
  586. And user "user0" exists
  587. And user "user0" creates a new chunking v2 upload with id "chunking-random" and destination "/myChunkedFile.txt"
  588. And user user0 creates the chunk 1 with a size of 5 MB
  589. And user user0 creates the chunk 2 with a size of 7 MB
  590. And user user0 creates the chunk 3 with a size of 9 MB
  591. And user user0 creates the chunk 4 with a size of 1 MB
  592. And user "user0" uploads new chunk v2 file "1" to id "chunking-random"
  593. And user "user0" uploads new chunk v2 file "3" to id "chunking-random"
  594. And user "user0" uploads new chunk v2 file "2" to id "chunking-random"
  595. And user "user0" uploads new chunk v2 file "4" to id "chunking-random"
  596. And user "user0" moves new chunk v2 file with id "chunking-random"
  597. Then the S3 multipart upload was successful with status "201"
  598. When As an "user0"
  599. And Downloading file "/myChunkedFile.txt"
  600. Then Downloaded content should be the created file
  601. @s3-multipart
  602. Scenario: Upload chunked file with too low chunk sizes
  603. Given using new dav path
  604. And user "user0" exists
  605. And user "user0" creates a new chunking v2 upload with id "chunking-random" and destination "/myChunkedFile.txt"
  606. And user user0 creates the chunk 1 with a size of 5 MB
  607. And user user0 creates the chunk 2 with a size of 2 MB
  608. And user user0 creates the chunk 3 with a size of 5 MB
  609. And user user0 creates the chunk 4 with a size of 1 MB
  610. And user "user0" uploads new chunk v2 file "1" to id "chunking-random"
  611. And user "user0" uploads new chunk v2 file "3" to id "chunking-random"
  612. And user "user0" uploads new chunk v2 file "2" to id "chunking-random"
  613. And user "user0" uploads new chunk v2 file "4" to id "chunking-random"
  614. And user "user0" moves new chunk v2 file with id "chunking-random"
  615. Then the upload should fail on object storage
  616. @s3-multipart
  617. Scenario: Upload chunked file with special characters with new chunking v2
  618. Given using new dav path
  619. And user "user0" exists
  620. And user "user0" creates a file locally with "3" x 5 MB chunks
  621. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/äöü.txt"
  622. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  623. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  624. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  625. And user "user0" moves new chunk v2 file with id "chunking-42"
  626. Then the S3 multipart upload was successful with status "201"
  627. When As an "user0"
  628. And Downloading file "/äöü.txt"
  629. Then Downloaded content should be the created file
  630. @s3-multipart
  631. Scenario: Upload chunked file with special characters in path with new chunking v2
  632. Given using new dav path
  633. And user "user0" exists
  634. And User "user0" created a folder "üäöé"
  635. And user "user0" creates a file locally with "3" x 5 MB chunks
  636. And user "user0" creates a new chunking v2 upload with id "chunking-42" and destination "/üäöé/äöü.txt"
  637. And user "user0" uploads new chunk v2 file "1" to id "chunking-42"
  638. And user "user0" uploads new chunk v2 file "2" to id "chunking-42"
  639. And user "user0" uploads new chunk v2 file "3" to id "chunking-42"
  640. And user "user0" moves new chunk v2 file with id "chunking-42"
  641. Then the S3 multipart upload was successful with status "201"
  642. When As an "user0"
  643. And Downloading file "/üäöé/äöü.txt"
  644. Then Downloaded content should be the created file