diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-13 10:56:21 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-13 10:56:21 -0800 |
| commit | 36b8b2147b55068f65f6c4cacc5645bc3453f173 (patch) | |
| tree | bd756c94a599d2d6d68edfd4e7bfbd127aca0a36 /weed/s3api/s3api_server.go | |
| parent | 93cca3a96bd43179173f2f56f8053c9d26db72e2 (diff) | |
| download | seaweedfs-36b8b2147b55068f65f6c4cacc5645bc3453f173.tar.xz seaweedfs-36b8b2147b55068f65f6c4cacc5645bc3453f173.zip | |
test: add integration test for versioned object listing path fix (#7731)
* test: add integration test for versioned object listing path fix
Add integration test that validates the fix for GitHub discussion #7573.
The test verifies that:
- Entry names use path.Base() to get base filename only
- Path doubling bug is prevented when listing versioned objects
- Logical entries are created correctly with proper attributes
- .versions folder paths are handled correctly
This test documents the Velero/Kopia compatibility fix and prevents
regression of the path doubling bug.
* test: add Velero/Kopia integration test for versioned object listing
Add integration tests that simulate Velero/Kopia's exact access patterns
when using S3 versioning. These tests validate the fix for GitHub
discussion #7573 where versioned objects with nested paths would have
their paths doubled in ListObjects responses.
Tests added:
- TestVeleroKopiaVersionedObjectListing: Tests various Kopia path patterns
- TestVeleroKopiaGetAfterList: Verifies list-then-get workflow works
- TestVeleroMultipleVersionsWithNestedPaths: Tests multi-version objects
- TestVeleroListVersionsWithNestedPaths: Tests ListObjectVersions API
Each test verifies:
1. Listed keys match original keys without path doubling
2. Objects can be retrieved using the listed keys
3. Content integrity is maintained
Related: https://github.com/seaweedfs/seaweedfs/discussions/7573
* refactor: remove old unit test, keep only Velero integration test
Remove weed/s3api/s3api_versioning_list_test.go as it was a simpler
unit test that the comprehensive Velero integration test supersedes.
The integration test in test/s3/versioning/s3_velero_integration_test.go
provides better coverage by actually exercising the S3 API with real
AWS SDK calls.
* refactor: use defer for response body cleanup in test loop
Use anonymous function with defer for getResp.Body.Close() to be more
defensive against future code additions in the loop body.
* refactor: improve hasDoubledPath function clarity and efficiency
- Fix comment to accurately describe checking for repeated pairs
- Tighten outer loop bound from len(parts)-2 to len(parts)-3
- Remove redundant bounds checks in the condition
Diffstat (limited to 'weed/s3api/s3api_server.go')
0 files changed, 0 insertions, 0 deletions
