aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-07-18 21:17:42 -0700
committerchrislu <chris.lu@gmail.com>2025-07-18 21:17:42 -0700
commitaec8542b6ea0586158ea919b394fa5d7a4fe35cf (patch)
treec2646ae79ac00401aac13e2345972f5a6c20e20c
parent8fb9df72ae5648a938d9d5b741f214fe7401f6ab (diff)
downloadseaweedfs-aec8542b6ea0586158ea919b394fa5d7a4fe35cf.tar.xz
seaweedfs-aec8542b6ea0586158ea919b394fa5d7a4fe35cf.zip
fix test itself
-rw-r--r--test/s3/retention/s3_worm_integration_test.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/s3/retention/s3_worm_integration_test.go b/test/s3/retention/s3_worm_integration_test.go
index f6a81a49e..19010092c 100644
--- a/test/s3/retention/s3_worm_integration_test.go
+++ b/test/s3/retention/s3_worm_integration_test.go
@@ -42,17 +42,26 @@ func TestWORMRetentionIntegration(t *testing.T) {
})
require.NoError(t, err)
- // Try to delete - should fail due to retention
+ // Try simple DELETE - should succeed and create delete marker (AWS S3 behavior)
_, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
Bucket: aws.String(bucketName),
Key: aws.String(key),
})
- require.Error(t, err)
+ require.NoError(t, err, "Simple DELETE should succeed and create delete marker")
+
+ // Try DELETE with version ID - should fail due to GOVERNANCE retention
+ _, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
+ Bucket: aws.String(bucketName),
+ Key: aws.String(key),
+ VersionId: putResp.VersionId,
+ })
+ require.Error(t, err, "DELETE with version ID should be blocked by GOVERNANCE retention")
- // Delete with bypass should succeed
+ // Delete with version ID and bypass should succeed
_, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
Bucket: aws.String(bucketName),
Key: aws.String(key),
+ VersionId: putResp.VersionId,
BypassGovernanceRetention: aws.Bool(true),
})
require.NoError(t, err)