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

opendrive: run the chunked upload integration tests

Nick Craig-Wood5fef6a84a860
diff --git a/backend/opendrive/opendrive_internal_test.go b/backend/opendrive/opendrive_internal_test.go
new file mode 100644
index 000000000..55c936b35
--- /dev/null
+++ b/backend/opendrive/opendrive_internal_test.go
@@ -0,0 +1,17 @@
+package opendrive
+
+import (
+ "github.com/rclone/rclone/fs"
+ "github.com/rclone/rclone/fstest/fstests"
+)
+
+// SetUploadChunkSize changes the configured chunk size, returning the old value.
+//
+// It is only called by the integration tests while no transfer is in progress.
+func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) {
+ var old fs.SizeSuffix
+ old, f.opt.ChunkSize = f.opt.ChunkSize, cs
+ return old, nil
+}
+
+var _ fstests.SetUploadChunkSizer = (*Fs)(nil)
diff --git a/backend/opendrive/opendrive_test.go b/backend/opendrive/opendrive_test.go
index f857ed478..a3fd8e968 100644
--- a/backend/opendrive/opendrive_test.go
+++ b/backend/opendrive/opendrive_test.go
@@ -13,5 +13,8 @@ func TestIntegration(t *testing.T) {
fstests.Run(t, &fstests.Opt{
RemoteName: "TestOpenDrive:",
NilObject: (*opendrive.Object)(nil),
+ ChunkedUpload: fstests.ChunkedUploadConfig{
+ MinChunkSize: 1,
+ },
})
}