2016-06-29 12:13:44 +02:00
|
|
|
/*
|
2017-01-18 21:24:34 +01:00
|
|
|
* Minio Cloud Storage, (C) 2016, 2017 Minio, Inc.
|
2016-06-29 12:13:44 +02:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2016-08-19 01:23:42 +02:00
|
|
|
package cmd
|
2016-06-29 12:13:44 +02:00
|
|
|
|
|
|
|
import (
|
2016-09-13 20:01:10 +02:00
|
|
|
"bytes"
|
2017-01-17 02:05:00 +01:00
|
|
|
"fmt"
|
|
|
|
"os"
|
2016-06-29 12:13:44 +02:00
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestNewFS - tests initialization of all input disks
|
|
|
|
// and constructs a valid `FS` object layer.
|
|
|
|
func TestNewFS(t *testing.T) {
|
|
|
|
// Do not attempt to create this path, the test validates
|
2017-01-17 02:05:00 +01:00
|
|
|
// so that newFSObjectLayer initializes non existing paths
|
2016-06-29 12:13:44 +02:00
|
|
|
// and successfully returns initialized object layer.
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-06-29 12:13:44 +02:00
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
_, err := newFSObjectLayer("")
|
2016-10-05 21:48:07 +02:00
|
|
|
if err != errInvalidArgument {
|
|
|
|
t.Errorf("Expecting error invalid argument, got %s", err)
|
|
|
|
}
|
2017-01-17 02:05:00 +01:00
|
|
|
_, err = newFSObjectLayer(disk)
|
2016-10-05 21:48:07 +02:00
|
|
|
if err != nil {
|
|
|
|
errMsg := "Unable to recognize backend format, Disk is not in FS format."
|
|
|
|
if err.Error() == errMsg {
|
|
|
|
t.Errorf("Expecting %s, got %s", errMsg, err)
|
2016-07-04 05:01:40 +02:00
|
|
|
}
|
2016-06-29 12:13:44 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-13 20:01:10 +02:00
|
|
|
|
2016-11-12 01:36:07 +01:00
|
|
|
// TestFSShutdown - initialize a new FS object layer then calls
|
|
|
|
// Shutdown to check returned results
|
2016-09-13 20:01:10 +02:00
|
|
|
func TestFSShutdown(t *testing.T) {
|
2017-01-18 21:24:34 +01:00
|
|
|
rootPath, err := newTestConfig(globalMinioDefaultRegion)
|
2016-11-12 01:36:07 +01:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(rootPath)
|
2016-09-13 20:01:10 +02:00
|
|
|
|
2016-11-12 01:36:07 +01:00
|
|
|
bucketName := "testbucket"
|
|
|
|
objectName := "object"
|
2016-11-09 19:10:14 +01:00
|
|
|
// Create and return an fsObject with its path in the disk
|
2017-01-17 02:05:00 +01:00
|
|
|
prepareTest := func() (*fsObjects, string) {
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2016-11-09 19:10:14 +01:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-01-17 02:05:00 +01:00
|
|
|
fs := obj.(*fsObjects)
|
2016-11-09 19:10:14 +01:00
|
|
|
objectContent := "12345"
|
2017-06-01 18:43:20 +02:00
|
|
|
obj.MakeBucketWithLocation(bucketName, "")
|
2016-11-09 19:10:14 +01:00
|
|
|
sha256sum := ""
|
|
|
|
obj.PutObject(bucketName, objectName, int64(len(objectContent)), bytes.NewReader([]byte(objectContent)), nil, sha256sum)
|
|
|
|
return fs, disk
|
|
|
|
}
|
2016-09-13 20:01:10 +02:00
|
|
|
|
2016-09-16 22:06:49 +02:00
|
|
|
// Test Shutdown with regular conditions
|
2016-11-09 19:10:14 +01:00
|
|
|
fs, disk := prepareTest()
|
2016-09-13 20:01:10 +02:00
|
|
|
if err := fs.Shutdown(); err != nil {
|
|
|
|
t.Fatal("Cannot shutdown the FS object: ", err)
|
|
|
|
}
|
2017-08-13 04:25:43 +02:00
|
|
|
os.RemoveAll(disk)
|
2016-09-13 20:01:10 +02:00
|
|
|
|
2016-11-09 19:10:14 +01:00
|
|
|
// Test Shutdown with faulty disk
|
2017-02-07 21:51:23 +01:00
|
|
|
fs, disk = prepareTest()
|
|
|
|
fs.DeleteObject(bucketName, objectName)
|
2017-08-13 04:25:43 +02:00
|
|
|
os.RemoveAll(disk)
|
2017-02-07 21:51:23 +01:00
|
|
|
if err := fs.Shutdown(); err != nil {
|
|
|
|
t.Fatal("Got unexpected fs shutdown error: ", err)
|
2016-12-01 22:59:06 +01:00
|
|
|
}
|
2016-09-16 22:06:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// TestFSGetBucketInfo - test GetBucketInfo with healty and faulty disks
|
|
|
|
func TestFSGetBucketInfo(t *testing.T) {
|
|
|
|
// Prepare for testing
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-01-17 02:05:00 +01:00
|
|
|
fs := obj.(*fsObjects)
|
2016-09-16 22:06:49 +02:00
|
|
|
bucketName := "bucket"
|
|
|
|
|
2017-06-01 18:43:20 +02:00
|
|
|
obj.MakeBucketWithLocation(bucketName, "")
|
2016-09-16 22:06:49 +02:00
|
|
|
|
|
|
|
// Test with valid parameters
|
|
|
|
info, err := fs.GetBucketInfo(bucketName)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
if info.Name != bucketName {
|
|
|
|
t.Fatalf("wrong bucket name, expected: %s, found: %s", bucketName, info.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with inexistant bucket
|
|
|
|
_, err = fs.GetBucketInfo("a")
|
|
|
|
if !isSameType(errorCause(err), BucketNameInvalid{}) {
|
|
|
|
t.Fatal("BucketNameInvalid error not returned")
|
|
|
|
}
|
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
// Check for buckets and should get disk not found.
|
2017-08-10 23:11:57 +02:00
|
|
|
fs.fsPath = filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
|
|
|
|
2016-09-16 22:06:49 +02:00
|
|
|
_, err = fs.GetBucketInfo(bucketName)
|
2017-01-17 02:05:00 +01:00
|
|
|
if !isSameType(errorCause(err), BucketNotFound{}) {
|
|
|
|
t.Fatal("BucketNotFound error not returned")
|
2016-09-16 22:06:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-10 02:46:46 +02:00
|
|
|
func TestFSPutObject(t *testing.T) {
|
|
|
|
// Prepare for tests
|
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2017-05-10 02:46:46 +02:00
|
|
|
|
|
|
|
obj := initFSObjects(disk, t)
|
|
|
|
bucketName := "bucket"
|
|
|
|
objectName := "1/2/3/4/object"
|
|
|
|
|
2017-06-01 18:43:20 +02:00
|
|
|
if err := obj.MakeBucketWithLocation(bucketName, ""); err != nil {
|
2017-05-10 02:46:46 +02:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2017-05-25 18:22:43 +02:00
|
|
|
|
2017-05-10 02:46:46 +02:00
|
|
|
sha256sum := ""
|
2017-05-25 18:22:43 +02:00
|
|
|
|
|
|
|
// With a regular object.
|
|
|
|
_, err := obj.PutObject(bucketName+"non-existent", objectName, int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil, sha256sum)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("Unexpected should fail here, bucket doesn't exist")
|
|
|
|
}
|
|
|
|
if _, ok := errorCause(err).(BucketNotFound); !ok {
|
|
|
|
t.Fatalf("Expected error type BucketNotFound, got %#v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// With a directory object.
|
|
|
|
_, err = obj.PutObject(bucketName+"non-existent", objectName+"/", int64(0), bytes.NewReader([]byte("")), nil, sha256sum)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("Unexpected should fail here, bucket doesn't exist")
|
|
|
|
}
|
|
|
|
if _, ok := errorCause(err).(BucketNotFound); !ok {
|
|
|
|
t.Fatalf("Expected error type BucketNotFound, got %#v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err = obj.PutObject(bucketName, objectName, int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil, sha256sum)
|
2017-05-10 02:46:46 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = obj.PutObject(bucketName, objectName+"/1", int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil, sha256sum)
|
|
|
|
if err == nil {
|
2017-05-25 18:22:43 +02:00
|
|
|
t.Fatal("Unexpected should fail here, backend corruption occurred")
|
2017-05-10 02:46:46 +02:00
|
|
|
}
|
|
|
|
if nerr, ok := errorCause(err).(PrefixAccessDenied); !ok {
|
|
|
|
t.Fatalf("Expected PrefixAccessDenied, got %#v", err)
|
|
|
|
} else {
|
|
|
|
if nerr.Bucket != "bucket" {
|
|
|
|
t.Fatalf("Expected 'bucket', got %s", nerr.Bucket)
|
|
|
|
}
|
|
|
|
if nerr.Object != "1/2/3/4/object/1" {
|
|
|
|
t.Fatalf("Expected '1/2/3/4/object/1', got %s", nerr.Object)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err = obj.PutObject(bucketName, objectName+"/1/", 0, bytes.NewReader([]byte("")), nil, sha256sum)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("Unexpected should fail here, backned corruption occurred")
|
|
|
|
}
|
|
|
|
if nerr, ok := errorCause(err).(PrefixAccessDenied); !ok {
|
|
|
|
t.Fatalf("Expected PrefixAccessDenied, got %#v", err)
|
|
|
|
} else {
|
|
|
|
if nerr.Bucket != "bucket" {
|
|
|
|
t.Fatalf("Expected 'bucket', got %s", nerr.Bucket)
|
|
|
|
}
|
|
|
|
if nerr.Object != "1/2/3/4/object/1/" {
|
|
|
|
t.Fatalf("Expected '1/2/3/4/object/1/', got %s", nerr.Object)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-16 22:06:49 +02:00
|
|
|
// TestFSDeleteObject - test fs.DeleteObject() with healthy and corrupted disks
|
|
|
|
func TestFSDeleteObject(t *testing.T) {
|
|
|
|
// Prepare for tests
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-01-17 02:05:00 +01:00
|
|
|
fs := obj.(*fsObjects)
|
2016-09-16 22:06:49 +02:00
|
|
|
bucketName := "bucket"
|
|
|
|
objectName := "object"
|
|
|
|
|
2017-06-01 18:43:20 +02:00
|
|
|
obj.MakeBucketWithLocation(bucketName, "")
|
2016-10-03 00:51:49 +02:00
|
|
|
sha256sum := ""
|
|
|
|
obj.PutObject(bucketName, objectName, int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil, sha256sum)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
|
|
|
// Test with invalid bucket name
|
|
|
|
if err := fs.DeleteObject("fo", objectName); !isSameType(errorCause(err), BucketNameInvalid{}) {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
2017-01-17 02:05:00 +01:00
|
|
|
// Test with bucket does not exist
|
|
|
|
if err := fs.DeleteObject("foobucket", "fooobject"); !isSameType(errorCause(err), BucketNotFound{}) {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
2016-09-16 22:06:49 +02:00
|
|
|
// Test with invalid object name
|
2016-10-01 01:56:36 +02:00
|
|
|
if err := fs.DeleteObject(bucketName, "\\"); !isSameType(errorCause(err), ObjectNameInvalid{}) {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
2017-01-17 02:05:00 +01:00
|
|
|
// Test with object does not exist.
|
|
|
|
if err := fs.DeleteObject(bucketName, "foooobject"); !isSameType(errorCause(err), ObjectNotFound{}) {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
// Test with valid condition
|
|
|
|
if err := fs.DeleteObject(bucketName, objectName); err != nil {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
// Delete object should err disk not found.
|
2017-08-10 23:11:57 +02:00
|
|
|
fs.fsPath = filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-01-17 02:05:00 +01:00
|
|
|
if err := fs.DeleteObject(bucketName, objectName); err != nil {
|
|
|
|
if !isSameType(errorCause(err), BucketNotFound{}) {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
2016-09-16 22:06:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestFSDeleteBucket - tests for fs DeleteBucket
|
|
|
|
func TestFSDeleteBucket(t *testing.T) {
|
|
|
|
// Prepare for testing
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-01-17 02:05:00 +01:00
|
|
|
fs := obj.(*fsObjects)
|
2016-09-16 22:06:49 +02:00
|
|
|
bucketName := "bucket"
|
|
|
|
|
2017-06-01 18:43:20 +02:00
|
|
|
err := obj.MakeBucketWithLocation(bucketName, "")
|
2016-09-16 22:06:49 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with an invalid bucket name
|
2017-01-17 02:05:00 +01:00
|
|
|
if err = fs.DeleteBucket("fo"); !isSameType(errorCause(err), BucketNameInvalid{}) {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
// Test with an inexistant bucket
|
2017-01-17 02:05:00 +01:00
|
|
|
if err = fs.DeleteBucket("foobucket"); !isSameType(errorCause(err), BucketNotFound{}) {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
// Test with a valid case
|
2017-01-17 02:05:00 +01:00
|
|
|
if err = fs.DeleteBucket(bucketName); err != nil {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
|
2017-06-01 18:43:20 +02:00
|
|
|
obj.MakeBucketWithLocation(bucketName, "")
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2017-08-10 23:11:57 +02:00
|
|
|
// Delete bucket should get error disk not found.
|
|
|
|
fs.fsPath = filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-01-17 02:05:00 +01:00
|
|
|
if err = fs.DeleteBucket(bucketName); err != nil {
|
|
|
|
if !isSameType(errorCause(err), BucketNotFound{}) {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestFSListBuckets - tests for fs ListBuckets
|
|
|
|
func TestFSListBuckets(t *testing.T) {
|
|
|
|
// Prepare for tests
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-01-17 02:05:00 +01:00
|
|
|
fs := obj.(*fsObjects)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
|
|
|
bucketName := "bucket"
|
2017-06-01 18:43:20 +02:00
|
|
|
if err := obj.MakeBucketWithLocation(bucketName, ""); err != nil {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create a bucket with invalid name
|
2017-08-13 04:25:43 +02:00
|
|
|
if err := os.MkdirAll(pathJoin(fs.fsPath, "vo^"), 0777); err != nil {
|
2017-01-17 02:05:00 +01:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
f, err := os.Create(pathJoin(fs.fsPath, "test"))
|
|
|
|
if err != nil {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
2017-01-17 02:05:00 +01:00
|
|
|
f.Close()
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
// Test list buckets to have only one entry.
|
2016-09-16 22:06:49 +02:00
|
|
|
buckets, err := fs.ListBuckets()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
if len(buckets) != 1 {
|
2017-01-17 02:05:00 +01:00
|
|
|
t.Fatal("ListBuckets not working properly", buckets)
|
2016-09-16 22:06:49 +02:00
|
|
|
}
|
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
// Test ListBuckets with disk not found.
|
2017-08-10 23:11:57 +02:00
|
|
|
fs.fsPath = filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-01-17 02:05:00 +01:00
|
|
|
|
|
|
|
if _, err := fs.ListBuckets(); err != nil {
|
|
|
|
if errorCause(err) != errDiskNotFound {
|
2016-09-16 22:06:49 +02:00
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-17 02:05:00 +01:00
|
|
|
longPath := fmt.Sprintf("%0256d", 1)
|
|
|
|
fs.fsPath = longPath
|
|
|
|
if _, err := fs.ListBuckets(); err != nil {
|
|
|
|
if errorCause(err) != errFileNameTooLong {
|
|
|
|
t.Fatal("Unexpected error: ", err)
|
|
|
|
}
|
|
|
|
}
|
2016-09-16 22:06:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// TestFSHealObject - tests for fs HealObject
|
|
|
|
func TestFSHealObject(t *testing.T) {
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
2017-04-01 02:55:15 +02:00
|
|
|
_, _, err := obj.HealObject("bucket", "object")
|
2016-09-16 22:06:49 +02:00
|
|
|
if err == nil || !isSameType(errorCause(err), NotImplemented{}) {
|
|
|
|
t.Fatalf("Heal Object should return NotImplemented error ")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestFSListObjectHeal - tests for fs ListObjectHeals
|
|
|
|
func TestFSListObjectsHeal(t *testing.T) {
|
2016-12-16 07:25:05 +01:00
|
|
|
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
|
2017-08-13 04:25:43 +02:00
|
|
|
defer os.RemoveAll(disk)
|
2016-09-16 22:06:49 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
obj := initFSObjects(disk, t)
|
|
|
|
_, err := obj.ListObjectsHeal("bucket", "prefix", "marker", "delimiter", 1000)
|
2016-09-16 22:06:49 +02:00
|
|
|
if err == nil || !isSameType(errorCause(err), NotImplemented{}) {
|
|
|
|
t.Fatalf("Heal Object should return NotImplemented error ")
|
|
|
|
}
|
2016-09-13 20:01:10 +02:00
|
|
|
}
|