utils

package
v0.0.0-...-c65a67c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXAMPLES_DIR = "/src/github.com/contiv/netplugin/examples/"
)

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(t *testing.T, jsonCfg string, node TestbedNode)

func ApplyDesiredConfig

func ApplyDesiredConfig(t *testing.T, jsonCfg string, node TestbedNode)

func ApplyHostBindingsConfig

func ApplyHostBindingsConfig(t *testing.T, jsonCfg string, node TestbedNode)

func ConfigCleanupCommon

func ConfigCleanupCommon(t *testing.T, nodes []TestbedNode)

func ConfigSetupCommon

func ConfigSetupCommon(t *testing.T, jsonCfg string, nodes []TestbedNode)

func DelConfig

func DelConfig(t *testing.T, jsonCfg string, node TestbedNode)

func DockerCleanup

func DockerCleanup(t *testing.T, node TestbedNode, contName string)

func DockerCleanupWithEnv

func DockerCleanupWithEnv(t *testing.T, node TestbedNode, contName string, env []string)

func DumpNetpluginLogs

func DumpNetpluginLogs(node TestbedNode)

func FixUpContainerUUIDs

func FixUpContainerUUIDs(t *testing.T, nodes []TestbedNode, jsonCfg string) (string, error)

func FixUpInfraContainerUUIDs

func FixUpInfraContainerUUIDs(t *testing.T, nodes []TestbedNode, jsonCfg, infraContCfg string) (string, error)

func GetCfgFile

func GetCfgFile(fileName string) string

func GetIpAddress

func GetIpAddress(t *testing.T, node TestbedNode, ep string) string

func GetIpAddressFromNetworkAndContainerName

func GetIpAddressFromNetworkAndContainerName(t *testing.T, node TestbedNode,
	netId, contName string) string

XXX: used for powerstrip/docker integration testing where ep-name is derived by concatanating net-id to container-id

func NetworkStateExists

func NetworkStateExists(node TestbedNode, network string) error

func OkToCleanup

func OkToCleanup(testFailed bool) bool

func OvsDumpInfo

func OvsDumpInfo(node TestbedNode)

func StartClient

func StartClient(t *testing.T, node TestbedNode, contName, ipAddress string)

func StartClientFailure

func StartClientFailure(t *testing.T, node TestbedNode, contName, ipAddress string)

func StartClientFailureWithEnvAndArgs

func StartClientFailureWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string,
	env, dockerArgs []string)

func StartClientWithEnvAndArgs

func StartClientWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string,
	env, dockerArgs []string)

func StartNetPlugin

func StartNetPlugin(t *testing.T, nodes []TestbedNode, nativeInteg bool)

func StartPowerStripAdapter

func StartPowerStripAdapter(t *testing.T, nodes []TestbedNode)

func StartServer

func StartServer(t *testing.T, node TestbedNode, contName string)

func StartServerWithEnvAndArgs

func StartServerWithEnvAndArgs(t *testing.T, node TestbedNode, contName string,
	env, dockerArgs []string)

func StopOnError

func StopOnError(testFailed bool)

Types

type Dind

type Dind struct {
	// contains filtered or unexported fields
}

func (*Dind) GetNodes

func (v *Dind) GetNodes() []TestbedNode

func (*Dind) Setup

func (v *Dind) Setup(env string, numNodes int) error

func (*Dind) Teardown

func (v *Dind) Teardown()

type DindNode

type DindNode struct {
	Name    string
	NodeNum int
}

func (DindNode) GetName

func (n DindNode) GetName() string

func (DindNode) RunCommand

func (n DindNode) RunCommand(cmd string) error

func (DindNode) RunCommandBackground

func (n DindNode) RunCommandBackground(cmd string) (string, error)

func (DindNode) RunCommandWithOutput

func (n DindNode) RunCommandWithOutput(cmd string) (string, error)

type TempFileCtx

type TempFileCtx struct {
	// contains filtered or unexported fields
}

func (*TempFileCtx) AddFile

func (ctx *TempFileCtx) AddFile(fileContents string) (*os.File, error)

func (*TempFileCtx) Create

func (ctx *TempFileCtx) Create(fileContents string) (*os.File, error)

func (*TempFileCtx) Destroy

func (ctx *TempFileCtx) Destroy()

type TestCommand

type TestCommand struct {
	ContivNodes int
	ContivEnv   string
}

func (*TestCommand) Run

func (c *TestCommand) Run(cmd string, args ...string) error

func (*TestCommand) RunWithOutput

func (c *TestCommand) RunWithOutput(cmd string, args ...string) ([]byte, error)

type Testbed

type Testbed interface {
	Setup(env string, numNodes int) error
	Teardown()
	GetNodes() []TestbedNode
}

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
}

type Vagrant

type Vagrant struct {
	// contains filtered or unexported fields
}

func (*Vagrant) GetNodes

func (v *Vagrant) GetNodes() []TestbedNode

func (*Vagrant) Setup

func (v *Vagrant) Setup(env string, numNodes int) error

func (*Vagrant) Teardown

func (v *Vagrant) Teardown()

type VagrantCommand

type VagrantCommand struct {
	ContivNodes int
	ContivEnv   string
}

func (*VagrantCommand) Run

func (c *VagrantCommand) Run(cmd string, args ...string) error

func (*VagrantCommand) RunWithOutput

func (c *VagrantCommand) RunWithOutput(cmd string, args ...string) ([]byte, error)

type VagrantNode

type VagrantNode struct {
	Name    string
	NodeNum int
}

func (VagrantNode) GetName

func (n VagrantNode) GetName() string

func (VagrantNode) RunCommand

func (n VagrantNode) RunCommand(cmd string) error

func (VagrantNode) RunCommandBackground

func (n VagrantNode) RunCommandBackground(cmd string) (string, error)

func (VagrantNode) RunCommandWithOutput

func (n VagrantNode) RunCommandWithOutput(cmd string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL