crypt: ensure integration tests run correctly when -remote is set
This commit is contained in:
parent
fbab1e55bb
commit
fe61cff079
1 changed files with 23 additions and 0 deletions
|
@ -7,13 +7,30 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ncw/rclone/backend/crypt"
|
"github.com/ncw/rclone/backend/crypt"
|
||||||
|
_ "github.com/ncw/rclone/backend/drive" // for integration tests
|
||||||
_ "github.com/ncw/rclone/backend/local"
|
_ "github.com/ncw/rclone/backend/local"
|
||||||
|
_ "github.com/ncw/rclone/backend/swift" // for integration tests
|
||||||
"github.com/ncw/rclone/fs/config/obscure"
|
"github.com/ncw/rclone/fs/config/obscure"
|
||||||
|
"github.com/ncw/rclone/fstest"
|
||||||
"github.com/ncw/rclone/fstest/fstests"
|
"github.com/ncw/rclone/fstest/fstests"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TestIntegration runs integration tests against the remote
|
||||||
|
func TestIntegration(t *testing.T) {
|
||||||
|
if *fstest.RemoteName == "" {
|
||||||
|
t.Skip("Skipping as -remote not set")
|
||||||
|
}
|
||||||
|
fstests.Run(t, &fstests.Opt{
|
||||||
|
RemoteName: *fstest.RemoteName,
|
||||||
|
NilObject: (*crypt.Object)(nil),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// TestStandard runs integration tests against the remote
|
// TestStandard runs integration tests against the remote
|
||||||
func TestStandard(t *testing.T) {
|
func TestStandard(t *testing.T) {
|
||||||
|
if *fstest.RemoteName != "" {
|
||||||
|
t.Skip("Skipping as -remote set")
|
||||||
|
}
|
||||||
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-standard")
|
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-standard")
|
||||||
name := "TestCrypt"
|
name := "TestCrypt"
|
||||||
fstests.Run(t, &fstests.Opt{
|
fstests.Run(t, &fstests.Opt{
|
||||||
|
@ -30,6 +47,9 @@ func TestStandard(t *testing.T) {
|
||||||
|
|
||||||
// TestOff runs integration tests against the remote
|
// TestOff runs integration tests against the remote
|
||||||
func TestOff(t *testing.T) {
|
func TestOff(t *testing.T) {
|
||||||
|
if *fstest.RemoteName != "" {
|
||||||
|
t.Skip("Skipping as -remote set")
|
||||||
|
}
|
||||||
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-off")
|
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-off")
|
||||||
name := "TestCrypt2"
|
name := "TestCrypt2"
|
||||||
fstests.Run(t, &fstests.Opt{
|
fstests.Run(t, &fstests.Opt{
|
||||||
|
@ -46,6 +66,9 @@ func TestOff(t *testing.T) {
|
||||||
|
|
||||||
// TestObfuscate runs integration tests against the remote
|
// TestObfuscate runs integration tests against the remote
|
||||||
func TestObfuscate(t *testing.T) {
|
func TestObfuscate(t *testing.T) {
|
||||||
|
if *fstest.RemoteName != "" {
|
||||||
|
t.Skip("Skipping as -remote set")
|
||||||
|
}
|
||||||
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-obfuscate")
|
tempdir := filepath.Join(os.TempDir(), "rclone-crypt-test-obfuscate")
|
||||||
name := "TestCrypt3"
|
name := "TestCrypt3"
|
||||||
fstests.Run(t, &fstests.Opt{
|
fstests.Run(t, &fstests.Opt{
|
||||||
|
|
Loading…
Reference in a new issue