1
0

cleanup-remote-storage.feature 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 active storages
  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 Using server "LOCAL"
  16. # Accept and download the file to ensure that a storage is created for the
  17. # federated share
  18. And User "user0" from server "LOCAL" accepts last pending share
  19. And As an "user0"
  20. And Downloading file "/remote-share.txt"
  21. And the HTTP status code should be "200"
  22. When invoking occ with "sharing:cleanup-remote-storage"
  23. Then the command was successful
  24. And the command output contains the text "1 remote storage(s) need(s) to be checked"
  25. And the command output contains the text "1 remote share(s) exist"
  26. And the command output contains the text "no storages deleted"
  27. Scenario: cleanup remote storage with inactive storages
  28. Given Using server "LOCAL"
  29. And user "user0" exists
  30. Given Using server "REMOTE"
  31. And user "user1" exists
  32. # Rename file so it has a unique name in the target server (as the target
  33. # server may have its own /textfile0.txt" file)
  34. And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
  35. And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
  36. And Using server "LOCAL"
  37. # Accept and download the file to ensure that a storage is created for the
  38. # federated share
  39. And User "user0" from server "LOCAL" accepts last pending share
  40. And As an "user0"
  41. And Downloading file "/remote-share.txt"
  42. And the HTTP status code should be "200"
  43. And Using server "REMOTE"
  44. And As an "user1"
  45. And Deleting last share
  46. And the OCS status code should be "100"
  47. And the HTTP status code should be "200"
  48. When Using server "LOCAL"
  49. And invoking occ with "sharing:cleanup-remote-storage"
  50. Then the command was successful
  51. And the command output contains the text "1 remote storage(s) need(s) to be checked"
  52. And the command output contains the text "0 remote share(s) exist"
  53. And the command output contains the text "deleted 1 storage"