Documentation ¶
Index ¶
- func ClearEtcd(node TestbedNode)
- func StartEtcd(nodes []TestbedNode) error
- func StopEtcd(nodes []TestbedNode) error
- type Dind
- type DindNode
- type TestCommand
- type Testbed
- type TestbedNode
- type Vagrant
- func (v *Vagrant) GetNode(name string) TestbedNode
- func (v *Vagrant) GetNodes() []TestbedNode
- func (v *Vagrant) IterateNodes(fn func(TestbedNode) error) error
- func (v *Vagrant) SSHAllNodes(cmd string) error
- func (v *Vagrant) Setup(start bool, env string, numNodes int) error
- func (v *Vagrant) Teardown()
- type VagrantCommand
- type VagrantNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearEtcd ¶
func ClearEtcd(node TestbedNode)
func StartEtcd ¶
func StartEtcd(nodes []TestbedNode) error
StartEtcd starts etcd on a specific host.
Types ¶
type Dind ¶
type Dind struct {
// contains filtered or unexported fields
}
Dind implements docker-in-docker(dind) based testbed
func (*Dind) GetNodes ¶
func (v *Dind) GetNodes() []TestbedNode
GetNodes returns the nodes in a dind setup
type DindNode ¶
DindNode implements a node in docker-in-docker (dind) testbed
func (DindNode) RunCommand ¶
RunCommand runs a shell command in a dind node and returns it's exit status
func (DindNode) RunCommandBackground ¶
RunCommandBackground runs a background command in a dind node
type TestCommand ¶
TestCommand is a command that is run on a test node
func (*TestCommand) Run ¶
func (c *TestCommand) Run(cmd string, args ...string) error
Run runs a command and return it's exit status
func (*TestCommand) RunWithOutput ¶
func (c *TestCommand) RunWithOutput(cmd string, args ...string) ([]byte, error)
RunWithOutput runs a command and return it's exit status and output
type Testbed ¶
type Testbed interface { Setup(start bool, env string, numNodes int) error Teardown() GetNodes() []TestbedNode }
Testbed is a collection of test nodes
type TestbedNode ¶
type TestbedNode interface { RunCommand(cmd string) (err error) RunCommandWithOutput(cmd string) (output string, err error) RunCommandBackground(cmd string) (output string, err error) GetName() string }
TestbedNode is a node under test
type Vagrant ¶
type Vagrant struct {
// contains filtered or unexported fields
}
Vagrant implements a vagrant based testbed
func (*Vagrant) GetNode ¶
func (v *Vagrant) GetNode(name string) TestbedNode
GetNode obtains a node by name.
func (*Vagrant) GetNodes ¶
func (v *Vagrant) GetNodes() []TestbedNode
GetNodes returns the nodes in a vagrant setup
func (*Vagrant) IterateNodes ¶
func (v *Vagrant) IterateNodes(fn func(TestbedNode) error) error
IterateNodes walks each host and executes the function supplied. On error, it waits for all hosts to complete before returning the error.
func (*Vagrant) SSHAllNodes ¶
SSHAllNodes will ssh into each host and run the specified command.
type VagrantCommand ¶
VagrantCommand is a command that is run on a vagrant node
func (*VagrantCommand) Run ¶
func (c *VagrantCommand) Run(cmd string, args ...string) error
Run runs a command and return it's exit status
func (*VagrantCommand) RunWithOutput ¶
func (c *VagrantCommand) RunWithOutput(cmd string, args ...string) ([]byte, error)
RunWithOutput runs a command and return it's exit status and output
type VagrantNode ¶
type VagrantNode struct { Name string // contains filtered or unexported fields }
VagrantNode implements a node in vagrant testbed
func NewVagrantNode ¶
func NewVagrantNode(name, port, privKeyFile string) (*VagrantNode, error)
NewVagrantNode intializes a node in vagrant testbed
func (*VagrantNode) Cleanup ¶
func (n *VagrantNode) Cleanup()
Cleanup clears the ssh client resources
func (*VagrantNode) GetName ¶
func (n *VagrantNode) GetName() string
GetName returns vagrant node's name
func (*VagrantNode) RunCommand ¶
func (n *VagrantNode) RunCommand(cmd string) error
RunCommand runs a shell command in a vagrant node and returns it's exit status
func (*VagrantNode) RunCommandBackground ¶
func (n *VagrantNode) RunCommandBackground(cmd string) (string, error)
RunCommandBackground runs a background command in a vagrant node
func (*VagrantNode) RunCommandWithOutput ¶
func (n *VagrantNode) RunCommandWithOutput(cmd string) (string, error)
RunCommandWithOutput runs a shell command in a vagrant node and returns it's exit status and output