Skip to content

test(decomposedfs): assert a space manager may disable a project space - #730

Merged
rhafer merged 1 commit into
opencloud-eu:mainfrom
michaelstingl:test/space-manager-disable
Jul 7, 2026
Merged

rhafer merged 1 commit into
opencloud-eu:mainfrom
michaelstingl:test/space-manager-disable

Conversation

@michaelstingl

Copy link
Copy Markdown

Description

Adds one test to the can delete (purge) project spaces context in pkg/storage/pkg/decomposedfs/spaces_test.go: succeeds at disabling as a space manager. It creates a fresh project space and disables it as env.SpaceManager, expecting success. This exercises the !purge && IsManager(rp) branch of canDeleteSpace. A fresh space is used because BeforeEach pre-disables the shared one.

Related Issue

None. Covers the disable-allowed half of the manager permission split from #672.

Motivation and Context

Since #672 a space manager may disable but not purge a project space. The context asserts only the denial side (fails as a space manager); the disable case was untested, so a regression breaking manager disable would pass unnoticed. #716 realigned the purge tests here but did not add this assertion. Supersedes the disable half of #709 (now closed).

How Has This Been Tested?

  • golang:1.25 container, source on an ext4 volume for user.* xattr support (native macOS is unreliable for these tests)
  • go test ./pkg/storage/pkg/decomposedfs/: both space-manager specs pass (fails as a space manager and the new one)
  • gofmt, go vet, golangci-lint v2.10.1: clean on the package

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added (n/a: reva builds the changelog from the PR title and Type:* label via ready-release-go, so no fragment is needed)

🤖 drafted with Claude Code, reviewed before submitting.

Since opencloud-eu#672 a space manager may disable but not purge a project space.
The "can delete (purge) project spaces" context asserts only the denial
side ("fails as a space manager" purge); the positive counterpart, that a
manager may still disable, was untested. A regression breaking manager
disable would pass the suite unnoticed.

Add the counterpart It: create a fresh project space and disable it as
the space manager, expecting success (the shared space in BeforeEach is
already disabled, so the test uses its own). Test-only, no production
change.
@rhafer
rhafer merged commit bff534f into opencloud-eu:main Jul 7, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants