From 589df3d5e7f8a379b18f48465af92bd65df209a4 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Tue, 7 May 2019 13:49:15 -0700 Subject: [PATCH] Deadcode removal (#7627) --- cmd/admin-handlers_test.go | 55 -------------------------------------- 1 file changed, 55 deletions(-) diff --git a/cmd/admin-handlers_test.go b/cmd/admin-handlers_test.go index 78cdbb056..72b8ece8b 100644 --- a/cmd/admin-handlers_test.go +++ b/cmd/admin-handlers_test.go @@ -20,7 +20,6 @@ import ( "bytes" "context" "encoding/json" - "fmt" "io" "io/ioutil" "net/http" @@ -298,60 +297,6 @@ func (atb *adminXLTestBed) TearDown() { 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 // layer and set globalObjectAPI. func initTestXLObjLayer() (ObjectLayer, []string, error) {