Documentation ¶
Index ¶
- func CloseRaftStorage(t testing.T, cluster *vault.TestCluster, idx int)
- func ClusterSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions, ...) (*vault.CoreConfig, *vault.TestClusterOptions)
- func FileBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
- func InmemBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
- func InmemNonTransactionalBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
- func MakeFileBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
- func MakeInmemBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
- func MakeInmemNonTransactionalBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
- func MakeRaftBackend(t testing.T, coreIdx int, logger hclog.Logger) *vault.PhysicalBackendBundle
- func MakeRaftBackendWithConf(t testing.T, coreIdx int, logger hclog.Logger, extraConf map[string]string) *vault.PhysicalBackendBundle
- func MakeReusableRaftHAStorage(t testing.T, logger hclog.Logger, numCores int, ...) (ReusableStorage, StorageCleanup)
- func MakeReusableRaftStorage(t testing.T, logger hclog.Logger, numCores int, ...) (ReusableStorage, StorageCleanup)
- func MakeReusableStorage(t testing.T, logger hclog.Logger, bundle *vault.PhysicalBackendBundle) (ReusableStorage, StorageCleanup)
- func RaftBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
- func RaftHAFactory(f PhysicalBackendBundler) ...
- func RaftHASetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions, ...)
- func SharedPhysicalFactory(f PhysicalBackendBundler) ...
- type ClusterSetupMutator
- type PhysicalBackendBundler
- type ReusableStorage
- type StorageCleanup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseRaftStorage ¶ added in v1.5.0
func CloseRaftStorage(t testing.T, cluster *vault.TestCluster, idx int)
CloseRaftStorage closes open files being used by raft.
func ClusterSetup ¶ added in v1.4.0
func ClusterSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions, setup ClusterSetupMutator) (*vault.CoreConfig, *vault.TestClusterOptions)
func FileBackendSetup ¶
func FileBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
func InmemBackendSetup ¶
func InmemBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
func InmemNonTransactionalBackendSetup ¶
func InmemNonTransactionalBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
func MakeFileBackend ¶
func MakeFileBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
func MakeInmemBackend ¶
func MakeInmemBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
func MakeInmemNonTransactionalBackend ¶
func MakeInmemNonTransactionalBackend(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
func MakeRaftBackend ¶
func MakeRaftBackend(t testing.T, coreIdx int, logger hclog.Logger) *vault.PhysicalBackendBundle
func MakeRaftBackendWithConf ¶ added in v1.6.0
func MakeRaftBackendWithConf(t testing.T, coreIdx int, logger hclog.Logger, extraConf map[string]string) *vault.PhysicalBackendBundle
func MakeReusableRaftHAStorage ¶ added in v1.5.0
func MakeReusableRaftHAStorage(t testing.T, logger hclog.Logger, numCores int, bundle *vault.PhysicalBackendBundle) (ReusableStorage, StorageCleanup)
func MakeReusableRaftStorage ¶ added in v1.5.0
func MakeReusableRaftStorage(t testing.T, logger hclog.Logger, numCores int, addressProvider raftlib.ServerAddressProvider) (ReusableStorage, StorageCleanup)
MakeReusableRaftStorage makes a physical raft backend that can be re-used across multiple test clusters in sequence.
func MakeReusableStorage ¶ added in v1.5.0
func MakeReusableStorage(t testing.T, logger hclog.Logger, bundle *vault.PhysicalBackendBundle) (ReusableStorage, StorageCleanup)
MakeReusableStorage makes a physical backend that can be re-used across multiple test clusters in sequence.
func RaftBackendSetup ¶
func RaftBackendSetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
func RaftHAFactory ¶ added in v1.5.0
func RaftHAFactory(f PhysicalBackendBundler) func(t testing.T, coreIdx int, logger hclog.Logger) *vault.PhysicalBackendBundle
RaftHAFactory returns a PhysicalBackendBundle with raft set as the HABackend and the physical.Backend provided in PhysicalBackendBundler as the storage backend.
func RaftHASetup ¶ added in v1.5.0
func RaftHASetup(conf *vault.CoreConfig, opts *vault.TestClusterOptions, bundler PhysicalBackendBundler)
func SharedPhysicalFactory ¶
func SharedPhysicalFactory(f PhysicalBackendBundler) func(t testing.T, coreIdx int, logger hclog.Logger) *vault.PhysicalBackendBundle
Types ¶
type ClusterSetupMutator ¶
type ClusterSetupMutator func(conf *vault.CoreConfig, opts *vault.TestClusterOptions)
type PhysicalBackendBundler ¶ added in v1.5.0
type PhysicalBackendBundler func(t testing.T, logger hclog.Logger) *vault.PhysicalBackendBundle
type ReusableStorage ¶ added in v1.5.0
type ReusableStorage struct { // IsRaft specifies whether the storage is using a raft backend. IsRaft bool // Setup should be called just before a new TestCluster is created. Setup ClusterSetupMutator // Cleanup should be called after a TestCluster is no longer // needed -- generally in a defer, just before the call to // cluster.Cleanup(). Cleanup func(t testing.T, cluster *vault.TestCluster) }
ReusableStorage is a physical backend that can be re-used across multiple test clusters in sequence. It is useful for testing things like seal migration, wherein a given physical backend must be re-used as several test clusters are sequentially created, tested, and discarded.
type StorageCleanup ¶ added in v1.5.0
type StorageCleanup func()
StorageCleanup is a function that should be called once -- at the very end of a given unit test, after each of the sequence of clusters have been created, tested, and discarded.