Documentation ¶
Index ¶
- func AttemptUnsealCore(c *vault.TestCluster, core *vault.TestClusterCore) error
- func AttemptUnsealCores(c *vault.TestCluster) error
- func AwaitLeader(t testing.T, cluster *vault.TestCluster) (int, error)
- func DeriveActiveCore(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
- func DeriveStableActiveCore(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
- func DeriveStandbyCores(t testing.T, cluster *vault.TestCluster) []*vault.TestClusterCore
- func EnsureCoreSealed(t testing.T, core *vault.TestClusterCore)
- func EnsureCoreUnsealed(t testing.T, c *vault.TestCluster, core *vault.TestClusterCore)
- func EnsureCoresSealed(t testing.T, c *vault.TestCluster)
- func EnsureCoresUnsealed(t testing.T, c *vault.TestCluster)
- func EnsureStableActiveNode(t testing.T, cluster *vault.TestCluster)
- func GenerateDebugLogs(t testing.T, client *api.Client) chan struct{}
- func GenerateRoot(t testing.T, cluster *vault.TestCluster, kind GenerateRootKind) string
- func GenerateRootWithError(t testing.T, cluster *vault.TestCluster, kind GenerateRootKind) (string, error)
- func NewHardcodedServerAddressProvider(numCores, baseClusterPort int) raftlib.ServerAddressProvider
- func RaftAppliedIndex(core *vault.TestClusterCore) uint64
- func RaftClusterJoinNodes(t testing.T, cluster *vault.TestCluster)
- func RandomWithPrefix(name string) string
- func RekeyCluster(t testing.T, cluster *vault.TestCluster, recovery bool) [][]byte
- func SealCores(t testing.T, cluster *vault.TestCluster)
- func VerifyRaftConfiguration(core *vault.TestClusterCore, numCores int) error
- func VerifyRaftPeers(t testing.T, client *api.Client, expected map[string]bool)
- func WaitForActiveNode(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
- func WaitForActiveNodeAndStandbys(t testing.T, cluster *vault.TestCluster)
- func WaitForNCoresSealed(t testing.T, cluster *vault.TestCluster, n int)
- func WaitForNCoresUnsealed(t testing.T, cluster *vault.TestCluster, n int)
- func WaitForRaftApply(t testing.T, core *vault.TestClusterCore, index uint64)
- func WaitForStandbyNode(t testing.T, core *vault.TestClusterCore)
- type GenerateRootKind
- type HardcodedServerAddressProvider
- type TestRaftServerAddressProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttemptUnsealCore ¶ added in v1.6.4
func AttemptUnsealCore(c *vault.TestCluster, core *vault.TestClusterCore) error
func AttemptUnsealCores ¶ added in v1.6.4
func AttemptUnsealCores(c *vault.TestCluster) error
func AwaitLeader ¶ added in v1.6.4
func AwaitLeader(t testing.T, cluster *vault.TestCluster) (int, error)
AwaitLeader waits for one of the cluster's nodes to become leader.
func DeriveActiveCore ¶ added in v0.11.2
func DeriveActiveCore(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
func DeriveStableActiveCore ¶ added in v1.6.4
func DeriveStableActiveCore(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
func DeriveStandbyCores ¶ added in v1.1.1
func DeriveStandbyCores(t testing.T, cluster *vault.TestCluster) []*vault.TestClusterCore
func EnsureCoreSealed ¶ added in v1.0.3
func EnsureCoreSealed(t testing.T, core *vault.TestClusterCore)
func EnsureCoreUnsealed ¶ added in v1.0.3
func EnsureCoreUnsealed(t testing.T, c *vault.TestCluster, core *vault.TestClusterCore)
func EnsureCoresSealed ¶ added in v1.0.3
func EnsureCoresSealed(t testing.T, c *vault.TestCluster)
func EnsureCoresUnsealed ¶ added in v0.11.2
func EnsureCoresUnsealed(t testing.T, c *vault.TestCluster)
func EnsureStableActiveNode ¶ added in v1.6.4
func EnsureStableActiveNode(t testing.T, cluster *vault.TestCluster)
func GenerateDebugLogs ¶ added in v1.6.4
func GenerateRoot ¶
func GenerateRoot(t testing.T, cluster *vault.TestCluster, kind GenerateRootKind) string
Generates a root token on the target cluster.
func GenerateRootWithError ¶
func GenerateRootWithError(t testing.T, cluster *vault.TestCluster, kind GenerateRootKind) (string, error)
func NewHardcodedServerAddressProvider ¶ added in v1.6.4
func NewHardcodedServerAddressProvider(numCores, baseClusterPort int) raftlib.ServerAddressProvider
NewHardcodedServerAddressProvider is a convenience function that makes a ServerAddressProvider from a given cluster address base port.
func RaftAppliedIndex ¶ added in v1.6.4
func RaftAppliedIndex(core *vault.TestClusterCore) uint64
func RaftClusterJoinNodes ¶ added in v1.6.4
func RaftClusterJoinNodes(t testing.T, cluster *vault.TestCluster)
func RandomWithPrefix ¶ added in v0.11.0
RandomWithPrefix is used to generate a unique name with a prefix, for randomizing names in acceptance tests
func RekeyCluster ¶ added in v1.6.4
func RekeyCluster(t testing.T, cluster *vault.TestCluster, recovery bool) [][]byte
func SealCores ¶ added in v1.6.4
func SealCores(t testing.T, cluster *vault.TestCluster)
func VerifyRaftConfiguration ¶ added in v1.6.4
func VerifyRaftConfiguration(core *vault.TestClusterCore, numCores int) error
VerifyRaftConfiguration checks that we have a valid raft configuration, i.e. the correct number of servers, having the correct NodeIDs, and exactly one leader.
func VerifyRaftPeers ¶ added in v1.6.4
func WaitForActiveNode ¶ added in v1.1.0
func WaitForActiveNode(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore
func WaitForActiveNodeAndStandbys ¶ added in v1.6.4
func WaitForActiveNodeAndStandbys(t testing.T, cluster *vault.TestCluster)
WaitForActiveNodeAndStandbys does nothing more than wait for the active node on OSS. On enterprise it waits for perf standbys to be healthy too.
func WaitForNCoresSealed ¶ added in v0.11.2
func WaitForNCoresSealed(t testing.T, cluster *vault.TestCluster, n int)
func WaitForNCoresUnsealed ¶ added in v1.6.4
func WaitForNCoresUnsealed(t testing.T, cluster *vault.TestCluster, n int)
func WaitForRaftApply ¶ added in v1.6.4
func WaitForRaftApply(t testing.T, core *vault.TestClusterCore, index uint64)
func WaitForStandbyNode ¶ added in v1.6.4
func WaitForStandbyNode(t testing.T, core *vault.TestClusterCore)
Types ¶
type GenerateRootKind ¶ added in v1.6.4
type GenerateRootKind int
const ( GenerateRootRegular GenerateRootKind = iota GenerateRootDR GenerateRecovery )
type HardcodedServerAddressProvider ¶ added in v1.6.4
type HardcodedServerAddressProvider struct {
Entries map[raftlib.ServerID]raftlib.ServerAddress
}
HardcodedServerAddressProvider is a ServerAddressProvider that uses a hardcoded map of raft node addresses.
It is useful in cases where the raft configuration is known ahead of time, but some of the cores have not yet had startClusterListener() called (via either unsealing or raft joining), and thus do not yet have a ClusterAddr() assigned.
func (*HardcodedServerAddressProvider) ServerAddr ¶ added in v1.6.4
func (p *HardcodedServerAddressProvider) ServerAddr(id raftlib.ServerID) (raftlib.ServerAddress, error)
type TestRaftServerAddressProvider ¶ added in v1.6.4
type TestRaftServerAddressProvider struct {
Cluster *vault.TestCluster
}
TestRaftServerAddressProvider is a ServerAddressProvider that uses the ClusterAddr() of each node to provide raft addresses.
Note that TestRaftServerAddressProvider should only be used in cases where cores that are part of a raft configuration have already had startClusterListener() called (via either unsealing or raft joining).
func (*TestRaftServerAddressProvider) ServerAddr ¶ added in v1.6.4
func (p *TestRaftServerAddressProvider) ServerAddr(id raftlib.ServerID) (raftlib.ServerAddress, error)