From a6de3c1e74e1c33afc5a570d79df4f38dd2e8012 Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Fri, 10 Nov 2017 13:50:22 -0500 Subject: [PATCH] Follow-up changes for PR#259 --- src/duplicacy_gcdstorage.go | 2 +- src/duplicacy_storage_test.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/duplicacy_gcdstorage.go b/src/duplicacy_gcdstorage.go index 13c43e0..7777ef3 100644 --- a/src/duplicacy_gcdstorage.go +++ b/src/duplicacy_gcdstorage.go @@ -120,7 +120,7 @@ func (storage *GCDStorage) shouldRetry(threadIndex int, err error) (bool, error) } // convertFilePath converts the path for a fossil in the form of 'chunks/id.fsl' to 'fossils/id'. This is because -// ACD doesn't support file renaming. Instead, it only allows one file to be moved from one directory to another. +// GCD doesn't support file renaming. Instead, it only allows one file to be moved from one directory to another. // By adding a layer of path conversion we're pretending that we can rename between 'chunks/id' and 'chunks/id.fsl' func (storage *GCDStorage) convertFilePath(filePath string) string { if strings.HasPrefix(filePath, "chunks/") && strings.HasSuffix(filePath, ".fsl") { diff --git a/src/duplicacy_storage_test.go b/src/duplicacy_storage_test.go index 44bf7ed..d804360 100644 --- a/src/duplicacy_storage_test.go +++ b/src/duplicacy_storage_test.go @@ -86,6 +86,10 @@ func loadStorage(localStoragePath string, threads int) (Storage, error) { storage, err := CreateS3CStorage(config["region"], config["endpoint"], config["bucket"], config["directory"], config["access_key"], config["secret_key"], threads) storage.SetDefaultNestingLevels([]int{2, 3}, 2) return storage, err + } else if testStorageName == "digitalocean" { + storage, err := CreateS3CStorage(config["region"], config["endpoint"], config["bucket"], config["directory"], config["access_key"], config["secret_key"], threads) + storage.SetDefaultNestingLevels([]int{2, 3}, 2) + return storage, err } else if testStorageName == "minio" { storage, err := CreateS3Storage(config["region"], config["endpoint"], config["bucket"], config["directory"], config["access_key"], config["secret_key"], threads, false, true) storage.SetDefaultNestingLevels([]int{2, 3}, 2) @@ -579,4 +583,12 @@ func TestCleanStorage(t *testing.T) { storage.DeleteFile(0, "config") LOG_INFO("DELETE_FILE", "Deleted config") + + files, _, err := storage.ListFiles(0, "chunks/") + for _, file := range files { + if len(file) > 0 && file[len(file)-1] != '/' { + LOG_DEBUG("FILE_EXIST", "File %s exists after deletion", file) + } + } + }