e2eutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BGPImageName = "magicsong/gobgp"
)

Variables

This section is empty.

Functions

func CheckAgentLog added in v0.1.0

func CheckAgentLog(namespace, name, logfileName string, dynclient client.Client) (string, error)

func CheckManagerLog added in v0.1.0

func CheckManagerLog(namespace, name, logfileName string) (string, error)

func CleanEIPList added in v0.1.0

func CleanEIPList(dynclient client.Client) error

func Connect

func Connect(user, password, host, key string, port int, cipherList []string) (*ssh.Session, error)

func DeleteNamespace added in v0.1.1

func DeleteNamespace(c client.Client, ns string) error

func EnsureNamespaceClean added in v0.1.1

func EnsureNamespaceClean(nsname string) error

func GetContainerLog added in v0.1.1

func GetContainerLog(containerID string) (string, error)

func GetDefaultPrivateKeyFile

func GetDefaultPrivateKeyFile() string

func GetLogOfPod

func GetLogOfPod(rest *rest.RESTClient, namespace, name string, logOptions *corev1.PodLogOptions, out io.Writer) error

func GetServiceNodesIP

func GetServiceNodesIP(c client.Client, namespaceName types.NamespacedName) ([]string, error)

func KubectlApply added in v0.1.1

func KubectlApply(filename string) error

func KubectlDelete added in v0.1.1

func KubectlDelete(filename string) error

func QuickConnectAndRun added in v0.1.0

func QuickConnectAndRun(host, cmd string) ([]byte, error)

func QuickConnectUsingDefaultSSHKey added in v0.1.0

func QuickConnectUsingDefaultSSHKey(host string) (*ssh.Session, error)

func RunGoBGPContainer added in v0.1.1

func RunGoBGPContainer(configPath string) (string, error)

func ScpFileToRemote added in v0.1.1

func ScpFileToRemote(source, dst, host string) error

func StopGoBGPContainer added in v0.1.1

func StopGoBGPContainer(containerID string) error

func WaitForController

func WaitForController(c client.Client, namespace, name string, retryInterval, timeout time.Duration) error

func WaitForDeletion

func WaitForDeletion(dynclient client.Client, obj runtime.Object, retryInterval, timeout time.Duration) error

Types

type DeployFunc added in v0.1.1

type DeployFunc func() error

type LogInfo added in v0.1.0

type LogInfo struct {
	Level  string  `json:"level,omitempty"`
	TS     float64 `json:"ts,omitempty"`
	Logger string  `json:"logger,omitempty"`
	Msg    string  `json:"msg,omitempty"`
}

func ParseLog added in v0.1.0

func ParseLog(log string) *LogInfo

type TestCase added in v0.1.1

type TestCase struct {
	Name           string
	ControllerAS   int
	ControllerIP   string
	ControllerPort int
	ControllerName string

	RouterIP               string
	RouterAS               int
	UsePortForward         bool
	RouterConfigPath       string
	ControllerConfigPath   string
	IsPassiveMode          bool
	RouterTemplatePath     string
	ControllerTemplatePath string
	Namespace              string
	K8sClient              client.Client
	KustomizePath          string

	DeployYamlPath string

	TestDeploymentName string

	InjectTest TestFunc
	// contains filtered or unexported fields
}

func (*TestCase) CheckBGPRoute added in v0.1.1

func (t *TestCase) CheckBGPRoute() (string, error)

func (*TestCase) CheckNetwork added in v0.1.1

func (t *TestCase) CheckNetwork()

func (*TestCase) DeleteController added in v0.1.1

func (t *TestCase) DeleteController() error

func (*TestCase) DeleteServiceGracefully added in v0.1.1

func (t *TestCase) DeleteServiceGracefully(service *corev1.Service) error

func (*TestCase) DeployYaml added in v0.1.1

func (t *TestCase) DeployYaml() error

func (*TestCase) GenerateControllerConfig added in v0.1.1

func (t *TestCase) GenerateControllerConfig() (string, error)

func (*TestCase) GetRouterLog added in v0.1.1

func (t *TestCase) GetRouterLog() (string, error)

func (*TestCase) IsLocal added in v0.1.1

func (t *TestCase) IsLocal() bool

func (*TestCase) ReplaceConfigMap added in v0.1.1

func (t *TestCase) ReplaceConfigMap() error

func (*TestCase) SetRouterContainerID added in v0.1.1

func (t *TestCase) SetRouterContainerID(id string)

func (*TestCase) StartDefaultTest added in v0.1.1

func (t *TestCase) StartDefaultTest(workspace string)

Change configure of TestCase to test some behabiour

func (*TestCase) StartRemoteRoute added in v0.1.1

func (t *TestCase) StartRemoteRoute() error

func (*TestCase) StopRouter added in v0.1.1

func (t *TestCase) StopRouter() error

func (*TestCase) WaitForControllerUp added in v0.1.1

func (t *TestCase) WaitForControllerUp() error

func (*TestCase) WriteConfig added in v0.1.1

func (t *TestCase) WriteConfig(temppath, output string) error

type TestFunc added in v0.1.1

type TestFunc func()

Jump to

Keyboard shortcuts

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