Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix federated group shares when no longer found in remote server #44587

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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>
  • Loading branch information
danxuliu committed Apr 2, 2024
commit 514ce8658d40030f54beb02c61bf851a65a2f2fe
146 changes: 146 additions & 0 deletions build/integration/federation_features/federated.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down