federated.feature 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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: Federate share a file with local server
  30. Given Using server "LOCAL"
  31. And user "user0" exists
  32. And Using server "REMOTE"
  33. And user "user1" exists
  34. When User "user1" from server "REMOTE" shares "/textfile0.txt" with user "user0" from server "LOCAL"
  35. Then the OCS status code should be "100"
  36. And the HTTP status code should be "200"
  37. And Share fields of last share match with
  38. | id | A_NUMBER |
  39. | item_type | file |
  40. | item_source | A_NUMBER |
  41. | share_type | 6 |
  42. | file_source | A_NUMBER |
  43. | path | /textfile0.txt |
  44. | permissions | 19 |
  45. | stime | A_NUMBER |
  46. | storage | A_NUMBER |
  47. | mail_send | 0 |
  48. | uid_owner | user1 |
  49. | storage_id | home::user1 |
  50. | file_parent | A_NUMBER |
  51. | displayname_owner | user1 |
  52. | share_with | user0@LOCAL |
  53. | share_with_displayname | user0@LOCAL |
  54. Scenario: Remote sharee can see the pending share
  55. Given Using server "REMOTE"
  56. And user "user1" exists
  57. And Using server "LOCAL"
  58. And user "user0" exists
  59. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  60. And Using server "REMOTE"
  61. And As an "user1"
  62. When sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
  63. Then the OCS status code should be "100"
  64. And the HTTP status code should be "200"
  65. And Share fields of last share match with
  66. | id | A_NUMBER |
  67. | remote | LOCAL |
  68. | remote_id | A_NUMBER |
  69. | share_token | A_TOKEN |
  70. | name | /textfile0.txt |
  71. | owner | user0 |
  72. | user | user1 |
  73. | mountpoint | {{TemporaryMountPointName#/textfile0.txt}} |
  74. | accepted | 0 |
  75. Scenario: accept a pending remote share
  76. Given Using server "REMOTE"
  77. And user "user1" exists
  78. And Using server "LOCAL"
  79. And user "user0" exists
  80. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  81. When User "user1" from server "REMOTE" accepts last pending share
  82. Then the OCS status code should be "100"
  83. And the HTTP status code should be "200"
  84. Scenario: Reshare a federated shared file
  85. Given Using server "REMOTE"
  86. And user "user1" exists
  87. And user "user2" exists
  88. And Using server "LOCAL"
  89. And user "user0" exists
  90. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  91. And User "user1" from server "REMOTE" accepts last pending share
  92. And Using server "REMOTE"
  93. And As an "user1"
  94. When creating a share with
  95. | path | /textfile0 (2).txt |
  96. | shareType | 0 |
  97. | shareWith | user2 |
  98. | permissions | 19 |
  99. Then the OCS status code should be "100"
  100. And the HTTP status code should be "200"
  101. And Share fields of last share match with
  102. | id | A_NUMBER |
  103. | item_type | file |
  104. | item_source | A_NUMBER |
  105. | share_type | 0 |
  106. | file_source | A_NUMBER |
  107. | path | /textfile0 (2).txt |
  108. | permissions | 19 |
  109. | stime | A_NUMBER |
  110. | storage | A_NUMBER |
  111. | mail_send | 0 |
  112. | uid_owner | user1 |
  113. | file_parent | A_NUMBER |
  114. | displayname_owner | user1 |
  115. | share_with | user2 |
  116. | share_with_displayname | user2 |
  117. Scenario: Overwrite a federated shared file as recipient
  118. Given Using server "REMOTE"
  119. And user "user1" exists
  120. And user "user2" exists
  121. And Using server "LOCAL"
  122. And user "user0" exists
  123. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  124. And User "user1" from server "REMOTE" accepts last pending share
  125. And Using server "REMOTE"
  126. And As an "user1"
  127. And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA"
  128. When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/textfile0 (2).txt"
  129. And Downloading file "/textfile0 (2).txt" with range "bytes=0-8"
  130. Then Downloaded content should be "BLABLABLA"
  131. Scenario: Overwrite a federated shared folder as recipient
  132. Given Using server "REMOTE"
  133. And user "user1" exists
  134. And user "user2" exists
  135. And Using server "LOCAL"
  136. And user "user0" exists
  137. And User "user0" from server "LOCAL" shares "/PARENT" with user "user1" from server "REMOTE"
  138. And User "user1" from server "REMOTE" accepts last pending share
  139. And Using server "REMOTE"
  140. And As an "user1"
  141. And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA"
  142. When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/PARENT (2)/textfile0.txt"
  143. And Downloading file "/PARENT (2)/textfile0.txt" with range "bytes=0-8"
  144. Then Downloaded content should be "BLABLABLA"
  145. Scenario: Overwrite a federated shared file as recipient using old chunking
  146. Given Using server "REMOTE"
  147. And user "user1" exists
  148. And user "user2" exists
  149. And Using server "LOCAL"
  150. And user "user0" exists
  151. And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE"
  152. And User "user1" from server "REMOTE" accepts last pending share
  153. And Using server "REMOTE"
  154. And As an "user1"
  155. And user "user1" uploads chunk file "1" of "3" with "AAAAA" to "/textfile0 (2).txt"
  156. And user "user1" uploads chunk file "2" of "3" with "BBBBB" to "/textfile0 (2).txt"
  157. And user "user1" uploads chunk file "3" of "3" with "CCCCC" to "/textfile0 (2).txt"
  158. When Downloading file "/textfile0 (2).txt" with range "bytes=0-4"
  159. Then Downloaded content should be "AAAAA"
  160. Scenario: Overwrite a federated shared folder as recipient using old chunking
  161. Given Using server "REMOTE"
  162. And user "user1" exists
  163. And user "user2" exists
  164. And Using server "LOCAL"
  165. And user "user0" exists
  166. And User "user0" from server "LOCAL" shares "/PARENT" with user "user1" from server "REMOTE"
  167. And User "user1" from server "REMOTE" accepts last pending share
  168. And Using server "REMOTE"
  169. And As an "user1"
  170. And user "user1" uploads chunk file "1" of "3" with "AAAAA" to "/PARENT (2)/textfile0.txt"
  171. And user "user1" uploads chunk file "2" of "3" with "BBBBB" to "/PARENT (2)/textfile0.txt"
  172. And user "user1" uploads chunk file "3" of "3" with "CCCCC" to "/PARENT (2)/textfile0.txt"
  173. When Downloading file "/PARENT (2)/textfile0.txt" with range "bytes=3-13"
  174. Then Downloaded content should be "AABBBBBCCCC"