test_utils

package
v1.11.8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const K8S_TEST_NS = "test"

Variables

This section is empty.

Functions

func CheckSysctlValue added in v1.8.0

func CheckSysctlValue(sysctlPath, value string) error

CheckSysctlValue is a utility function to assert sysctl value is set to what is expected.

func Cmd

func Cmd(cmd string) string

func CreateContainer

func CreateContainer(netconf string, k8sName string, ip string) (container_id string, session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, contRoutes []netlink.Route, targetNs ns.NetNS, err error)

func CreateContainerNamespace added in v1.6.1

func CreateContainerNamespace() (containerNs ns.NetNS, containerId string, err error)

func CreateContainerNamespaceWithCid added in v1.7.0

func CreateContainerNamespaceWithCid(container_id string) (containerNs ns.NetNS, containerId string, err error)

func CreateContainerWithId added in v1.7.0

func CreateContainerWithId(netconf string, k8sName string, ip string, containerId string) (container_id string, session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, contRoutes []netlink.Route, targetNs ns.NetNS, err error)

Create container with the giving containerId when containerId is not empty

func CreateHostVeth added in v1.7.0

func CreateHostVeth(containerId string, k8sName string, k8sNamespace string) error

Create veth pair on host

func DeleteContainer

func DeleteContainer(netconf, netnspath, name string) (exitCode int, err error)

Executes the Calico CNI plugin and return the error code of the command.

func DeleteContainerWithId added in v1.7.0

func DeleteContainerWithId(netconf, netnspath, name, containerId string) (exitCode int, err error)

func GetResultForCurrent added in v1.7.0

func GetResultForCurrent(session *gexec.Session, cniVersion string) (*current.Result, error)

GetResultForCurrent takes the session output with cniVersion and returns the Result in current.Result format.

func RunCNIPluginWithId added in v1.8.0

func RunCNIPluginWithId(netconf, k8sName, ip, containerId string, targetNs ns.NetNS) (session *gexec.Session, contVeth netlink.Link, contAddr []netlink.Addr, contRoutes []netlink.Route, err error)

RunCNIPluginWithId calls CNI plugin with a containerID and targetNs passed to it. This is for when you want to call CNI for an existing container.

func RunIPAMPlugin

func RunIPAMPlugin(netconf, command, args, cniVersion string) (*current.Result, types.Error, int)

RunIPAMPlugin sets ENV vars required then calls the IPAM plugin specified in the config and returns the result and exitCode.

func WipeEtcd added in v1.5.5

func WipeEtcd()

Delete everything under /calico from etcd

func WipeK8sPods added in v1.6.0

func WipeK8sPods()

Delete all K8s pods from the "test" namespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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