Adding detailed comments for server_xl_test. (#2011)

This commit is contained in:
karthic rao 2016-06-28 12:24:56 +05:30 committed by Harshavardhana
parent 4db2b03312
commit 76f6533f8d
4 changed files with 470 additions and 245 deletions

View File

@ -1726,7 +1726,7 @@ func testObjectCompleteMultipartUpload(obj ObjectLayer, instanceType string, t *
uploadIDs = append(uploadIDs, uploadID) uploadIDs = append(uploadIDs, uploadID)
// Parts with size greater than 5 MB. // Parts with size greater than 5 MB.
// Generating a 6MB byte array. // Generating a 6MB byte array.
validPart := bytes.Repeat([]byte("0123456789abcdef"), 1024*1024) validPart := bytes.Repeat([]byte("abcdef"), 1024*1024)
validPartMD5 := findMD5(validPart) validPartMD5 := findMD5(validPart)
// Create multipart parts. // Create multipart parts.
// Need parts to be uploaded before CompleteMultiPartUpload can be called tested. // Need parts to be uploaded before CompleteMultiPartUpload can be called tested.

View File

@ -120,7 +120,7 @@ func testObjectAPIPutObject(obj ObjectLayer, instanceType string, t *testing.T)
} }
// Wrapper for calling PutObject tests for both XL multiple disks case // Wrapper for calling PutObject tests for both XL multiple disks case
// when quorum is not availabel. // when quorum is not available.
func TestObjectAPIPutObjectDiskNotFound(t *testing.T) { func TestObjectAPIPutObjectDiskNotFound(t *testing.T) {
ExecObjectLayerDiskNotFoundTest(t, testObjectAPIPutObjectDiskNotFOund) ExecObjectLayerDiskNotFoundTest(t, testObjectAPIPutObjectDiskNotFOund)
} }

File diff suppressed because it is too large Load Diff

View File

@ -439,6 +439,60 @@ func getDeleteBucketURL(endPoint, bucketName string) string {
} }
// return URL for listing the bucket.
func getListObjectsURL(endPoint, bucketName string, maxKeys string) string {
queryValue := url.Values{}
if maxKeys != "" {
queryValue.Set("max-keys", maxKeys)
}
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
}
// return URL for a new multipart upload.
func getNewMultipartURL(endPoint, bucketName, objectName string) string {
queryValue := url.Values{}
queryValue.Set("uploads", "")
return makeTestTargetURL(endPoint, bucketName, objectName, queryValue)
}
// return URL for a new multipart upload.
func getPartUploadURL(endPoint, bucketName, objectName, uploadID, partNumber string) string {
queryValues := url.Values{}
queryValues.Set("uploadId", uploadID)
queryValues.Set("partNumber", partNumber)
return makeTestTargetURL(endPoint, bucketName, objectName, queryValues)
}
// return URL for aborting multipart upload.
func getAbortMultipartUploadURL(endPoint, bucketName, objectName, uploadID string) string {
queryValue := url.Values{}
queryValue.Set("uploadId", uploadID)
return makeTestTargetURL(endPoint, bucketName, objectName, queryValue)
}
// return URL for a new multipart upload.
func getListMultipartURL(endPoint, bucketName string) string {
queryValue := url.Values{}
queryValue.Set("uploads", "")
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
}
// return URL for a new multipart upload.
func getListMultipartURLWithParams(endPoint, bucketName, objectName, uploadID, maxParts string) string {
queryValues := url.Values{}
queryValues.Set("uploadId", uploadID)
queryValues.Set("max-parts", maxParts)
return makeTestTargetURL(endPoint, bucketName, objectName, queryValues)
}
// return URL for completing multipart upload.
// complete multipart upload request is sent after all parts are uploaded.
func getCompleteMultipartUploadURL(endPoint, bucketName, objectName, uploadID string) string {
queryValue := url.Values{}
queryValue.Set("uploadId", uploadID)
return makeTestTargetURL(endPoint, bucketName, objectName, queryValue)
}
// returns temp root directory. ` // returns temp root directory. `
func getTestRoot() (string, error) { func getTestRoot() (string, error) {
return ioutil.TempDir(os.TempDir(), "api-") return ioutil.TempDir(os.TempDir(), "api-")