Documentation ¶
Index ¶
- Variables
- type DockerCluster
- func (dc *DockerCluster) Client() (*api.Client, error)
- func (dc *DockerCluster) Initialize(ctx context.Context) error
- func (dc *DockerCluster) MountPath() string
- func (dc *DockerCluster) Name() string
- func (dc *DockerCluster) RootToken() string
- func (dc *DockerCluster) Setup() error
- func (dc *DockerCluster) Teardown() error
- type DockerClusterOptions
- type Runner
Constants ¶
This section is empty.
Variables ¶
var DefaultNumCores = 1
TODO: allow number of cores/servers to be configurable
Functions ¶
This section is empty.
Types ¶
type DockerCluster ¶
type DockerCluster 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 }
DockerCluster is used to managing the lifecycle of the test Vault cluster
func NewEnvironment ¶
func NewEnvironment(name string, options *stepwise.MountOptions) *DockerCluster
NewEnvironment creats a new Stepwise Environment for executing tests
func (*DockerCluster) Client ¶
func (dc *DockerCluster) Client() (*api.Client, error)
Client returns a clone of the configured Vault API client.
func (*DockerCluster) Initialize ¶
func (dc *DockerCluster) Initialize(ctx context.Context) error
func (*DockerCluster) MountPath ¶
func (dc *DockerCluster) MountPath() string
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 (*DockerCluster) Name ¶
func (dc *DockerCluster) Name() string
Name returns the name of this environment
func (*DockerCluster) RootToken ¶
func (dc *DockerCluster) RootToken() string
RootToken returns the root token of the cluster, if set
func (*DockerCluster) Setup ¶
func (dc *DockerCluster) Setup() error
Setup creates any temp directories needed and compiles the binary for copying to Docker
func (*DockerCluster) Teardown ¶
func (dc *DockerCluster) Teardown() error
Teardown stops all the containers.
type DockerClusterOptions ¶
type DockerClusterOptions 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 *DockerCluster) CAKey *ecdsa.PrivateKey // contains filtered or unexported fields }
DockerClusterOptions 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 // contains filtered or unexported fields }
Runner manages the lifecycle of the Docker container