diff --git a/backend/amazonclouddrive/amazonclouddrive_test.go b/backend/amazonclouddrive/amazonclouddrive_test.go index e0450fa03..73dffbb3e 100644 --- a/backend/amazonclouddrive/amazonclouddrive_test.go +++ b/backend/amazonclouddrive/amazonclouddrive_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/azureblob/azureblob_test.go b/backend/azureblob/azureblob_test.go index 3de0609dd..8fe04ff7a 100644 --- a/backend/azureblob/azureblob_test.go +++ b/backend/azureblob/azureblob_test.go @@ -74,4 +74,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/b2/b2_test.go b/backend/b2/b2_test.go index 2ecc31f2c..8be738e9a 100644 --- a/backend/b2/b2_test.go +++ b/backend/b2/b2_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/box/box_test.go b/backend/box/box_test.go index 9d0a84526..c83f83563 100644 --- a/backend/box/box_test.go +++ b/backend/box/box_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/cache/cache_test.go b/backend/cache/cache_test.go index 0a118c25e..26845cded 100644 --- a/backend/cache/cache_test.go +++ b/backend/cache/cache_test.go @@ -75,4 +75,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/crypt/crypt2_test.go b/backend/crypt/crypt2_test.go index 715090ed2..f3c29057b 100644 --- a/backend/crypt/crypt2_test.go +++ b/backend/crypt/crypt2_test.go @@ -72,4 +72,5 @@ func TestFsIsFileNotFound2(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove2(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream2(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge2(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal2(t *testing.T) { fstests.TestInternal(t) } func TestFinalise2(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/crypt/crypt3_test.go b/backend/crypt/crypt3_test.go index 2737a39c2..13d4f90f9 100644 --- a/backend/crypt/crypt3_test.go +++ b/backend/crypt/crypt3_test.go @@ -72,4 +72,5 @@ func TestFsIsFileNotFound3(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove3(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream3(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge3(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal3(t *testing.T) { fstests.TestInternal(t) } func TestFinalise3(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/crypt/crypt_test.go b/backend/crypt/crypt_test.go index 030586dbf..133754b9b 100644 --- a/backend/crypt/crypt_test.go +++ b/backend/crypt/crypt_test.go @@ -72,4 +72,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/drive/drive_test.go b/backend/drive/drive_test.go index 90f4e9367..27c44900e 100644 --- a/backend/drive/drive_test.go +++ b/backend/drive/drive_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/dropbox/dropbox_test.go b/backend/dropbox/dropbox_test.go index 2ca4b7c06..36f5136cf 100644 --- a/backend/dropbox/dropbox_test.go +++ b/backend/dropbox/dropbox_test.go @@ -74,4 +74,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/ftp/ftp_test.go b/backend/ftp/ftp_test.go index 252eec306..d19661bc0 100644 --- a/backend/ftp/ftp_test.go +++ b/backend/ftp/ftp_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/googlecloudstorage/googlecloudstorage_test.go b/backend/googlecloudstorage/googlecloudstorage_test.go index e782a93c9..9187759b0 100644 --- a/backend/googlecloudstorage/googlecloudstorage_test.go +++ b/backend/googlecloudstorage/googlecloudstorage_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/hubic/hubic_test.go b/backend/hubic/hubic_test.go index d8a9dfd54..892b34aab 100644 --- a/backend/hubic/hubic_test.go +++ b/backend/hubic/hubic_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/local/local_test.go b/backend/local/local_test.go index 31c76e775..0f81dbcfb 100644 --- a/backend/local/local_test.go +++ b/backend/local/local_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/onedrive/onedrive_test.go b/backend/onedrive/onedrive_test.go index 23af86c69..e030160d0 100644 --- a/backend/onedrive/onedrive_test.go +++ b/backend/onedrive/onedrive_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/pcloud/pcloud_test.go b/backend/pcloud/pcloud_test.go index 53d7c49ff..00efb1c89 100644 --- a/backend/pcloud/pcloud_test.go +++ b/backend/pcloud/pcloud_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/qingstor/qingstor_test.go b/backend/qingstor/qingstor_test.go index eeb359273..85d7a00cb 100644 --- a/backend/qingstor/qingstor_test.go +++ b/backend/qingstor/qingstor_test.go @@ -74,4 +74,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/s3/s3_test.go b/backend/s3/s3_test.go index cd988b36c..f0a040ecd 100644 --- a/backend/s3/s3_test.go +++ b/backend/s3/s3_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/sftp/sftp_test.go b/backend/sftp/sftp_test.go index c5f9439bb..d1b0c928b 100644 --- a/backend/sftp/sftp_test.go +++ b/backend/sftp/sftp_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/swift/swift_test.go b/backend/swift/swift_test.go index e68b24613..d95c4dddd 100644 --- a/backend/swift/swift_test.go +++ b/backend/swift/swift_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/webdav/webdav_test.go b/backend/webdav/webdav_test.go index bc880993c..6e5690478 100644 --- a/backend/webdav/webdav_test.go +++ b/backend/webdav/webdav_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/backend/yandex/yandex_test.go b/backend/yandex/yandex_test.go index 65743036d..f786f2fed 100644 --- a/backend/yandex/yandex_test.go +++ b/backend/yandex/yandex_test.go @@ -71,4 +71,5 @@ func TestFsIsFileNotFound(t *testing.T) { fstests.TestFsIsFileNotFound(t) } func TestObjectRemove(t *testing.T) { fstests.TestObjectRemove(t) } func TestFsPutStream(t *testing.T) { fstests.TestFsPutStream(t) } func TestObjectPurge(t *testing.T) { fstests.TestObjectPurge(t) } +func TestInternal(t *testing.T) { fstests.TestInternal(t) } func TestFinalise(t *testing.T) { fstests.TestFinalise(t) } diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 032b87c3e..e7c4dbb68 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -57,6 +57,13 @@ var ( isLocalRemote bool ) +// InternalTester is an optional interface for Fs which allows to execute internal tests +// +// This interface should be implemented in 'backend'_internal_test.go and not in 'backend'.go +type InternalTester interface { + InternalTest(*testing.T) +} + // ExtraConfigItem describes a config item added on the fly while testing type ExtraConfigItem struct{ Name, Key, Value string } @@ -970,6 +977,16 @@ func TestObjectPurge(t *testing.T) { assert.Error(t, err, "Expecting error after on second purge") } +// TestInternal calls InternalTest() on the Fs +func TestInternal(t *testing.T) { + skipIfNotOk(t) + if it, ok := remote.(InternalTester); ok { + it.InternalTest(t) + } else { + t.Skipf("%T does not implement InternalTester", remote) + } +} + // TestFinalise tidies up after the previous tests func TestFinalise(t *testing.T) { skipIfNotOk(t)