federated.feature 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. Feature: federated
  2. Background:
  3. Given using api version "1"
  4. Scenario: Federate share a file with another server
  5. Given Using server "REMOTE"
  6. And user "user1" exists
  7. And Using server "LOCAL"
  8. And user "user0" exists
  9. When User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  10. Then the OCS status code should be "100"
  11. And the HTTP status code should be "200"
  12. And Share fields of last share match with
  13. | id | A_NUMBER |
  14. | item_type | file |
  15. | item_source | A_NUMBER |
  16. | share_type | 6 |
  17. | file_source | A_NUMBER |
  18. | path | /textfile0.txt |
  19. | permissions | 19 |
  20. | stime | A_NUMBER |
  21. | storage | A_NUMBER |
  22. | mail_send | 0 |
  23. | uid_owner | user0 |
  24. | storage_id | home::user0 |
  25. | file_parent | A_NUMBER |
  26. | displayname_owner | user0 |
  27. | share_with | user1@REMOTE |
  28. | share_with_displayname | user1 |
  29. Scenario: Federated group share a file with another server
  30. Given Using server "REMOTE"
  31. And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  32. And user "gs-user1" exists
  33. And user "gs-user2" exists
  34. And group "group1" exists
  35. And As an "admin"
  36. And Add user "gs-user1" to the group "group1"
  37. And Add user "gs-user2" to the group "group1"
  38. And Using server "LOCAL"
  39. And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  40. And user "gs-user0" exists
  41. When User "gs-user0" from server "LOCAL" shares "/textfile0.txt" with group "group1" from server "REMOTE"
  42. Then the OCS status code should be "100"
  43. And the HTTP status code should be "200"
  44. And Share fields of last share match with
  45. | id | A_NUMBER |
  46. | item_type | file |
  47. | item_source | A_NUMBER |
  48. | share_type | 9 |
  49. | file_source | A_NUMBER |
  50. | path | /textfile0.txt |
  51. | permissions | 19 |
  52. | stime | A_NUMBER |
  53. | storage | A_NUMBER |
  54. | mail_send | 0 |
  55. | uid_owner | gs-user0 |
  56. | storage_id | home::gs-user0 |
  57. | file_parent | A_NUMBER |
  58. | displayname_owner | gs-user0 |
  59. | share_with | group1@REMOTE |
  60. | share_with_displayname | group1@REMOTE |
  61. Scenario: Federate share a file with local server
  62. Given Using server "LOCAL"
  63. And user "user0" exists
  64. And Using server "REMOTE"
  65. And user "user1" exists
  66. When User "user1" from server "REMOTE" shares "/textfile0.txt" with user "user0" from server "LOCAL"
  67. Then the OCS status code should be "100"
  68. And the HTTP status code should be "200"
  69. And Share fields of last share match with
  70. | id | A_NUMBER |
  71. | item_type | file |
  72. | item_source | A_NUMBER |
  73. | share_type | 6 |
  74. | file_source | A_NUMBER |
  75. | path | /textfile0.txt |
  76. | permissions | 19 |
  77. | stime | A_NUMBER |
  78. | storage | A_NUMBER |
  79. | mail_send | 0 |
  80. | uid_owner | user1 |
  81. | storage_id | home::user1 |
  82. | file_parent | A_NUMBER |
  83. | displayname_owner | user1 |
  84. | share_with | user0@LOCAL |
  85. | share_with_displayname | user0 |
  86. Scenario: Remote sharee can see the pending share
  87. Given Using server "REMOTE"
  88. And user "user1" exists
  89. And Using server "LOCAL"
  90. And user "user0" exists
  91. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  92. And Using server "REMOTE"
  93. And As an "user1"
  94. When sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
  95. Then the OCS status code should be "100"
  96. And the HTTP status code should be "200"
  97. And Share fields of last share match with
  98. | id | A_NUMBER |
  99. | remote | LOCAL |
  100. | remote_id | A_NUMBER |
  101. | share_token | A_TOKEN |
  102. | name | /textfile0.txt |
  103. | owner | user0 |
  104. | user | user1 |
  105. | mountpoint | {{TemporaryMountPointName#/textfile0.txt}} |
  106. | accepted | 0 |
  107. Scenario: Remote sharee can see the pending group share
  108. Given Using server "REMOTE"
  109. And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  110. And user "gs-user1" exists
  111. And user "gs-user2" exists
  112. And group "group1" exists
  113. And As an "admin"
  114. And Add user "gs-user1" to the group "group1"
  115. And Add user "gs-user2" to the group "group1"
  116. And Using server "LOCAL"
  117. And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  118. And user "gs-user0" exists
  119. When User "gs-user0" from server "LOCAL" shares "/textfile0.txt" with group "group1" from server "REMOTE"
  120. And Using server "REMOTE"
  121. And As an "gs-user1"
  122. When sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
  123. Then the OCS status code should be "100"
  124. And the HTTP status code should be "200"
  125. And Share fields of last share match with
  126. | id | A_NUMBER |
  127. | remote | LOCAL |
  128. | remote_id | A_NUMBER |
  129. | share_token | A_TOKEN |
  130. | name | /textfile0.txt |
  131. | owner | gs-user0 |
  132. | user | group1 |
  133. | mountpoint | {{TemporaryMountPointName#/textfile0.txt}} |
  134. | accepted | 0 |
  135. And As an "gs-user2"
  136. When sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
  137. Then the OCS status code should be "100"
  138. And the HTTP status code should be "200"
  139. And Share fields of last share match with
  140. | id | A_NUMBER |
  141. | remote | LOCAL |
  142. | remote_id | A_NUMBER |
  143. | share_token | A_TOKEN |
  144. | name | /textfile0.txt |
  145. | owner | gs-user0 |
  146. | user | group1 |
  147. | mountpoint | {{TemporaryMountPointName#/textfile0.txt}} |
  148. | accepted | 0 |
  149. Scenario: accept a pending remote share
  150. Given Using server "REMOTE"
  151. And user "user1" exists
  152. And Using server "LOCAL"
  153. And user "user0" exists
  154. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  155. When User "user1" from server "REMOTE" accepts last pending share
  156. Then the OCS status code should be "100"
  157. And the HTTP status code should be "200"
  158. Scenario: accept a pending remote group share
  159. Given Using server "REMOTE"
  160. And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  161. And user "gs-user1" exists
  162. And user "gs-user2" exists
  163. And group "group1" exists
  164. And As an "admin"
  165. And Add user "gs-user1" to the group "group1"
  166. And Add user "gs-user2" to the group "group1"
  167. And Using server "LOCAL"
  168. And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
  169. And user "gs-user0" exists
  170. When User "gs-user0" from server "LOCAL" shares "/textfile0.txt" with group "group1" from server "REMOTE"
  171. When User "gs-user1" from server "REMOTE" accepts last pending share
  172. Then the OCS status code should be "100"
  173. And the HTTP status code should be "200"
  174. Scenario: Reshare a federated shared file
  175. Given Using server "REMOTE"
  176. And user "user1" exists
  177. And user "user2" exists
  178. And Using server "LOCAL"
  179. And user "user0" exists
  180. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  181. And User "user1" from server "REMOTE" accepts last pending share
  182. And Using server "REMOTE"
  183. And As an "user1"
  184. When creating a share with
  185. | path | /textfile0 (2).txt |
  186. | shareType | 0 |
  187. | shareWith | user2 |
  188. | permissions | 19 |
  189. #Then the OCS status code should be "100"
  190. #And the HTTP status code should be "200"
  191. #And Share fields of last share match with
  192. # | id | A_NUMBER |
  193. # | item_type | file |
  194. # | item_source | A_NUMBER |
  195. # | share_type | 0 |
  196. # | file_source | A_NUMBER |
  197. # | path | /textfile0 (2).txt |
  198. # | permissions | 19 |
  199. # | stime | A_NUMBER |
  200. # | storage | A_NUMBER |
  201. # | mail_send | 1 |
  202. # | uid_owner | user1 |
  203. # | file_parent | A_NUMBER |
  204. # | displayname_owner | user1 |
  205. # | share_with | user2 |
  206. # | share_with_displayname | user2 |
  207. Scenario: Overwrite a federated shared file as recipient
  208. Given Using server "REMOTE"
  209. And user "user1" exists
  210. And user "user2" exists
  211. And Using server "LOCAL"
  212. And user "user0" exists
  213. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  214. And User "user1" from server "REMOTE" accepts last pending share
  215. And Using server "REMOTE"
  216. And As an "user1"
  217. And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA"
  218. When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/textfile0 (2).txt"
  219. And Downloading file "/textfile0 (2).txt" with range "bytes=0-8"
  220. Then Downloaded content should be "BLABLABLA"
  221. Scenario: Overwrite a federated shared folder as recipient
  222. Given Using server "REMOTE"
  223. And user "user1" exists
  224. And user "user2" exists
  225. And Using server "LOCAL"
  226. And user "user0" exists
  227. And User "user0" from server "LOCAL" shares "/PARENT" with user "user1" from server "REMOTE"
  228. And User "user1" from server "REMOTE" accepts last pending share
  229. And Using server "REMOTE"
  230. And As an "user1"
  231. And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA"
  232. #When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/PARENT (2)/textfile0.txt"
  233. #And Downloading file "/PARENT (2)/textfile0.txt" with range "bytes=0-8"
  234. #Then Downloaded content should be "BLABLABLA"
  235. Scenario: Overwrite a federated shared file as recipient using old chunking
  236. Given Using server "REMOTE"
  237. And user "user1" exists
  238. And user "user2" exists
  239. And Using server "LOCAL"
  240. And user "user0" exists
  241. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  242. And User "user1" from server "REMOTE" accepts last pending share
  243. And Using server "REMOTE"
  244. And As an "user1"
  245. #And user "user1" uploads chunk file "1" of "3" with "AAAAA" to "/textfile0 (2).txt"
  246. #And user "user1" uploads chunk file "2" of "3" with "BBBBB" to "/textfile0 (2).txt"
  247. #And user "user1" uploads chunk file "3" of "3" with "CCCCC" to "/textfile0 (2).txt"
  248. #When Downloading file "/textfile0 (2).txt" with range "bytes=0-4"
  249. #Then Downloaded content should be "AAAAA"
  250. Scenario: Overwrite a federated shared folder as recipient using old chunking
  251. Given Using server "REMOTE"
  252. And user "user1" exists
  253. And user "user2" exists
  254. And Using server "LOCAL"
  255. And user "user0" exists
  256. And User "user0" from server "LOCAL" shares "/PARENT" with user "user1" from server "REMOTE"
  257. And User "user1" from server "REMOTE" accepts last pending share
  258. And Using server "REMOTE"
  259. And As an "user1"
  260. #And user "user1" uploads chunk file "1" of "3" with "AAAAA" to "/PARENT (2)/textfile0.txt"
  261. #And user "user1" uploads chunk file "2" of "3" with "BBBBB" to "/PARENT (2)/textfile0.txt"
  262. #And user "user1" uploads chunk file "3" of "3" with "CCCCC" to "/PARENT (2)/textfile0.txt"
  263. #When Downloading file "/PARENT (2)/textfile0.txt" with range "bytes=3-13"
  264. #Then Downloaded content should be "AABBBBBCCCC"
  265. Scenario: List federated share from another server not accepted yet
  266. Given Using server "LOCAL"
  267. And user "user0" exists
  268. Given Using server "REMOTE"
  269. And user "user1" exists
  270. # Rename file so it has a unique name in the target server (as the target
  271. # server may have its own /textfile0.txt" file)
  272. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  273. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  274. And Using server "LOCAL"
  275. When As an "user0"
  276. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  277. Then the list of returned shares has 0 shares
  278. Scenario: List federated share from another server
  279. Given Using server "LOCAL"
  280. And user "user0" exists
  281. Given Using server "REMOTE"
  282. And user "user1" exists
  283. # Rename file so it has a unique name in the target server (as the target
  284. # server may have its own /textfile0.txt" file)
  285. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  286. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  287. And Using server "LOCAL"
  288. And User "user0" from server "LOCAL" accepts last pending share
  289. When As an "user0"
  290. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  291. Then the list of returned shares has 1 shares
  292. And remote share 0 is returned with
  293. | remote | http://localhost:8180/ |
  294. | name | /remote-share.txt |
  295. | owner | user1 |
  296. | user | user0 |
  297. | mountpoint | /remote-share.txt |
  298. | mimetype | text/plain |
  299. | mtime | A_NUMBER |
  300. | permissions | 27 |
  301. | type | file |
  302. | file_id | A_NUMBER |
  303. Scenario: List federated share from another server no longer reachable
  304. Given Using server "LOCAL"
  305. And user "user0" exists
  306. Given Using server "REMOTE"
  307. And user "user1" exists
  308. # Rename file so it has a unique name in the target server (as the target
  309. # server may have its own /textfile0.txt" file)
  310. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  311. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  312. And Using server "LOCAL"
  313. And User "user0" from server "LOCAL" accepts last pending share
  314. And remote server is stopped
  315. When As an "user0"
  316. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  317. Then the list of returned shares has 1 shares
  318. And remote share 0 is returned with
  319. | remote | http://localhost:8180/ |
  320. | name | /remote-share.txt |
  321. | owner | user1 |
  322. | user | user0 |
  323. | mountpoint | /remote-share.txt |
  324. Scenario: List federated share from another server no longer reachable after caching the file entry
  325. Given Using server "LOCAL"
  326. And user "user0" exists
  327. Given Using server "REMOTE"
  328. And user "user1" exists
  329. # Rename file so it has a unique name in the target server (as the target
  330. # server may have its own /textfile0.txt" file)
  331. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  332. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  333. And Using server "LOCAL"
  334. And User "user0" from server "LOCAL" accepts last pending share
  335. # Checking that the file exists caches the file entry, which causes an
  336. # exception to be thrown when getting the file info if the remote server is
  337. # unreachable.
  338. And as "user0" the file "/remote-share.txt" exists
  339. And remote server is stopped
  340. When As an "user0"
  341. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  342. Then the list of returned shares has 1 shares
  343. And remote share 0 is returned with
  344. | remote | http://localhost:8180/ |
  345. | name | /remote-share.txt |
  346. | owner | user1 |
  347. | user | user0 |
  348. | mountpoint | /remote-share.txt |
  349. Scenario: Delete federated share with another server
  350. Given Using server "LOCAL"
  351. And user "user0" exists
  352. Given Using server "REMOTE"
  353. And user "user1" exists
  354. # Rename file so it has a unique name in the target server (as the target
  355. # server may have its own /textfile0.txt" file)
  356. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  357. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  358. And As an "user1"
  359. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  360. And the list of returned shares has 1 shares
  361. And Using server "LOCAL"
  362. And User "user0" from server "LOCAL" accepts last pending share
  363. And as "user0" the file "/remote-share.txt" exists
  364. And As an "user0"
  365. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  366. And the list of returned shares has 1 shares
  367. And Using server "REMOTE"
  368. When As an "user1"
  369. And Deleting last share
  370. Then the OCS status code should be "100"
  371. And the HTTP status code should be "200"
  372. And As an "user1"
  373. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  374. And the list of returned shares has 0 shares
  375. And Using server "LOCAL"
  376. And as "user0" the file "/remote-share.txt" does not exist
  377. And As an "user0"
  378. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  379. And the list of returned shares has 0 shares
  380. Scenario: Delete federated share from another server
  381. Given Using server "LOCAL"
  382. And user "user0" exists
  383. Given Using server "REMOTE"
  384. And user "user1" exists
  385. # Rename file so it has a unique name in the target server (as the target
  386. # server may have its own /textfile0.txt" file)
  387. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  388. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  389. And As an "user1"
  390. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  391. And the list of returned shares has 1 shares
  392. And Using server "LOCAL"
  393. And User "user0" from server "LOCAL" accepts last pending share
  394. And as "user0" the file "/remote-share.txt" exists
  395. And As an "user0"
  396. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  397. And the list of returned shares has 1 shares
  398. When user "user0" deletes last accepted remote share
  399. Then the OCS status code should be "100"
  400. And the HTTP status code should be "200"
  401. And as "user0" the file "/remote-share.txt" does not exist
  402. And As an "user0"
  403. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  404. And the list of returned shares has 0 shares
  405. And Using server "REMOTE"
  406. And As an "user1"
  407. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  408. And the list of returned shares has 0 shares
  409. Scenario: Delete federated share from another server no longer reachable
  410. Given Using server "LOCAL"
  411. And user "user0" exists
  412. Given Using server "REMOTE"
  413. And user "user1" exists
  414. # Rename file so it has a unique name in the target server (as the target
  415. # server may have its own /textfile0.txt" file)
  416. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  417. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  418. And Using server "LOCAL"
  419. And User "user0" from server "LOCAL" accepts last pending share
  420. And as "user0" the file "/remote-share.txt" exists
  421. And As an "user0"
  422. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  423. And the list of returned shares has 1 shares
  424. And remote server is stopped
  425. When user "user0" deletes last accepted remote share
  426. Then the OCS status code should be "100"
  427. And the HTTP status code should be "200"
  428. And as "user0" the file "/remote-share.txt" does not exist
  429. And As an "user0"
  430. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  431. And the list of returned shares has 0 shares
  432. Scenario: Delete federated share file from another server
  433. Given Using server "LOCAL"
  434. And user "user0" exists
  435. Given Using server "REMOTE"
  436. And user "user1" exists
  437. # Rename file so it has a unique name in the target server (as the target
  438. # server may have its own /textfile0.txt" file)
  439. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  440. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  441. And As an "user1"
  442. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  443. And the list of returned shares has 1 shares
  444. And Using server "LOCAL"
  445. And User "user0" from server "LOCAL" accepts last pending share
  446. And as "user0" the file "/remote-share.txt" exists
  447. And As an "user0"
  448. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  449. And the list of returned shares has 1 shares
  450. When User "user0" deletes file "/remote-share.txt"
  451. Then the HTTP status code should be "204"
  452. And as "user0" the file "/remote-share.txt" does not exist
  453. And As an "user0"
  454. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  455. And the list of returned shares has 0 shares
  456. And Using server "REMOTE"
  457. And As an "user1"
  458. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  459. And the list of returned shares has 0 shares
  460. Scenario: Delete federated share file from another server no longer reachable
  461. Given Using server "LOCAL"
  462. And user "user0" exists
  463. Given Using server "REMOTE"
  464. And user "user1" exists
  465. # Rename file so it has a unique name in the target server (as the target
  466. # server may have its own /textfile0.txt" file)
  467. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  468. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  469. And Using server "LOCAL"
  470. And User "user0" from server "LOCAL" accepts last pending share
  471. And as "user0" the file "/remote-share.txt" exists
  472. And As an "user0"
  473. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  474. And the list of returned shares has 1 shares
  475. And remote server is stopped
  476. When User "user0" deletes file "/remote-share.txt"
  477. Then the HTTP status code should be "204"
  478. And as "user0" the file "/remote-share.txt" does not exist
  479. And As an "user0"
  480. And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
  481. And the list of returned shares has 0 shares