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
+6
View File
@@ -23,6 +23,7 @@ import (
"os"
slashpath "path"
"path/filepath"
"runtime"
"strings"
"syscall"
@@ -691,6 +692,11 @@ func (s posix) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) (err er
// File path cannot be verified since one of the parents is a file.
if strings.Contains(err.Error(), "not a directory") {
return errFileAccessDenied
} else if strings.Contains(err.Error(), "The system cannot find the path specified.") && runtime.GOOS == "windows" {
// This is a special case should be handled only for
// windows, because windows API does not return "not a
// directory" error message. Handle this specifically here.
return errFileAccessDenied
}
return err
}