Skip to content

Commit

Permalink
Fixes build check failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ebozduman committed Dec 23, 2020
1 parent 6737927 commit 32fdfe0
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 105 deletions.
9 changes: 2 additions & 7 deletions api-error-response.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ func (e ErrorResponse) Error() string {
if e.Message == "" {
msg, ok := s3ErrorResponseMap[e.Code]
if !ok {
if e.Code == "" {
msg = "Error Code is not set"
} else {
// No e.Code in the list of known s3 error codes
msg = fmt.Sprintf("Invalid error Code, \"%s\"", e.Code)
}
msg = fmt.Sprintf("Error response code %s.", e.Code)
}
e.Message = msg
return msg
}
return e.Message
}
Expand Down
8 changes: 5 additions & 3 deletions api-error-response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestHttpRespToErrorResponse(t *testing.T) {
// List of expected response.
// Used for asserting the actual response.
expectedErrResponse := []error{
genInvalidError("Response is empty. " + "Please report this issue at https://github.com/minio/minio-go/issues."),
genInvalidError("Empty http response. " + "Please report this issue at https://github.com/minio/minio-go/issues."),
decodeXMLError(createAPIErrorResponse(APIErrors[0], "minio-bucket")),
genErrResponse(setCommonHeaders(&http.Response{StatusCode: http.StatusNotFound}), "NoSuchBucket", "The specified bucket does not exist.", "minio-bucket", ""),
genErrResponse(setCommonHeaders(&http.Response{StatusCode: http.StatusNotFound}), "NoSuchKey", "The specified key does not exist.", "minio-bucket", "Asia/"),
Expand Down Expand Up @@ -280,15 +280,17 @@ func TestErrWithoutMessage(t *testing.T) {
Code: "AccessDenied",
RequestID: "minio",
}

if errResp.Error() != "Access Denied." {
t.Errorf("Expected \"Access Denied.\", got %s", errResp)
}

errResp = ErrorResponse{
Code: "InvalidArgument",
RequestID: "minio",
}
if errResp.Error() != "Error response code InvalidArgument." {
t.Errorf("Expected \"Error response code InvalidArgument.\", got %s", errResp)
if errResp.Error() != fmt.Sprintf("Error response code %s.", errResp.Code) {
t.Errorf("Expected \"Error response code InvalidArgument.\", got \"%s\"", errResp)
}
}

Expand Down
186 changes: 91 additions & 95 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -6941,10 +6941,6 @@ func testEncryptedEmptyObject() {
}

delete(args, "objectName")
<<<<<<< HEAD

=======
>>>>>>> NotImplemented support for Azure and addressed cleanup issue
successLogger(testName, function, args, startTime).Info()
}

Expand Down Expand Up @@ -11219,101 +11215,101 @@ func main() {
tls := mustParseBool(os.Getenv(enableHTTPS))
// execute tests
if isFullMode() {
// testMakeBucketErrorV2()
// testGetObjectClosedTwiceV2()
// testFPutObjectV2()
// testMakeBucketRegionsV2()
// testGetObjectReadSeekFunctionalV2()
// testGetObjectReadAtFunctionalV2()
// testCopyObjectV2()
// testFunctionalV2()
// testComposeObjectErrorCasesV2()
// testCompose10KSourcesV2()
// testUserMetadataCopyingV2()
// testPutObject0ByteV2()
// testPutObjectNoLengthV2()
// testPutObjectsUnknownV2()
// testGetObjectContextV2()
// testFPutObjectContextV2()
// testFGetObjectContextV2()
// testPutObjectContextV2()
// testMakeBucketError()
// testMakeBucketRegions()
// testPutObjectWithMetadata()
// testPutObjectReadAt()
// testPutObjectStreaming()
// testGetObjectSeekEnd()
// testGetObjectClosedTwice()
// testRemoveMultipleObjects()
// testFPutObjectMultipart()
// testFPutObject()
// testGetObjectReadSeekFunctional()
// testGetObjectReadAtFunctional()
// testGetObjectReadAtWhenEOFWasReached()
// testPresignedPostPolicy()
// testCopyObject()
// testComposeObjectErrorCases()
// testCompose10KSources()
// testUserMetadataCopying()
// testBucketNotification()
// testFunctional()
testMakeBucketErrorV2()
testGetObjectClosedTwiceV2()
testFPutObjectV2()
testMakeBucketRegionsV2()
testGetObjectReadSeekFunctionalV2()
testGetObjectReadAtFunctionalV2()
testCopyObjectV2()
testFunctionalV2()
testComposeObjectErrorCasesV2()
testCompose10KSourcesV2()
testUserMetadataCopyingV2()
testPutObject0ByteV2()
testPutObjectNoLengthV2()
testPutObjectsUnknownV2()
testGetObjectContextV2()
testFPutObjectContextV2()
testFGetObjectContextV2()
testPutObjectContextV2()
testMakeBucketError()
testMakeBucketRegions()
testPutObjectWithMetadata()
testPutObjectReadAt()
testPutObjectStreaming()
testGetObjectSeekEnd()
testGetObjectClosedTwice()
testRemoveMultipleObjects()
testFPutObjectMultipart()
testFPutObject()
testGetObjectReadSeekFunctional()
testGetObjectReadAtFunctional()
testGetObjectReadAtWhenEOFWasReached()
testPresignedPostPolicy()
testCopyObject()
testComposeObjectErrorCases()
testCompose10KSources()
testUserMetadataCopying()
testBucketNotification()
testFunctional()
testGetObjectModified()
// testPutObjectUploadSeekedObject()
// testGetObjectContext()
// testFPutObjectContext()
// testFGetObjectContext()
// testGetObjectACLContext()
// testPutObjectContext()
// testStorageClassMetadataPutObject()
// testStorageClassInvalidMetadataPutObject()
// testStorageClassMetadataCopyObject()
// testPutObjectWithContentLanguage()
// testListObjects()
// testRemoveObjects()
// testListObjectVersions()
// testStatObjectWithVersioning()
// testGetObjectWithVersioning()
// testCopyObjectWithVersioning()
// testComposeObjectWithVersioning()
// testRemoveObjectWithVersioning()
// testRemoveObjectsWithVersioning()
// testObjectTaggingWithVersioning()
testPutObjectUploadSeekedObject()
testGetObjectContext()
testFPutObjectContext()
testFGetObjectContext()
testGetObjectACLContext()
testPutObjectContext()
testStorageClassMetadataPutObject()
testStorageClassInvalidMetadataPutObject()
testStorageClassMetadataCopyObject()
testPutObjectWithContentLanguage()
testListObjects()
testRemoveObjects()
testListObjectVersions()
testStatObjectWithVersioning()
testGetObjectWithVersioning()
testCopyObjectWithVersioning()
testComposeObjectWithVersioning()
testRemoveObjectWithVersioning()
testRemoveObjectsWithVersioning()
testObjectTaggingWithVersioning()

// SSE-C tests will only work over TLS connection.
if tls {
// testSSECEncryptionPutGet()
// testSSECEncryptionFPut()
// testSSECEncryptedGetObjectReadAtFunctional()
// testSSECEncryptedGetObjectReadSeekFunctional()
// testEncryptedCopyObjectV2()
// testEncryptedSSECToSSECCopyObject()
// testEncryptedSSECToUnencryptedCopyObject()
// testUnencryptedToSSECCopyObject()
// testUnencryptedToUnencryptedCopyObject()
// testEncryptedEmptyObject()
// testDecryptedCopyObject()
// testSSECEncryptedToSSECCopyObjectPart()
// testSSECMultipartEncryptedToSSECCopyObjectPart()
// testSSECEncryptedToUnencryptedCopyPart()
// testUnencryptedToSSECCopyObjectPart()
// testUnencryptedToUnencryptedCopyPart()
// testEncryptedSSECToSSES3CopyObject()
// testEncryptedSSES3ToSSECCopyObject()
// testSSECEncryptedToSSES3CopyObjectPart()
// testSSES3EncryptedToSSECCopyObjectPart()
}

// // KMS tests
// testSSES3EncryptionPutGet()
// testSSES3EncryptionFPut()
// testSSES3EncryptedGetObjectReadAtFunctional()
// testSSES3EncryptedGetObjectReadSeekFunctional()
// testEncryptedSSES3ToSSES3CopyObject()
// testEncryptedSSES3ToUnencryptedCopyObject()
// testUnencryptedToSSES3CopyObject()
// testUnencryptedToSSES3CopyObjectPart()
// testSSES3EncryptedToUnencryptedCopyPart()
// testSSES3EncryptedToSSES3CopyObjectPart()
testSSECEncryptionPutGet()
testSSECEncryptionFPut()
testSSECEncryptedGetObjectReadAtFunctional()
testSSECEncryptedGetObjectReadSeekFunctional()
testEncryptedCopyObjectV2()
testEncryptedSSECToSSECCopyObject()
testEncryptedSSECToUnencryptedCopyObject()
testUnencryptedToSSECCopyObject()
testUnencryptedToUnencryptedCopyObject()
testEncryptedEmptyObject()
testDecryptedCopyObject()
testSSECEncryptedToSSECCopyObjectPart()
testSSECMultipartEncryptedToSSECCopyObjectPart()
testSSECEncryptedToUnencryptedCopyPart()
testUnencryptedToSSECCopyObjectPart()
testUnencryptedToUnencryptedCopyPart()
testEncryptedSSECToSSES3CopyObject()
testEncryptedSSES3ToSSECCopyObject()
testSSECEncryptedToSSES3CopyObjectPart()
testSSES3EncryptedToSSECCopyObjectPart()
}

// KMS tests
testSSES3EncryptionPutGet()
testSSES3EncryptionFPut()
testSSES3EncryptedGetObjectReadAtFunctional()
testSSES3EncryptedGetObjectReadSeekFunctional()
testEncryptedSSES3ToSSES3CopyObject()
testEncryptedSSES3ToUnencryptedCopyObject()
testUnencryptedToSSES3CopyObject()
testUnencryptedToSSES3CopyObjectPart()
testSSES3EncryptedToUnencryptedCopyPart()
testSSES3EncryptedToSSES3CopyObjectPart()
} else {
testFunctional()
testFunctionalV2()
Expand Down

0 comments on commit 32fdfe0

Please sign in to comment.