cleanup-remote-storage.feature 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: cleanup-remote-storage
  4. Background:
  5. Given using api version "1"
  6. Scenario: cleanup remote storage with no storage
  7. Given Using server "LOCAL"
  8. And user "user0" exists
  9. Given Using server "REMOTE"
  10. And user "user1" exists
  11. # Rename file so it has a unique name in the target server (as the target
  12. # server may have its own /textfile0.txt" file)
  13. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  14. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  15. And As an "user1"
  16. And Deleting last share
  17. And the OCS status code should be "100"
  18. And the HTTP status code should be "200"
  19. And Deleting last share
  20. And Using server "LOCAL"
  21. When invoking occ with "sharing:cleanup-remote-storage"
  22. Then the command was successful
  23. And the command output contains the text "0 remote storage(s) need(s) to be checked"
  24. And the command output contains the text "0 remote share(s) exist"
  25. And the command output contains the text "no storages deleted"
  26. Scenario: cleanup remote storage with active storages
  27. Given Using server "LOCAL"
  28. And user "user0" exists
  29. Given Using server "REMOTE"
  30. And user "user1" exists
  31. # Rename file so it has a unique name in the target server (as the target
  32. # server may have its own /textfile0.txt" file)
  33. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  34. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  35. And Using server "LOCAL"
  36. # Accept and download the file to ensure that a storage is created for the
  37. # federated share
  38. And User "user0" from server "LOCAL" accepts last pending share
  39. And As an "user0"
  40. And Downloading file "/remote-share.txt"
  41. And the HTTP status code should be "200"
  42. When invoking occ with "sharing:cleanup-remote-storage"
  43. Then the command was successful
  44. And the command output contains the text "1 remote storage(s) need(s) to be checked"
  45. And the command output contains the text "1 remote share(s) exist"
  46. And the command output contains the text "no storages deleted"
  47. Scenario: cleanup remote storage with inactive storages
  48. Given Using server "LOCAL"
  49. And user "user0" exists
  50. Given Using server "REMOTE"
  51. And user "user1" exists
  52. # Rename file so it has a unique name in the target server (as the target
  53. # server may have its own /textfile0.txt" file)
  54. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  55. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  56. And Using server "LOCAL"
  57. # Accept and download the file to ensure that a storage is created for the
  58. # federated share
  59. And User "user0" from server "LOCAL" accepts last pending share
  60. And As an "user0"
  61. And Downloading file "/remote-share.txt"
  62. And the HTTP status code should be "200"
  63. And Using server "REMOTE"
  64. And As an "user1"
  65. And Deleting last share
  66. And the OCS status code should be "100"
  67. And the HTTP status code should be "200"
  68. When Using server "LOCAL"
  69. And invoking occ with "sharing:cleanup-remote-storage"
  70. Then the command was successful
  71. And the command output contains the text "1 remote storage(s) need(s) to be checked"
  72. And the command output contains the text "0 remote share(s) exist"
  73. And the command output contains the text "deleted 1 storage"