Unit tests for PUT object when object already exists (#1904)

* fs/xl tests for multiple put object requests
* xl fix for put object on directory
* Unit tests fix windows test issue.
This commit is contained in:
Aakash Muttineni
2016-06-20 18:48:47 +05:30
committed by Harshavardhana
parent 80d83220ad
commit 4ee2136b28
5 changed files with 443 additions and 6 deletions

View File

@@ -649,9 +649,11 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
// Rename if an object already exists to temporary location.
uniqueID := getUUID()
err = xl.renameObject(bucket, object, minioMetaBucket, path.Join(tmpMetaPrefix, uniqueID))
if err != nil {
return "", toObjectErr(err, bucket, object)
if xl.isObject(bucket, object) {
err = xl.renameObject(bucket, object, minioMetaBucket, path.Join(tmpMetaPrefix, uniqueID))
if err != nil {
return "", toObjectErr(err, bucket, object)
}
}
// Remove parts that weren't present in CompleteMultipartUpload request.