MCPcopy
hub / github.com/minio/minio-go / testFunctionalV2

Function testFunctionalV2

functional_tests.go:12583–13017  ·  view source on GitHub ↗

Tests comprehensive list of all methods.

()

Source from the content-addressed store, hash-verified

12581
12582// Tests comprehensive list of all methods.
12583func testFunctionalV2() {
12584 // initialize logging params
12585 startTime := time.Now()
12586 testName := getFuncName()
12587 function := "testFunctionalV2()"
12588 functionAll := ""
12589 args := map[string]interface{}{}
12590
12591 c, err := NewClient(ClientConfig{CredsV2: true})
12592 if err != nil {
12593 logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
12594 return
12595 }
12596
12597 // Generate a new random bucket name.
12598 bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
12599 location := "us-east-1"
12600 // Make a new bucket.
12601 function = "MakeBucket(bucketName, location)"
12602 functionAll = "MakeBucket(bucketName, location)"
12603 args = map[string]interface{}{
12604 "bucketName": bucketName,
12605 "location": location,
12606 }
12607 err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: location})
12608 if err != nil {
12609 logError(testName, function, args, startTime, "", "MakeBucket failed", err)
12610 return
12611 }
12612
12613 defer cleanupBucket(bucketName, c)
12614
12615 // Generate a random file name.
12616 fileName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
12617 file, err := os.Create(fileName)
12618 if err != nil {
12619 logError(testName, function, args, startTime, "", "file create failed", err)
12620 return
12621 }
12622 for i := 0; i < 3; i++ {
12623 buf := make([]byte, rand.Intn(1<<19))
12624 _, err = file.Write(buf)
12625 if err != nil {
12626 logError(testName, function, args, startTime, "", "file write failed", err)
12627 return
12628 }
12629 }
12630 file.Close()
12631
12632 // Verify if bucket exits and you have access.
12633 var exists bool
12634 function = "BucketExists(bucketName)"
12635 functionAll += ", " + function
12636 args = map[string]interface{}{
12637 "bucketName": bucketName,
12638 }
12639 exists, err = c.BucketExists(context.Background(), bucketName)
12640 if err != nil {

Callers 1

mainFunction · 0.85

Calls 15

MakeBucketMethod · 0.95
BucketExistsMethod · 0.95
SetBucketPolicyMethod · 0.95
ListBucketsMethod · 0.95
PutObjectMethod · 0.95
StatObjectMethod · 0.95
ListObjectsMethod · 0.95
ListIncompleteUploadsMethod · 0.95
GetObjectMethod · 0.95
FGetObjectMethod · 0.95
PresignedHeadObjectMethod · 0.95
PresignedGetObjectMethod · 0.95

Tested by

no test coverage detected