federated.feature 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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@REMOTE |
  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@LOCAL |
  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"