test: Add integration tests for deleting federated group shares with remote

When the sharer removes a federated group share it is removed for all
the members of the group that received it. Due to that, if the remote
server was temporary down when the share was removed but once it is
running again a user tries to access the share should be removed for all
of them, rather than being marked as pending for that user (which is not
the current behaviour and will need to be fixed in a follow up commit).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2024-03-22 14:14:06 +01:00
parent 19f71346a7
commit 514ce8658d

View file

@ -401,6 +401,58 @@ Feature: federated
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
Scenario: Delete federated group share with another server
Given Using server "LOCAL"
And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "user0" exists
Given Using server "REMOTE"
And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "group1-user0" exists
And user "group1-user1" exists
And group "group1" exists
And user "group1-user0" belongs to group "group1"
And user "group1-user1" belongs to group "group1"
# Rename file so it has a unique name in the target server (as the target
# server may have its own /textfile0.txt" file)
And User "user0" copies file "/textfile0.txt" to "/remote-share.txt"
And User "user0" from server "LOCAL" shares "/remote-share.txt" with group "group1" from server "REMOTE"
And Using server "LOCAL"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 1 shares
And Using server "REMOTE"
And User "group1-user0" from server "REMOTE" accepts last pending share
And as "group1-user0" the file "/remote-share.txt" exists
And As an "group1-user0"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And User "group1-user1" from server "REMOTE" accepts last pending share
And as "group1-user1" the file "/remote-share.txt" exists
And As an "group1-user1"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And Using server "LOCAL"
When As an "user0"
And Deleting last share
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 0 shares
And Using server "REMOTE"
And as "group1-user0" the file "/remote-share.txt" does not exist
And As an "group1-user0"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
And the list of returned shares has 0 shares
And as "group1-user1" the file "/remote-share.txt" does not exist
And As an "group1-user1"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
And the list of returned shares has 0 shares
Scenario: Delete federated share with another server no longer reachable
Given Using server "LOCAL"
And user "user0" exists
@ -430,6 +482,46 @@ Feature: federated
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 0 shares
Scenario: Delete federated group share with another server no longer reachable
Given Using server "LOCAL"
And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "user0" exists
Given Using server "REMOTE"
And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "group1-user0" exists
And user "group1-user1" exists
And group "group1" exists
And user "group1-user0" belongs to group "group1"
And user "group1-user1" belongs to group "group1"
# Rename file so it has a unique name in the target server (as the target
# server may have its own /textfile0.txt" file)
And User "user0" copies file "/textfile0.txt" to "/remote-share.txt"
And User "user0" from server "LOCAL" shares "/remote-share.txt" with group "group1" from server "REMOTE"
And Using server "LOCAL"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 1 shares
And Using server "REMOTE"
And User "group1-user0" from server "REMOTE" accepts last pending share
And as "group1-user0" the file "/remote-share.txt" exists
And As an "group1-user0"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And User "group1-user1" from server "REMOTE" accepts last pending share
And as "group1-user1" the file "/remote-share.txt" exists
And As an "group1-user1"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And remote server is stopped
And Using server "LOCAL"
When As an "user0"
And Deleting last share
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 0 shares
Scenario: Delete federated share with another server when temporary unreachable
Given Using server "LOCAL"
And user "user0" exists
@ -465,6 +557,60 @@ Feature: federated
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
Scenario: Delete federated group share with another server when temporary unreachable
Given Using server "LOCAL"
And parameter "outgoing_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "user0" exists
Given Using server "REMOTE"
And parameter "incoming_server2server_group_share_enabled" of app "files_sharing" is set to "yes"
And user "group1-user0" exists
And user "group1-user1" exists
And group "group1" exists
And user "group1-user0" belongs to group "group1"
And user "group1-user1" belongs to group "group1"
# Rename file so it has a unique name in the target server (as the target
# server may have its own /textfile0.txt" file)
And User "user0" copies file "/textfile0.txt" to "/remote-share.txt"
And User "user0" from server "LOCAL" shares "/remote-share.txt" with group "group1" from server "REMOTE"
And Using server "LOCAL"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 1 shares
And Using server "REMOTE"
And User "group1-user0" from server "REMOTE" accepts last pending share
And as "group1-user0" the file "/remote-share.txt" exists
And As an "group1-user0"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And User "group1-user1" from server "REMOTE" accepts last pending share
And as "group1-user1" the file "/remote-share.txt" exists
And As an "group1-user1"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 1 shares
And remote server is stopped
And Using server "LOCAL"
When As an "user0"
And Deleting last share
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares"
And the list of returned shares has 0 shares
And remote server is started
And Using server "REMOTE"
And as "group1-user0" the file "/remote-share.txt" does not exist
And As an "group1-user0"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
And the list of returned shares has 0 shares
And as "group1-user1" the file "/remote-share.txt" does not exist
And As an "group1-user1"
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
And the list of returned shares has 0 shares
And sending "GET" to "/apps/files_sharing/api/v1/remote_shares/pending"
And the list of returned shares has 0 shares
Scenario: Delete federated share from another server
Given Using server "LOCAL"
And user "user0" exists