2019-06-15 04:55:21 +08:00
|
|
|
// Test Crypt filesystem interface
|
|
|
|
package compress
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
2021-01-17 09:21:33 +08:00
|
|
|
_ "github.com/rclone/rclone/backend/drive"
|
2019-06-15 04:55:21 +08:00
|
|
|
_ "github.com/rclone/rclone/backend/local"
|
2021-01-17 09:21:33 +08:00
|
|
|
_ "github.com/rclone/rclone/backend/s3"
|
|
|
|
_ "github.com/rclone/rclone/backend/swift"
|
2019-06-15 04:55:21 +08:00
|
|
|
"github.com/rclone/rclone/fstest"
|
|
|
|
"github.com/rclone/rclone/fstest/fstests"
|
|
|
|
)
|
|
|
|
|
2023-09-04 20:22:26 +08:00
|
|
|
var defaultOpt = fstests.Opt{
|
|
|
|
RemoteName: "TestCompress:",
|
|
|
|
NilObject: (*Object)(nil),
|
|
|
|
UnimplementableFsMethods: []string{
|
|
|
|
"OpenWriterAt",
|
|
|
|
"OpenChunkWriter",
|
|
|
|
"MergeDirs",
|
|
|
|
"DirCacheFlush",
|
|
|
|
"PutUnchecked",
|
|
|
|
"PutStream",
|
|
|
|
"UserInfo",
|
|
|
|
"Disconnect",
|
|
|
|
},
|
|
|
|
TiersToTest: []string{"STANDARD", "STANDARD_IA"},
|
|
|
|
UnimplementableObjectMethods: []string{},
|
|
|
|
}
|
|
|
|
|
2019-06-15 04:55:21 +08:00
|
|
|
// TestIntegration runs integration tests against the remote
|
|
|
|
func TestIntegration(t *testing.T) {
|
2023-09-04 20:22:26 +08:00
|
|
|
fstests.Run(t, &defaultOpt)
|
2019-06-15 04:55:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// TestRemoteGzip tests GZIP compression
|
|
|
|
func TestRemoteGzip(t *testing.T) {
|
|
|
|
if *fstest.RemoteName != "" {
|
|
|
|
t.Skip("Skipping as -remote set")
|
|
|
|
}
|
|
|
|
tempdir := filepath.Join(os.TempDir(), "rclone-compress-test-gzip")
|
|
|
|
name := "TestCompressGzip"
|
2023-09-04 20:22:26 +08:00
|
|
|
opt := defaultOpt
|
|
|
|
opt.RemoteName = name + ":"
|
|
|
|
opt.ExtraConfig = []fstests.ExtraConfigItem{
|
|
|
|
{Name: name, Key: "type", Value: "compress"},
|
|
|
|
{Name: name, Key: "remote", Value: tempdir},
|
|
|
|
{Name: name, Key: "compression_mode", Value: "gzip"},
|
|
|
|
}
|
|
|
|
opt.QuickTestOK = true
|
|
|
|
fstests.Run(t, &opt)
|
2019-06-15 04:55:21 +08:00
|
|
|
}
|