mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Deadcode removal (#7627)
This commit is contained in:
parent
a71e08efb4
commit
589df3d5e7
@ -20,7 +20,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -298,60 +297,6 @@ func (atb *adminXLTestBed) TearDown() {
|
|||||||
resetTestGlobals()
|
resetTestGlobals()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (atb *adminXLTestBed) GenerateHealTestData(t *testing.T) {
|
|
||||||
// Create an object myobject under bucket mybucket.
|
|
||||||
bucketName := "mybucket"
|
|
||||||
err := atb.objLayer.MakeBucketWithLocation(context.Background(), bucketName, "")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Failed to make bucket %s - %v", bucketName,
|
|
||||||
err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// create some objects
|
|
||||||
{
|
|
||||||
objName := "myobject"
|
|
||||||
for i := 0; i < 10; i++ {
|
|
||||||
objectName := fmt.Sprintf("%s-%d", objName, i)
|
|
||||||
_, err = atb.objLayer.PutObject(context.Background(), bucketName, objectName,
|
|
||||||
mustGetPutObjReader(t, bytes.NewReader([]byte("hello")),
|
|
||||||
int64(len("hello")), "", ""), ObjectOptions{})
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Failed to create %s - %v", objectName,
|
|
||||||
err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// create a multipart upload (incomplete)
|
|
||||||
{
|
|
||||||
objName := "mpObject"
|
|
||||||
uploadID, err := atb.objLayer.NewMultipartUpload(context.Background(), bucketName,
|
|
||||||
objName, ObjectOptions{})
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("mp new error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = atb.objLayer.PutObjectPart(context.Background(), bucketName, objName,
|
|
||||||
uploadID, 3, mustGetPutObjReader(t, bytes.NewReader(
|
|
||||||
[]byte("hello")), int64(len("hello")), "", ""), ObjectOptions{})
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("mp put error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (atb *adminXLTestBed) CleanupHealTestData(t *testing.T) {
|
|
||||||
bucketName := "mybucket"
|
|
||||||
objName := "myobject"
|
|
||||||
for i := 0; i < 10; i++ {
|
|
||||||
atb.objLayer.DeleteObject(context.Background(), bucketName,
|
|
||||||
fmt.Sprintf("%s-%d", objName, i))
|
|
||||||
}
|
|
||||||
|
|
||||||
atb.objLayer.DeleteBucket(context.Background(), bucketName)
|
|
||||||
}
|
|
||||||
|
|
||||||
// initTestObjLayer - Helper function to initialize an XL-based object
|
// initTestObjLayer - Helper function to initialize an XL-based object
|
||||||
// layer and set globalObjectAPI.
|
// layer and set globalObjectAPI.
|
||||||
func initTestXLObjLayer() (ObjectLayer, []string, error) {
|
func initTestXLObjLayer() (ObjectLayer, []string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user