2022-06-15 12:17:29 +00:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
2022-07-25 13:00:35 +00:00
|
|
|
"bytes"
|
2022-06-15 12:17:29 +00:00
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/nspcc-dev/neofs-s3-gw/api"
|
2022-06-24 12:39:30 +00:00
|
|
|
"github.com/nspcc-dev/neofs-s3-gw/api/data"
|
2022-06-15 12:17:29 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
const (
|
|
|
|
emptyVersion = ""
|
|
|
|
)
|
|
|
|
|
2022-07-21 09:05:47 +00:00
|
|
|
func TestDeleteBucket(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
_, objInfo := createVersionedBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
deleteMarkerVersion, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
|
|
|
|
2022-07-21 09:05:47 +00:00
|
|
|
deleteBucket(t, tc, bktName, http.StatusConflict)
|
2022-08-04 17:31:33 +00:00
|
|
|
deleteObject(t, tc, bktName, objName, objInfo.VersionID())
|
2022-07-21 09:05:47 +00:00
|
|
|
deleteBucket(t, tc, bktName, http.StatusConflict)
|
2022-07-25 13:00:35 +00:00
|
|
|
deleteObject(t, tc, bktName, objName, deleteMarkerVersion)
|
2022-07-21 09:05:47 +00:00
|
|
|
deleteBucket(t, tc, bktName, http.StatusNoContent)
|
|
|
|
}
|
|
|
|
|
2022-06-15 12:17:29 +00:00
|
|
|
func TestDeleteObject(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createBucketAndObject(t, tc, bktName, objName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
require.False(t, existInMockedNeoFS(tc, bktInfo, objInfo))
|
|
|
|
}
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
func TestDeleteObjectFromSuspended(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
bktName, objName := "bucket-versioned-for-removal", "object-to-delete"
|
|
|
|
|
|
|
|
createSuspendedBucket(t, tc, bktName)
|
|
|
|
putObject(t, tc, bktName, objName)
|
|
|
|
|
|
|
|
versionID, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
2022-08-05 01:41:33 +00:00
|
|
|
require.Equal(t, data.UnversionedObjectVersionID, versionID)
|
2022-07-25 13:00:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestDeleteDeletedObject(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
t.Run("unversioned bucket", func(t *testing.T) {
|
|
|
|
bktName, objName := "bucket-unversioned-removal", "object-to-delete"
|
|
|
|
createBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
|
|
|
versionID, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.Empty(t, versionID)
|
|
|
|
require.False(t, isDeleteMarker)
|
|
|
|
versionID, isDeleteMarker = deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.Empty(t, versionID)
|
|
|
|
require.False(t, isDeleteMarker)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("versioned bucket", func(t *testing.T) {
|
|
|
|
bktName, objName := "bucket-versioned-for-removal", "object-to-delete"
|
|
|
|
createVersionedBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
|
|
|
_, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
|
|
|
_, isDeleteMarker = deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("versioned bucket not found obj", func(t *testing.T) {
|
|
|
|
bktName, objName := "bucket-versioned-for-removal", "object-to-delete"
|
|
|
|
_, objInfo := createVersionedBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
2022-08-04 17:31:33 +00:00
|
|
|
versionID, isDeleteMarker := deleteObject(t, tc, bktName, objName, objInfo.VersionID())
|
2022-07-25 13:00:35 +00:00
|
|
|
require.False(t, isDeleteMarker)
|
2022-08-04 17:31:33 +00:00
|
|
|
require.Equal(t, objInfo.VersionID(), versionID)
|
2022-07-25 13:00:35 +00:00
|
|
|
|
|
|
|
versionID2, isDeleteMarker := deleteObject(t, tc, bktName, objName, versionID)
|
|
|
|
require.False(t, isDeleteMarker)
|
2022-08-04 17:31:33 +00:00
|
|
|
require.Equal(t, objInfo.VersionID(), versionID2)
|
2022-07-25 13:00:35 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func TestDeleteObjectVersioned(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createVersionedBucketAndObject(t, tc, bktName, objName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
|
2022-08-04 17:31:33 +00:00
|
|
|
checkFound(t, tc, bktName, objName, objInfo.VersionID())
|
|
|
|
deleteObject(t, tc, bktName, objName, objInfo.VersionID())
|
|
|
|
checkNotFound(t, tc, bktName, objName, objInfo.VersionID())
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
require.False(t, existInMockedNeoFS(tc, bktInfo, objInfo), "object exists but shouldn't")
|
2022-06-15 12:17:29 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 09:32:31 +00:00
|
|
|
func TestDeleteObjectUnversioned(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
bktName, objName := "bucket-for-removal-unversioned", "object-to-delete-unversioned"
|
|
|
|
bktInfo, objInfo := createBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
|
|
|
|
versions := listVersions(t, tc, bktName)
|
|
|
|
require.Len(t, versions.DeleteMarker, 0, "delete markers must be empty")
|
|
|
|
require.Len(t, versions.Version, 0, "versions must be empty")
|
|
|
|
|
|
|
|
require.False(t, existInMockedNeoFS(tc, bktInfo, objInfo), "object exists but shouldn't")
|
|
|
|
}
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func TestRemoveDeleteMarker(t *testing.T) {
|
2022-06-15 12:17:29 +00:00
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createVersionedBucketAndObject(t, tc, bktName, objName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
2022-07-25 13:00:35 +00:00
|
|
|
deleteMarkerVersion, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
2022-06-24 12:39:30 +00:00
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-08-04 17:31:33 +00:00
|
|
|
checkFound(t, tc, bktName, objName, objInfo.VersionID())
|
2022-06-24 12:39:30 +00:00
|
|
|
deleteObject(t, tc, bktName, objName, deleteMarkerVersion)
|
2022-07-05 08:04:21 +00:00
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
require.True(t, existInMockedNeoFS(tc, bktInfo, objInfo), "object doesn't exist but should")
|
|
|
|
}
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func TestDeleteObjectCombined(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createBucketAndObject(t, tc, bktName, objName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
putBucketVersioning(t, tc, bktName, true)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-08-04 17:31:33 +00:00
|
|
|
checkFound(t, tc, bktName, objName, objInfo.VersionID())
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
require.True(t, existInMockedNeoFS(tc, bktInfo, objInfo), "object doesn't exist but should")
|
2022-06-15 12:17:29 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func TestDeleteObjectSuspended(t *testing.T) {
|
2022-06-15 12:17:29 +00:00
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
|
|
|
putBucketVersioning(t, tc, bktName, true)
|
|
|
|
|
|
|
|
checkFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
|
|
|
|
putBucketVersioning(t, tc, bktName, false)
|
|
|
|
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
2022-08-04 17:31:33 +00:00
|
|
|
checkNotFound(t, tc, bktName, objName, objInfo.VersionID())
|
2022-06-24 12:39:30 +00:00
|
|
|
|
|
|
|
require.False(t, existInMockedNeoFS(tc, bktInfo, objInfo), "object exists but shouldn't")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDeleteMarkers(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
createTestBucket(tc.Context(), t, tc, bktName)
|
|
|
|
putBucketVersioning(t, tc, bktName, true)
|
|
|
|
|
|
|
|
checkNotFound(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
|
|
|
|
versions := listVersions(t, tc, bktName)
|
|
|
|
require.Len(t, versions.DeleteMarker, 3, "invalid delete markers length")
|
|
|
|
require.Len(t, versions.Version, 0, "versions must be empty")
|
|
|
|
|
2022-08-22 08:02:58 +00:00
|
|
|
require.Len(t, listOIDsFromMockedNeoFS(t, tc, bktName), 0, "shouldn't be any object in neofs")
|
2022-06-24 12:39:30 +00:00
|
|
|
}
|
|
|
|
|
2022-07-05 06:25:23 +00:00
|
|
|
func TestDeleteObjectFromListCache(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
bktInfo, objInfo := createVersionedBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
2022-08-13 10:03:49 +00:00
|
|
|
versions := listObjectsV1(t, tc, bktName, "", "", "", -1)
|
2022-07-05 06:25:23 +00:00
|
|
|
require.Len(t, versions.Contents, 1)
|
|
|
|
|
2022-08-04 17:31:33 +00:00
|
|
|
checkFound(t, tc, bktName, objName, objInfo.VersionID())
|
|
|
|
deleteObject(t, tc, bktName, objName, objInfo.VersionID())
|
|
|
|
checkNotFound(t, tc, bktName, objName, objInfo.VersionID())
|
2022-07-05 06:25:23 +00:00
|
|
|
|
|
|
|
// check cache is clean after object removal
|
2022-08-13 10:03:49 +00:00
|
|
|
versions = listObjectsV1(t, tc, bktName, "", "", "", -1)
|
2022-07-05 06:25:23 +00:00
|
|
|
require.Len(t, versions.Contents, 0)
|
|
|
|
|
|
|
|
require.False(t, existInMockedNeoFS(tc, bktInfo, objInfo))
|
|
|
|
}
|
|
|
|
|
2022-07-05 08:04:21 +00:00
|
|
|
func TestDeleteObjectCheckMarkerReturn(t *testing.T) {
|
|
|
|
tc := prepareHandlerContext(t)
|
|
|
|
|
|
|
|
bktName, objName := "bucket-for-removal", "object-to-delete"
|
|
|
|
createVersionedBucketAndObject(t, tc, bktName, objName)
|
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
deleteMarkerVersion, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion)
|
|
|
|
require.True(t, isDeleteMarker)
|
2022-07-05 08:04:21 +00:00
|
|
|
|
|
|
|
versions := listVersions(t, tc, bktName)
|
|
|
|
require.Len(t, versions.DeleteMarker, 1)
|
2022-07-25 13:00:35 +00:00
|
|
|
require.Equal(t, deleteMarkerVersion, versions.DeleteMarker[0].VersionID)
|
2022-07-05 08:04:21 +00:00
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
deleteMarkerVersion2, isDeleteMarker2 := deleteObject(t, tc, bktName, objName, deleteMarkerVersion)
|
|
|
|
require.True(t, isDeleteMarker2)
|
2022-07-05 08:04:21 +00:00
|
|
|
versions = listVersions(t, tc, bktName)
|
|
|
|
require.Len(t, versions.DeleteMarker, 0)
|
2022-07-25 13:00:35 +00:00
|
|
|
require.Equal(t, deleteMarkerVersion, deleteMarkerVersion2)
|
2022-07-05 08:04:21 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func createBucketAndObject(t *testing.T, tc *handlerContext, bktName, objName string) (*data.BucketInfo, *data.ObjectInfo) {
|
2022-08-01 16:52:09 +00:00
|
|
|
bktInfo := createTestBucket(tc.Context(), t, tc, bktName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
objInfo := createTestObject(tc.Context(), t, tc, bktInfo, objName)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
return bktInfo, objInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
func createVersionedBucketAndObject(t *testing.T, tc *handlerContext, bktName, objName string) (*data.BucketInfo, *data.ObjectInfo) {
|
|
|
|
createTestBucket(tc.Context(), t, tc, bktName)
|
|
|
|
bktInfo, err := tc.Layer().GetBucketInfo(tc.Context(), bktName)
|
|
|
|
require.NoError(t, err)
|
|
|
|
putBucketVersioning(t, tc, bktName, true)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
objInfo := createTestObject(tc.Context(), t, tc, bktInfo, objName)
|
|
|
|
|
|
|
|
return bktInfo, objInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
func putBucketVersioning(t *testing.T, tc *handlerContext, bktName string, enabled bool) {
|
|
|
|
cfg := &VersioningConfiguration{Status: "Suspended"}
|
|
|
|
if enabled {
|
|
|
|
cfg.Status = "Enabled"
|
|
|
|
}
|
|
|
|
w, r := prepareTestRequest(t, bktName, "", cfg)
|
2022-06-15 12:17:29 +00:00
|
|
|
tc.Handler().PutBucketVersioningHandler(w, r)
|
|
|
|
assertStatus(t, w, http.StatusOK)
|
2022-06-24 12:39:30 +00:00
|
|
|
}
|
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
func deleteObject(t *testing.T, tc *handlerContext, bktName, objName, version string) (string, bool) {
|
2022-06-24 12:39:30 +00:00
|
|
|
query := make(url.Values)
|
|
|
|
query.Add(api.QueryVersionID, version)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
w, r := prepareTestFullRequest(t, bktName, objName, query, nil)
|
2022-06-15 12:17:29 +00:00
|
|
|
tc.Handler().DeleteObjectHandler(w, r)
|
|
|
|
assertStatus(t, w, http.StatusNoContent)
|
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
return w.Header().Get(api.AmzVersionID), w.Header().Get(api.AmzDeleteMarker) != ""
|
2022-06-24 12:39:30 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 09:05:47 +00:00
|
|
|
func deleteBucket(t *testing.T, tc *handlerContext, bktName string, code int) {
|
|
|
|
w, r := prepareTestRequest(t, bktName, "", nil)
|
|
|
|
tc.Handler().DeleteBucketHandler(w, r)
|
|
|
|
assertStatus(t, w, code)
|
|
|
|
}
|
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func checkNotFound(t *testing.T, tc *handlerContext, bktName, objName, version string) {
|
|
|
|
query := make(url.Values)
|
|
|
|
query.Add(api.QueryVersionID, version)
|
|
|
|
|
|
|
|
w, r := prepareTestFullRequest(t, bktName, objName, query, nil)
|
2022-06-15 12:17:29 +00:00
|
|
|
tc.Handler().HeadObjectHandler(w, r)
|
|
|
|
assertStatus(t, w, http.StatusNotFound)
|
2022-06-24 12:39:30 +00:00
|
|
|
}
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func checkFound(t *testing.T, tc *handlerContext, bktName, objName, version string) {
|
2022-06-15 12:17:29 +00:00
|
|
|
query := make(url.Values)
|
2022-06-24 12:39:30 +00:00
|
|
|
query.Add(api.QueryVersionID, version)
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
w, r := prepareTestFullRequest(t, bktName, objName, query, nil)
|
2022-06-15 12:17:29 +00:00
|
|
|
tc.Handler().HeadObjectHandler(w, r)
|
2022-06-24 12:39:30 +00:00
|
|
|
assertStatus(t, w, http.StatusOK)
|
|
|
|
}
|
2022-06-15 12:17:29 +00:00
|
|
|
|
2022-06-24 12:39:30 +00:00
|
|
|
func listVersions(t *testing.T, tc *handlerContext, bktName string) *ListObjectsVersionsResponse {
|
|
|
|
w, r := prepareTestRequest(t, bktName, "", nil)
|
|
|
|
tc.Handler().ListBucketObjectVersionsHandler(w, r)
|
|
|
|
assertStatus(t, w, http.StatusOK)
|
|
|
|
res := &ListObjectsVersionsResponse{}
|
|
|
|
parseTestResponse(t, w, res)
|
|
|
|
return res
|
2022-06-15 12:17:29 +00:00
|
|
|
}
|
2022-07-05 06:25:23 +00:00
|
|
|
|
2022-07-25 13:00:35 +00:00
|
|
|
func putObject(t *testing.T, tc *handlerContext, bktName, objName string) {
|
|
|
|
body := bytes.NewReader([]byte("content"))
|
|
|
|
w, r := prepareTestPayloadRequest(bktName, objName, body)
|
|
|
|
tc.Handler().PutObjectHandler(w, r)
|
|
|
|
assertStatus(t, w, http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func createSuspendedBucket(t *testing.T, tc *handlerContext, bktName string) *data.BucketInfo {
|
|
|
|
createTestBucket(tc.Context(), t, tc, bktName)
|
|
|
|
bktInfo, err := tc.Layer().GetBucketInfo(tc.Context(), bktName)
|
|
|
|
require.NoError(t, err)
|
|
|
|
putBucketVersioning(t, tc, bktName, false)
|
|
|
|
return bktInfo
|
|
|
|
}
|