Documentation ¶
Index ¶
- Constants
- Variables
- func AddIPPoolForCalicoClient(client *calico.CalicoClientStub, poolName string, poolCIRD string) (*apiv3.IPPool, error)
- func AddPaddingTo32Bytes(value []byte) []byte
- func AssertInterfaceGSO(swIfIndex uint32, interfaceDescriptiveName string, vpp *vpplink.VppLink)
- func AssertInterfaceGSOCNat(swIfIndex uint32, interfaceDescriptiveName string, vpp *vpplink.VppLink)
- func AssertNextNodeLink(node, linkedNextNode string, vpp *vpplink.VppLink) int
- func AssertRPFRoutes(vpp *vpplink.VppLink, vrfID uint32, swifindex uint32, ipAddress string)
- func AssertRPFVRFExistence(vpp *vpplink.VppLink, interfaceName string, netnsName string) uint32
- func AssertTunInterfaceExistence(vpp *vpplink.VppLink, newPod *cniproto.AddRequest) uint32
- func AssertTunnelInterfaceIPAddress(vpp *vpplink.VppLink, ifSwIfIndex uint32, expectedIPAddress string)
- func AssertTunnelInterfaceMTU(vpp *vpplink.VppLink, ifSwIfIndex uint32)
- func AssertUnnumberedInterface(swIfIndex uint32, interfaceDescriptiveName string, vpp *vpplink.VppLink)
- func ConfigureBGPNodeIPAddresses(connectivityServer *connectivity.ConnectivityServer)
- func ConfigureVPP(log *logrus.Logger) (vpp *vpplink.VppLink, uplinkSwIfIndex uint32)
- func CreatePod()
- func DpoNetworkNameFieldName() string
- func FirstIPinIPRange(ipRangeCIDR string) net.IP
- func InterfaceTagForLocalMemifTunnel(interfaceName, netns string) string
- func InterfaceTagForLocalTunTunnel(interfaceName, netns string) string
- func InterfaceTagForLocalTunnel(prefix, interfaceName, netns string) string
- func IpFamilyIndex(ipFamily vpplink.IpFamily) int
- func IpNet(ipNetCIDRStr string) *net.IPNet
- func IpNetWithIPInIPv6Format(ipNetCIDRStr string) *net.IPNet
- func IptypesIP6Address(address string) ip_types.IP6Address
- func Mac(macStr string) net.HardwareAddr
- func PodVRFs(podInterface, podNetNSName string, vpp *vpplink.VppLink) (vrf4ID, vrf6ID uint32, err error)
- func RunInPod(podNetNS string, runner func())
- func SidArray(addresses ...ip_types.IP6Address) (sids [16]ip_types.IP6Address)
- func StartVPP()
- func TeardownPod()
- func TeardownVPP()
Constants ¶
const ( // PodMockContainerName is used container name for pod container mock PodMockContainerName = "cni-tests-pod-mock" // PodMockImage is docker image used for pod mocking PodMockImage = "calicovpp/vpp-test-pod-mock:latest" VPPContainerName = "cni-tests-vpp" VppContainerExtraArgsName = "VPP_CONTAINER_EXTRA_ARGS" ThisNodeName = "node1" UplinkIfName = "uplink" UplinkIP = "10.0.100.1" UplinkIPv6 = "A::1:1" GatewayIP = "10.0.100.254" GatewayIPv6 = "A::1:254" ThisNodeIP = UplinkIP ThisNodeIPv6 = UplinkIPv6 AddedNodeName = "node2" AddedNodeIP = "10.0.200.1" AddedNodeIPv6 = "A::2:1" )
Variables ¶
var ( // VppImage is the name of docker image containing VPP binary VppImage string // VppBinary is the full path to VPP binary inside docker image VppBinary string // vppContainerExtraArgs is a list of additionnal cli parameters for the VPP `docker run ...` VppContainerExtraArgs []string = []string{} )
Functions ¶
func AddIPPoolForCalicoClient ¶
func AddIPPoolForCalicoClient(client *calico.CalicoClientStub, poolName string, poolCIRD string) ( *apiv3.IPPool, error)
AddIPPoolForCalicoClient is convenience function for adding IPPool to mocked Calico IPAM Stub used in Calico client stub. This function doesn't set anything for the watchers.IpamCache implementation.
func AddPaddingTo32Bytes ¶
func AssertInterfaceGSO ¶
assertInterfaceGSOCNat check whether the given interface has properly set the GSO and CNAT attributes
func AssertInterfaceGSOCNat ¶
func AssertInterfaceGSOCNat(swIfIndex uint32, interfaceDescriptiveName string, vpp *vpplink.VppLink)
AssertInterfaceGSOCNat check whether the given interface has properly set the GSO and CNAT attributes
func AssertNextNodeLink ¶
AssertNextNodeLink asserts that in VPP graph the given node has linked the linkedNextNode as one of its "next" nodes for processing. It returns to node specific index of the checked next node.
func AssertRPFRoutes ¶
AssertRPFRoutes checks that a route to the pod is added in the RPFVRF and to addresses allowed to be spoofed
func AssertRPFVRFExistence ¶
AssertRPFVRFExistence checks that dedicated VRF for RPF is created for interface in VPP
func AssertTunInterfaceExistence ¶
func AssertTunInterfaceExistence(vpp *vpplink.VppLink, newPod *cniproto.AddRequest) uint32
func AssertUnnumberedInterface ¶
func AssertUnnumberedInterface(swIfIndex uint32, interfaceDescriptiveName string, vpp *vpplink.VppLink)
AssertUnnumberedInterface checks whether the provided interface is unnumbered and properly takes IP address from the correct interface (common.VppManagerInfo.GetMainSwIfIndex()).
func ConfigureBGPNodeIPAddresses ¶
func ConfigureBGPNodeIPAddresses(connectivityServer *connectivity.ConnectivityServer)
func ConfigureVPP ¶
ConfigureVPP connects to VPP and configures it with common configuration needed for tests
func CreatePod ¶
func CreatePod()
CreatePod creates docker container that will be used as pod for CNI testing
func DpoNetworkNameFieldName ¶
func DpoNetworkNameFieldName() string
DpoNetworkNameFieldName extracts JSON field name for NetworkName used in proto.AddRequest.DataplaneOptions
func FirstIPinIPRange ¶
FirstIPinIPRange computes first usable IPv4 address from the given subnet. The subnet definition IP address (ending with zero bits) is not considered as usable IPv4 address as it can have special meaning in certain situations.
func InterfaceTagForLocalMemifTunnel ¶
InterfaceTagForLocalMemifTunnel constructs the tag for the VPP side of the memif tunnel the same way as cni server
func InterfaceTagForLocalTunTunnel ¶
InterfaceTagForLocalTunTunnel constructs the tag for the VPP side of the tap tunnel the same way as cni server
func InterfaceTagForLocalTunnel ¶
InterfaceTagForLocalTunnel constructs the tag for the VPP side of the local tunnel the same way as cni server
func IpFamilyIndex ¶
func IpNetWithIPInIPv6Format ¶
func IptypesIP6Address ¶
func IptypesIP6Address(address string) ip_types.IP6Address
func Mac ¶
func Mac(macStr string) net.HardwareAddr
func PodVRFs ¶
func PodVRFs(podInterface, podNetNSName string, vpp *vpplink.VppLink) (vrf4ID, vrf6ID uint32, err error)
PodVRFs gets ids of IPv4 and IPv6 pod-specific VRFs from VPP
func RunInPod ¶
func RunInPod(podNetNS string, runner func())
RunInPod runs runner function in provided pod network namespace. This is the same as running networking commands inside pod.
func SidArray ¶
func SidArray(addresses ...ip_types.IP6Address) (sids [16]ip_types.IP6Address)
func TeardownVPP ¶
func TeardownVPP()
TeardownVPP removes container with running VPP to stop VPP and clean after it
Types ¶
This section is empty.