From 514ce8658d40030f54beb02c61bf851a65a2f2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 22 Mar 2024 14:14:06 +0100 Subject: [PATCH] test: Add integration tests for deleting federated group shares with remote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../federation_features/federated.feature | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/build/integration/federation_features/federated.feature b/build/integration/federation_features/federated.feature index 2552b79b458..033eeecdef1 100644 --- a/build/integration/federation_features/federated.feature +++ b/build/integration/federation_features/federated.feature @@ -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