Browse Source

fix test itself

pull/6997/head
chrislu 5 months ago
parent
commit
aec8542b6e
  1. 15
      test/s3/retention/s3_worm_integration_test.go

15
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")
// Delete with bypass should succeed
// 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 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)

Loading…
Cancel
Save