posix: Use preparePath only for paths used with syscall or os functions (#3377)

master
Krishnan Parthasarathi 8 years ago committed by Harshavardhana
parent 0d59ea1e94
commit feb6685359
  1. 4
      cmd/object-api-putobject_test.go
  2. 2
      cmd/posix.go
  3. 6
      cmd/test-utils_test.go

@ -23,7 +23,6 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
"runtime"
"testing" "testing"
humanize "github.com/dustin/go-humanize" humanize "github.com/dustin/go-humanize"
@ -329,9 +328,6 @@ func testObjectAPIPutObjectStaleFiles(obj ObjectLayer, instanceType string, disk
// Wrapper for calling Multipart PutObject tests for both XL multiple disks and single node setup. // Wrapper for calling Multipart PutObject tests for both XL multiple disks and single node setup.
func TestObjectAPIMultipartPutObjectStaleFiles(t *testing.T) { func TestObjectAPIMultipartPutObjectStaleFiles(t *testing.T) {
if runtime.GOOS == "windows" {
return
}
ExecObjectLayerStaleFilesTest(t, testObjectAPIMultipartPutObjectStaleFiles) ExecObjectLayerStaleFilesTest(t, testObjectAPIMultipartPutObjectStaleFiles)
} }

@ -957,7 +957,7 @@ func (s *posix) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) (err e
} }
// Remove parent dir of the source file if empty // Remove parent dir of the source file if empty
if parentDir := slashpath.Dir(preparePath(srcFilePath)); isDirEmpty(parentDir) { if parentDir := slashpath.Dir(srcFilePath); isDirEmpty(parentDir) {
deleteFile(srcVolumeDir, parentDir) deleteFile(srcVolumeDir, parentDir)
} }

@ -1921,6 +1921,12 @@ type objTestStaleFilesType func(obj ObjectLayer, instanceType string, dirs []str
// ExecObjectLayerStaleFilesTest - executes object layer tests those leaves stale // ExecObjectLayerStaleFilesTest - executes object layer tests those leaves stale
// files/directories under .minio/tmp. Creates XL ObjectLayer instance and runs test for XL layer. // files/directories under .minio/tmp. Creates XL ObjectLayer instance and runs test for XL layer.
func ExecObjectLayerStaleFilesTest(t *testing.T, objTest objTestStaleFilesType) { func ExecObjectLayerStaleFilesTest(t *testing.T, objTest objTestStaleFilesType) {
configPath, err := newTestConfig("us-east-1")
if err != nil {
t.Fatal("Failed to create config directory", err)
}
defer removeAll(configPath)
nDisks := 16 nDisks := 16
erasureDisks, err := getRandomDisks(nDisks) erasureDisks, err := getRandomDisks(nDisks)
if err != nil { if err != nil {

Loading…
Cancel
Save