From feb6685359f8d8f9b056f0bebacac0a4a1b24fc6 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 1 Dec 2016 10:26:16 +0530 Subject: [PATCH] posix: Use preparePath only for paths used with syscall or os functions (#3377) --- cmd/object-api-putobject_test.go | 4 ---- cmd/posix.go | 2 +- cmd/test-utils_test.go | 6 ++++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/object-api-putobject_test.go b/cmd/object-api-putobject_test.go index 0657173b8..45c6fb516 100644 --- a/cmd/object-api-putobject_test.go +++ b/cmd/object-api-putobject_test.go @@ -23,7 +23,6 @@ import ( "io/ioutil" "os" "path" - "runtime" "testing" 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. func TestObjectAPIMultipartPutObjectStaleFiles(t *testing.T) { - if runtime.GOOS == "windows" { - return - } ExecObjectLayerStaleFilesTest(t, testObjectAPIMultipartPutObjectStaleFiles) } diff --git a/cmd/posix.go b/cmd/posix.go index 9af59f5d0..83673c465 100644 --- a/cmd/posix.go +++ b/cmd/posix.go @@ -957,7 +957,7 @@ func (s *posix) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) (err e } // 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) } diff --git a/cmd/test-utils_test.go b/cmd/test-utils_test.go index e888c66cc..962a10a1f 100644 --- a/cmd/test-utils_test.go +++ b/cmd/test-utils_test.go @@ -1921,6 +1921,12 @@ type objTestStaleFilesType func(obj ObjectLayer, instanceType string, dirs []str // ExecObjectLayerStaleFilesTest - executes object layer tests those leaves stale // files/directories under .minio/tmp. Creates XL ObjectLayer instance and runs test for XL layer. 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 erasureDisks, err := getRandomDisks(nDisks) if err != nil {