diff --git a/builtin/logical/transit/backend_test.go b/builtin/logical/transit/backend_test.go index 17d44f021da3..562b6d3b9055 100644 --- a/builtin/logical/transit/backend_test.go +++ b/builtin/logical/transit/backend_test.go @@ -27,7 +27,7 @@ const ( testPlaintext = "the quick brown fox" ) -func createBackendWithStorage(t *testing.T) (*backend, logical.Storage) { +func createBackendWithStorage(t testing.TB) (*backend, logical.Storage) { config := logical.TestBackendConfig() config.StorageView = &logical.InmemStorage{} @@ -42,7 +42,7 @@ func createBackendWithStorage(t *testing.T) (*backend, logical.Storage) { return b, config.StorageView } -func createBackendWithSysView(t *testing.T) (*backend, logical.Storage) { +func createBackendWithSysView(t testing.TB) (*backend, logical.Storage) { sysView := logical.TestSystemView() storage := &logical.InmemStorage{} @@ -64,7 +64,7 @@ func createBackendWithSysView(t *testing.T) (*backend, logical.Storage) { return b, storage } -func createBackendWithSysViewWithStorage(t *testing.T, s logical.Storage) *backend { +func createBackendWithSysViewWithStorage(t testing.TB, s logical.Storage) *backend { sysView := logical.TestSystemView() conf := &logical.BackendConfig{ @@ -85,7 +85,7 @@ func createBackendWithSysViewWithStorage(t *testing.T, s logical.Storage) *backe return b } -func createBackendWithForceNoCacheWithSysViewWithStorage(t *testing.T, s logical.Storage) *backend { +func createBackendWithForceNoCacheWithSysViewWithStorage(t testing.TB, s logical.Storage) *backend { sysView := logical.TestSystemView() sysView.CachingDisabledVal = true diff --git a/builtin/logical/transit/path_decrypt_bench_test.go b/builtin/logical/transit/path_decrypt_bench_test.go index 056c6261d82a..bc93fc5c4049 100644 --- a/builtin/logical/transit/path_decrypt_bench_test.go +++ b/builtin/logical/transit/path_decrypt_bench_test.go @@ -7,21 +7,6 @@ import ( "github.com/hashicorp/vault/sdk/logical" ) -func createBenchBackendWithStorage(b *testing.B) (*backend, logical.Storage) { - config := logical.TestBackendConfig() - config.StorageView = &logical.InmemStorage{} - - backend, _ := Backend(context.Background(), config) - if b == nil { - b.Fatalf("failed to create backend") - } - err := backend.Backend.Setup(context.Background(), config) - if err != nil { - b.Fatal(err) - } - return backend, config.StorageView -} - func BenchmarkTransit_BatchDecryption1(b *testing.B) { BTransit_BatchDecryption(b, 1) } @@ -52,7 +37,7 @@ func BTransit_BatchDecryption(b *testing.B, bsize int) { var resp *logical.Response var err error - backend, s := createBenchBackendWithStorage(b) + backend, s := createBackendWithStorage(b) batchEncryptionInput := make([]interface{}, 0, bsize) for i := 0; i < bsize; i++ { diff --git a/builtin/logical/transit/path_encrypt_bench_test.go b/builtin/logical/transit/path_encrypt_bench_test.go index 90089f799d39..e648c6e02fc3 100644 --- a/builtin/logical/transit/path_encrypt_bench_test.go +++ b/builtin/logical/transit/path_encrypt_bench_test.go @@ -37,7 +37,7 @@ func BTransit_BatchEncryption(b *testing.B, bsize int) { var resp *logical.Response var err error - backend, s := createBenchBackendWithStorage(b) + backend, s := createBackendWithStorage(b) batchEncryptionInput := make([]interface{}, 0, bsize) for i := 0; i < bsize; i++ {