mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Support bucket versioning (#9377)
- Implement a new xl.json 2.0.0 format to support, this moves the entire marshaling logic to POSIX layer, top layer always consumes a common FileInfo construct which simplifies the metadata reads. - Implement list object versions - Migrate to siphash from crchash for new deployments for object placements. Fixes #2111
This commit is contained in:
@@ -191,7 +191,7 @@ func testStorageAPIDeleteVol(t *testing.T, storage StorageAPI) {
|
||||
}
|
||||
}
|
||||
|
||||
func testStorageAPIStatFile(t *testing.T, storage StorageAPI) {
|
||||
func testStorageAPICheckFile(t *testing.T, storage StorageAPI) {
|
||||
tmpGlobalServerConfig := globalServerConfig
|
||||
defer func() {
|
||||
globalServerConfig = tmpGlobalServerConfig
|
||||
@@ -202,7 +202,7 @@ func testStorageAPIStatFile(t *testing.T, storage StorageAPI) {
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error %v", err)
|
||||
}
|
||||
err = storage.AppendFile("foo", "myobject", []byte("foo"))
|
||||
err = storage.AppendFile("foo", pathJoin("myobject", xlStorageFormatFile), []byte("foo"))
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error %v", err)
|
||||
}
|
||||
@@ -218,18 +218,12 @@ func testStorageAPIStatFile(t *testing.T, storage StorageAPI) {
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
result, err := storage.StatFile(testCase.volumeName, testCase.objectName)
|
||||
err := storage.CheckFile(testCase.volumeName, testCase.objectName)
|
||||
expectErr := (err != nil)
|
||||
|
||||
if expectErr != testCase.expectErr {
|
||||
t.Fatalf("case %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
|
||||
}
|
||||
|
||||
if !testCase.expectErr {
|
||||
if result.Name != testCase.objectName {
|
||||
t.Fatalf("case %v: result: expected: %+v, got: %+v", i+1, testCase.objectName, result.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +255,7 @@ func testStorageAPIListDir(t *testing.T, storage StorageAPI) {
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
result, err := storage.ListDir(testCase.volumeName, testCase.prefix, -1, "")
|
||||
result, err := storage.ListDir(testCase.volumeName, testCase.prefix, -1)
|
||||
expectErr := (err != nil)
|
||||
|
||||
if expectErr != testCase.expectErr {
|
||||
@@ -586,7 +580,7 @@ func TestStorageRESTClientDeleteVol(t *testing.T) {
|
||||
testStorageAPIDeleteVol(t, restClient)
|
||||
}
|
||||
|
||||
func TestStorageRESTClientStatFile(t *testing.T) {
|
||||
func TestStorageRESTClientCheckFile(t *testing.T) {
|
||||
httpServer, restClient, prevGlobalServerConfig, endpointPath := newStorageRESTHTTPServerClient(t)
|
||||
defer httpServer.Close()
|
||||
defer func() {
|
||||
@@ -594,7 +588,7 @@ func TestStorageRESTClientStatFile(t *testing.T) {
|
||||
}()
|
||||
defer os.RemoveAll(endpointPath)
|
||||
|
||||
testStorageAPIStatFile(t, restClient)
|
||||
testStorageAPICheckFile(t, restClient)
|
||||
}
|
||||
|
||||
func TestStorageRESTClientListDir(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user