2014-07-24 21:50:11 +00:00
|
|
|
// Test S3 filesystem interface
|
2018-09-07 11:02:27 +00:00
|
|
|
package s3
|
2014-07-24 21:50:11 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-07-28 17:47:38 +00:00
|
|
|
"github.com/rclone/rclone/fs"
|
2022-09-26 06:59:57 +00:00
|
|
|
"github.com/rclone/rclone/fstest"
|
2019-07-28 17:47:38 +00:00
|
|
|
"github.com/rclone/rclone/fstest/fstests"
|
2014-07-24 21:50:11 +00:00
|
|
|
)
|
|
|
|
|
2018-04-07 17:48:11 +00:00
|
|
|
// TestIntegration runs integration tests against the remote
|
|
|
|
func TestIntegration(t *testing.T) {
|
|
|
|
fstests.Run(t, &fstests.Opt{
|
2019-09-09 19:44:50 +00:00
|
|
|
RemoteName: "TestS3:",
|
|
|
|
NilObject: (*Object)(nil),
|
|
|
|
TiersToTest: []string{"STANDARD", "STANDARD_IA"},
|
2018-09-07 11:02:27 +00:00
|
|
|
ChunkedUpload: fstests.ChunkedUploadConfig{
|
|
|
|
MinChunkSize: minChunkSize,
|
|
|
|
},
|
2018-04-07 17:48:11 +00:00
|
|
|
})
|
2014-07-24 21:50:11 +00:00
|
|
|
}
|
2018-09-07 11:02:27 +00:00
|
|
|
|
2022-09-26 06:59:57 +00:00
|
|
|
func TestIntegration2(t *testing.T) {
|
|
|
|
if *fstest.RemoteName != "" {
|
|
|
|
t.Skip("skipping as -remote is set")
|
|
|
|
}
|
|
|
|
name := "TestS3"
|
|
|
|
fstests.Run(t, &fstests.Opt{
|
|
|
|
RemoteName: name + ":",
|
|
|
|
NilObject: (*Object)(nil),
|
|
|
|
TiersToTest: []string{"STANDARD", "STANDARD_IA"},
|
|
|
|
ChunkedUpload: fstests.ChunkedUploadConfig{
|
|
|
|
MinChunkSize: minChunkSize,
|
|
|
|
},
|
|
|
|
ExtraConfig: []fstests.ExtraConfigItem{
|
|
|
|
{Name: name, Key: "directory_markers", Value: "true"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-09-07 11:02:27 +00:00
|
|
|
func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) {
|
|
|
|
return f.setUploadChunkSize(cs)
|
|
|
|
}
|
|
|
|
|
2018-11-26 21:09:23 +00:00
|
|
|
func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) {
|
|
|
|
return f.setUploadCutoff(cs)
|
|
|
|
}
|
|
|
|
|
2018-09-07 11:02:27 +00:00
|
|
|
var _ fstests.SetUploadChunkSizer = (*Fs)(nil)
|