Documentation ¶
Index ¶
- func AddConfig(t *testing.T, jsonCfg string, node TestbedNode)
- func AddConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
- func ApplyDesiredConfig(t *testing.T, jsonCfg string, node TestbedNode)
- func ApplyDesiredConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
- func ApplyHostBindingsConfig(t *testing.T, jsonCfg string, node TestbedNode)
- func ConfigCleanupCommon(t *testing.T, nodes []TestbedNode)
- func ConfigSetupCommon(t *testing.T, jsonCfg string, nodes []TestbedNode)
- func ConfigSetupCommonWithConsul(t *testing.T, jsonCfg string, nodes []TestbedNode)
- func DelConfig(t *testing.T, jsonCfg string, node TestbedNode)
- func DelConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
- func DockerCleanup(t *testing.T, node TestbedNode, contName string)
- func DockerCleanupWithEnv(t *testing.T, node TestbedNode, contName string, env []string)
- func DumpNetpluginLogs(node TestbedNode)
- func FixUpContainerUUIDs(t *testing.T, nodes []TestbedNode, jsonCfg string) (string, error)
- func FixUpInfraContainerUUIDs(t *testing.T, nodes []TestbedNode, jsonCfg, infraContCfg string) (string, error)
- func GetCfgFile(fileName string) string
- func GetIPAddress(t *testing.T, node TestbedNode, ep, stateStore string) string
- func GetNetpluginConfigWithConsul() string
- func NetworkStateExists(node TestbedNode, network, stateStore string) error
- func OkToCleanup(testFailed bool) bool
- func OvsDumpInfo(node TestbedNode)
- func StartClient(t *testing.T, node TestbedNode, contName, ipAddress string)
- func StartClientFailure(t *testing.T, node TestbedNode, contName, ipAddress string)
- func StartClientFailureWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string, ...)
- func StartClientWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string, ...)
- func StartNetPlugin(t *testing.T, nodes []TestbedNode, nativeInteg bool)
- func StartNetPluginWithConfig(t *testing.T, nodes []TestbedNode, nativeInteg bool, configStr string)
- func StartNetmaster(t *testing.T, node TestbedNode)
- func StartNetmasterWithFlags(t *testing.T, node TestbedNode, flags map[string]string)
- func StartServer(t *testing.T, node TestbedNode, contName string)
- func StartServerWithEnvAndArgs(t *testing.T, node TestbedNode, contName string, env, dockerArgs []string)
- func StopNetPlugin(t *testing.T, nodes []TestbedNode)
- func StopNetmaster(t *testing.T, node TestbedNode)
- func StopOnError(testFailed bool)
- type Dind
- type DindNode
- type TempFileCtx
- type TestCommand
- type Testbed
- type TestbedNode
- type Vagrant
- type VagrantCommand
- type VagrantNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConfig ¶
func AddConfig(t *testing.T, jsonCfg string, node TestbedNode)
AddConfig issues netdcli with -add-cfg flag
func AddConfigConsul ¶
func AddConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
AddConfigConsul issues netdcli with -add-cfg flag and uses consul state-store
func ApplyDesiredConfig ¶
func ApplyDesiredConfig(t *testing.T, jsonCfg string, node TestbedNode)
ApplyDesiredConfig issues netdcli with -cfg flag
func ApplyDesiredConfigConsul ¶
func ApplyDesiredConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
ApplyDesiredConfigConsul issues netdcli with -cfg flag and uses consul state-store
func ApplyHostBindingsConfig ¶
func ApplyHostBindingsConfig(t *testing.T, jsonCfg string, node TestbedNode)
ApplyHostBindingsConfig issues netdcli with -host-bindings-cfg flag
func ConfigCleanupCommon ¶
func ConfigCleanupCommon(t *testing.T, nodes []TestbedNode)
ConfigCleanupCommon performs common cleanup after each test
func ConfigSetupCommon ¶
func ConfigSetupCommon(t *testing.T, jsonCfg string, nodes []TestbedNode)
ConfigSetupCommon performs common configuration setup on specified testbed nodes
func ConfigSetupCommonWithConsul ¶
func ConfigSetupCommonWithConsul(t *testing.T, jsonCfg string, nodes []TestbedNode)
ConfigSetupCommonWithConsul performs common configuration setup on specified testbed nodes
func DelConfig ¶
func DelConfig(t *testing.T, jsonCfg string, node TestbedNode)
DelConfig issues netdcli with -del-cfg flag
func DelConfigConsul ¶
func DelConfigConsul(t *testing.T, jsonCfg string, node TestbedNode)
DelConfigConsul issues netdcli with -del-cfg flag and uses consul state-store
func DockerCleanup ¶
func DockerCleanup(t *testing.T, node TestbedNode, contName string)
DockerCleanup kills and removes a container on a specified testbed node
func DockerCleanupWithEnv ¶
func DockerCleanupWithEnv(t *testing.T, node TestbedNode, contName string, env []string)
DockerCleanupWithEnv kills and removes a container on a specified testbed node and with specified env-variables
func DumpNetpluginLogs ¶
func DumpNetpluginLogs(node TestbedNode)
DumpNetpluginLogs prints netplugin logs from the specified testbed node
func FixUpContainerUUIDs ¶
FixUpContainerUUIDs fills up UUID information in passed jsonCfg and returns host-binding configuration
func FixUpInfraContainerUUIDs ¶
func FixUpInfraContainerUUIDs(t *testing.T, nodes []TestbedNode, jsonCfg, infraContCfg string) (string, error)
FixUpInfraContainerUUIDs fills up UUID information in passed jsonCfg and returns host-binding configuration
func GetCfgFile ¶
GetCfgFile returns the path string for specified file name in examples directory
func GetIPAddress ¶
func GetIPAddress(t *testing.T, node TestbedNode, ep, stateStore string) string
GetIPAddress returns IP-address information for specified endpoint
func GetNetpluginConfigWithConsul ¶
func GetNetpluginConfigWithConsul() string
GetNetpluginConfigWithConsul returns netplugin config that uses consul state store
func NetworkStateExists ¶
func NetworkStateExists(node TestbedNode, network, stateStore string) error
NetworkStateExists tests if state for specified network exists
func OkToCleanup ¶
OkToCleanup tests if a testbed cleanup should be performed.
func OvsDumpInfo ¶
func OvsDumpInfo(node TestbedNode)
OvsDumpInfo dumps the ovs state on the specified testbed node
func StartClient ¶
func StartClient(t *testing.T, node TestbedNode, contName, ipAddress string)
StartClient starts a client container. It expects ping to server container to succeed
func StartClientFailure ¶
func StartClientFailure(t *testing.T, node TestbedNode, contName, ipAddress string)
StartClientFailure starts a client container. It expects ping to server container to fail
func StartClientFailureWithEnvAndArgs ¶
func StartClientFailureWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string, env, dockerArgs []string)
StartClientFailureWithEnvAndArgs starts a client container with specified env-variables. It expects ping to server container to failure
func StartClientWithEnvAndArgs ¶
func StartClientWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string, env, dockerArgs []string)
StartClientWithEnvAndArgs starts a client container with specified env-variables. It expects ping to server container to succeed
func StartNetPlugin ¶
func StartNetPlugin(t *testing.T, nodes []TestbedNode, nativeInteg bool)
StartNetPlugin starts netplugin on specified testbed nodes
func StartNetPluginWithConfig ¶
func StartNetPluginWithConfig(t *testing.T, nodes []TestbedNode, nativeInteg bool, configStr string)
StartNetPluginWithConfig starts netplugin on specified testbed nodes with specified config
func StartNetmaster ¶
func StartNetmaster(t *testing.T, node TestbedNode)
StartNetmaster starts netplugin on specified testbed node
func StartNetmasterWithFlags ¶
func StartNetmasterWithFlags(t *testing.T, node TestbedNode, flags map[string]string)
StartNetmasterWithFlags starts netplugin on specified testbed nodes with specified flags
func StartServer ¶
func StartServer(t *testing.T, node TestbedNode, contName string)
StartServer starts a server container
func StartServerWithEnvAndArgs ¶
func StartServerWithEnvAndArgs(t *testing.T, node TestbedNode, contName string, env, dockerArgs []string)
StartServerWithEnvAndArgs starts a server container with specified env-variables
func StopNetPlugin ¶
func StopNetPlugin(t *testing.T, nodes []TestbedNode)
StopNetPlugin stops the netplugin on specified testbed nodes
func StopNetmaster ¶
func StopNetmaster(t *testing.T, node TestbedNode)
StopNetmaster stops the netmaster on specified testbed node
func StopOnError ¶
func StopOnError(testFailed bool)
StopOnError stops the test and panics if CONTIV_SOE env-variable is set and test has failed
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 TempFileCtx ¶
type TempFileCtx struct {
// contains filtered or unexported fields
}
TempFileCtx allows managing temporary file contexts
func (*TempFileCtx) AddFile ¶
func (ctx *TempFileCtx) AddFile(fileContents string) (*os.File, error)
AddFile adds a file to the context with specified file-contents
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(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) GetNodes ¶
func (v *Vagrant) GetNodes() []TestbedNode
GetNodes returns the nodes in a vagrant setup
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