Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

crypt: add integration tests for obfuscate name encryption

Nick Craig-Wood4b4c59a4bb33
diff --git a/amazonclouddrive/amazonclouddrive_test.go b/amazonclouddrive/amazonclouddrive_test.go
index 57e235221..f23707534 100644
--- a/amazonclouddrive/amazonclouddrive_test.go
+++ b/amazonclouddrive/amazonclouddrive_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/b2/b2_test.go b/b2/b2_test.go
index fa9cd9ede..6a40fcd12 100644
--- a/b2/b2_test.go
+++ b/b2/b2_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/crypt/crypt2_test.go b/crypt/crypt2_test.go
index ed78eeeea..ee3c90879 100644
--- a/crypt/crypt2_test.go
+++ b/crypt/crypt2_test.go
@@ -38,8 +38,8 @@ func TestFsListSubdir2(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel22(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile12(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject2(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir2(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and22(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir2(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy2(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove2(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove2(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/crypt/crypt3_test.go b/crypt/crypt3_test.go
new file mode 100644
index 000000000..baaa828f9
--- /dev/null
+++ b/crypt/crypt3_test.go
@@ -0,0 +1,64 @@
+// Test Crypt filesystem interface
+//
+// Automatically generated - DO NOT EDIT
+// Regenerate with: make gen_tests
+package crypt_test
+
+import (
+ "testing"
+
+ "github.com/ncw/rclone/crypt"
+ "github.com/ncw/rclone/fs"
+ "github.com/ncw/rclone/fstest/fstests"
+ _ "github.com/ncw/rclone/local"
+)
+
+func TestSetup3(t *testing.T) {
+ fstests.NilObject = fs.Object((*crypt.Object)(nil))
+ fstests.RemoteName = "TestCrypt3:"
+}
+
+// Generic tests for the Fs
+func TestInit3(t *testing.T) { fstests.TestInit(t) }
+func TestFsString3(t *testing.T) { fstests.TestFsString(t) }
+func TestFsRmdirEmpty3(t *testing.T) { fstests.TestFsRmdirEmpty(t) }
+func TestFsRmdirNotFound3(t *testing.T) { fstests.TestFsRmdirNotFound(t) }
+func TestFsMkdir3(t *testing.T) { fstests.TestFsMkdir(t) }
+func TestFsMkdirRmdirSubdir3(t *testing.T) { fstests.TestFsMkdirRmdirSubdir(t) }
+func TestFsListEmpty3(t *testing.T) { fstests.TestFsListEmpty(t) }
+func TestFsListDirEmpty3(t *testing.T) { fstests.TestFsListDirEmpty(t) }
+func TestFsNewObjectNotFound3(t *testing.T) { fstests.TestFsNewObjectNotFound(t) }
+func TestFsPutFile13(t *testing.T) { fstests.TestFsPutFile1(t) }
+func TestFsPutError3(t *testing.T) { fstests.TestFsPutError(t) }
+func TestFsPutFile23(t *testing.T) { fstests.TestFsPutFile2(t) }
+func TestFsUpdateFile13(t *testing.T) { fstests.TestFsUpdateFile1(t) }
+func TestFsListDirFile23(t *testing.T) { fstests.TestFsListDirFile2(t) }
+func TestFsListDirRoot3(t *testing.T) { fstests.TestFsListDirRoot(t) }
+func TestFsListSubdir3(t *testing.T) { fstests.TestFsListSubdir(t) }
+func TestFsListLevel23(t *testing.T) { fstests.TestFsListLevel2(t) }
+func TestFsListFile13(t *testing.T) { fstests.TestFsListFile1(t) }
+func TestFsNewObject3(t *testing.T) { fstests.TestFsNewObject(t) }
+func TestFsListFile1and23(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir3(t *testing.T) { fstests.TestFsNewObjectDir(t) }
+func TestFsCopy3(t *testing.T) { fstests.TestFsCopy(t) }
+func TestFsMove3(t *testing.T) { fstests.TestFsMove(t) }
+func TestFsDirMove3(t *testing.T) { fstests.TestFsDirMove(t) }
+func TestFsRmdirFull3(t *testing.T) { fstests.TestFsRmdirFull(t) }
+func TestFsPrecision3(t *testing.T) { fstests.TestFsPrecision(t) }
+func TestObjectString3(t *testing.T) { fstests.TestObjectString(t) }
+func TestObjectFs3(t *testing.T) { fstests.TestObjectFs(t) }
+func TestObjectRemote3(t *testing.T) { fstests.TestObjectRemote(t) }
+func TestObjectHashes3(t *testing.T) { fstests.TestObjectHashes(t) }
+func TestObjectModTime3(t *testing.T) { fstests.TestObjectModTime(t) }
+func TestObjectMimeType3(t *testing.T) { fstests.TestObjectMimeType(t) }
+func TestObjectSetModTime3(t *testing.T) { fstests.TestObjectSetModTime(t) }
+func TestObjectSize3(t *testing.T) { fstests.TestObjectSize(t) }
+func TestObjectOpen3(t *testing.T) { fstests.TestObjectOpen(t) }
+func TestObjectOpenSeek3(t *testing.T) { fstests.TestObjectOpenSeek(t) }
+func TestObjectUpdate3(t *testing.T) { fstests.TestObjectUpdate(t) }
+func TestObjectStorable3(t *testing.T) { fstests.TestObjectStorable(t) }
+func TestFsIsFile3(t *testing.T) { fstests.TestFsIsFile(t) }
+func TestFsIsFileNotFound3(t *testing.T) { fstests.TestFsIsFileNotFound(t) }
+func TestObjectRemove3(t *testing.T) { fstests.TestObjectRemove(t) }
+func TestObjectPurge3(t *testing.T) { fstests.TestObjectPurge(t) }
+func TestFinalise3(t *testing.T) { fstests.TestFinalise(t) }
diff --git a/crypt/crypt_config_test.go b/crypt/crypt_config_test.go
index 0b3ecedde..954ab9f31 100644
--- a/crypt/crypt_config_test.go
+++ b/crypt/crypt_config_test.go
@@ -14,6 +14,8 @@ func init() {
name := "TestCrypt"
tempdir2 := filepath.Join(os.TempDir(), "rclone-crypt-test-off")
name2 := name + "2"
+ tempdir3 := filepath.Join(os.TempDir(), "rclone-crypt-test-obfuscate")
+ name3 := name + "3"
fstests.ExtraConfig = []fstests.ExtraConfigItem{
{Name: name, Key: "type", Value: "crypt"},
{Name: name, Key: "remote", Value: tempdir},
@@ -23,5 +25,9 @@ func init() {
{Name: name2, Key: "remote", Value: tempdir2},
{Name: name2, Key: "password", Value: fs.MustObscure("potato2")},
{Name: name2, Key: "filename_encryption", Value: "off"},
+ {Name: name3, Key: "type", Value: "crypt"},
+ {Name: name3, Key: "remote", Value: tempdir3},
+ {Name: name3, Key: "password", Value: fs.MustObscure("potato2")},
+ {Name: name3, Key: "filename_encryption", Value: "obfuscate"},
}
}
diff --git a/crypt/crypt_test.go b/crypt/crypt_test.go
index f7942ddc4..5afa04389 100644
--- a/crypt/crypt_test.go
+++ b/crypt/crypt_test.go
@@ -38,8 +38,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/drive/drive_test.go b/drive/drive_test.go
index 61e62847f..26e4bc46c 100644
--- a/drive/drive_test.go
+++ b/drive/drive_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/dropbox/dropbox_test.go b/dropbox/dropbox_test.go
index c883cba6c..f1f6f7a96 100644
--- a/dropbox/dropbox_test.go
+++ b/dropbox/dropbox_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/fstest/fstests/gen_tests.go b/fstest/fstests/gen_tests.go
index 5b4ea35fa..f6caec15b 100644
--- a/fstest/fstests/gen_tests.go
+++ b/fstest/fstests/gen_tests.go
@@ -140,6 +140,7 @@ func main() {
generateTestProgram(t, fns, "Yandex", "")
generateTestProgram(t, fns, "Crypt", "")
generateTestProgram(t, fns, "Crypt", "2")
+ generateTestProgram(t, fns, "Crypt", "3")
generateTestProgram(t, fns, "Sftp", "")
log.Printf("Done")
}
diff --git a/googlecloudstorage/googlecloudstorage_test.go b/googlecloudstorage/googlecloudstorage_test.go
index 7bc11da5c..14d8a62c3 100644
--- a/googlecloudstorage/googlecloudstorage_test.go
+++ b/googlecloudstorage/googlecloudstorage_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/hubic/hubic_test.go b/hubic/hubic_test.go
index 50ed80e7e..9dd920aba 100644
--- a/hubic/hubic_test.go
+++ b/hubic/hubic_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/local/local_test.go b/local/local_test.go
index 7eedd7460..fb7c0695a 100644
--- a/local/local_test.go
+++ b/local/local_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/onedrive/onedrive_test.go b/onedrive/onedrive_test.go
index 9adf43ebd..e2e207c1b 100644
--- a/onedrive/onedrive_test.go
+++ b/onedrive/onedrive_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/s3/s3_test.go b/s3/s3_test.go
index b064e51b6..252222fea 100644
--- a/s3/s3_test.go
+++ b/s3/s3_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/sftp/sftp_test.go b/sftp/sftp_test.go
index 26b20bc30..ea4fd9946 100644
--- a/sftp/sftp_test.go
+++ b/sftp/sftp_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/swift/swift_test.go b/swift/swift_test.go
index 75910f167..62e62b4e6 100644
--- a/swift/swift_test.go
+++ b/swift/swift_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }
diff --git a/yandex/yandex_test.go b/yandex/yandex_test.go
index 99dd2537e..4b8de14bb 100644
--- a/yandex/yandex_test.go
+++ b/yandex/yandex_test.go
@@ -37,8 +37,8 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
-func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
+func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
func TestFsDirMove(t *testing.T) { fstests.TestFsDirMove(t) }