Documentation
¶
Index ¶
- Constants
- Variables
- type Cluster
- func (dc *Cluster) Client() (*api.Client, error)
- func (dc *Cluster) Initialize(ctx context.Context) error
- func (dc *Cluster) MountPath() string
- func (dc *Cluster) Name() string
- func (dc *Cluster) RootToken() string
- func (dc *Cluster) SetRegistryAuth(username, password, serverAddress string) error
- func (dc *Cluster) Setup() error
- func (dc *Cluster) Teardown() error
- type ClusterOptions
- type Runner
Constants ¶
const DockerHostEnvVar = "VAULT_TEST_DOCKER_HOST"
DockerHostEnvVar can be set to explicitly override the host used to reach ports published by the Vault containers (see apiHost). This is an escape hatch for network topologies apiHost can't infer on its own, e.g. a Docker daemon reached over a bind-mounted socket rather than DOCKER_HOST.
Variables ¶
var DefaultNumCores = 1
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
ID string
// PluginName is the input from the test case
PluginName string
// ClusterName is a UUID name of the cluster.
ClusterName string
// MountOptions are a set of options for registering and mounting the plugin
MountOptions stepwise.MountOptions
RaftStorage bool
ClusterNodes []*dockerClusterNode
// Certificate fields
CACert *x509.Certificate
CACertBytes []byte
CACertPEM []byte
CACertPEMFile string
CAKey *ecdsa.PrivateKey
CAKeyPEM []byte
RootCAs *x509.CertPool
// contains filtered or unexported fields
}
Cluster is used for managing the lifecycle of the test Vault cluster
func NewEnvironment ¶
func NewEnvironment(name string, options *stepwise.MountOptions, vaultImage string) *Cluster
NewEnvironment creates a new Stepwise Environment for executing tests
func (*Cluster) MountPath ¶
MountPath returns the path that the plugin under test is mounted at. If a MountPathPrefix was given, the mount path uses the prefix with a UUID appended. The default is the given PluginName with a UUID suffix.
func (*Cluster) SetRegistryAuth ¶ added in v0.10.0
SetRegistryAuth configures credentials for pulling the Vault image from a private registry. Must be called before Run.
type ClusterOptions ¶
type ClusterOptions struct {
KeepStandbysSealed bool
RequireClientAuth bool
SkipInit bool
CACert []byte
NumCores int
PluginTestBin string
// SetupFunc is called after the cluster is started.
SetupFunc func(t testing.T, c *Cluster)
CAKey *ecdsa.PrivateKey
// contains filtered or unexported fields
}
ClusterOptions has options for setting up the docker cluster
type Runner ¶
type Runner struct {
ContainerConfig *container.Config
ContainerName string
NetName string
IP string
CopyFromTo map[string]string
// RegistryAuth is the base64-encoded JSON credentials for a private image registry.
// Use Cluster.SetRegistryAuth to populate this field.
RegistryAuth string
// contains filtered or unexported fields
}
Runner manages the lifecycle of the Docker container