testing

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testing provides tools and input data for unit testing of ifplugin. What remains to be defined are scenarios.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Memif100011Master is an example of a memory interface configuration. (Master=true)
	Memif100011Master = interfaces.Interfaces_Interface{
		Name:    "memif1",
		Type:    interfaces.InterfaceType_MEMORY_INTERFACE,
		Enabled: true,
		Memif: &interfaces.Interfaces_Interface_Memif{
			Master:         true,
			SocketFilename: "/tmp/memif1.sock",
		},
		Mtu:         1500,
		IpAddresses: []string{"10.0.0.11/24"},
	}

	// Memif100011Slave is an example of a memory interface configuration. Intentionaly similar to Memif100011.
	// Here is only one different Master=false.
	Memif100011Slave = interfaces.Interfaces_Interface{
		Name:    "memif1",
		Type:    interfaces.InterfaceType_MEMORY_INTERFACE,
		Enabled: true,
		Memif: &interfaces.Interfaces_Interface_Memif{
			Master:         false,
			SocketFilename: "/tmp/memif1.sock",
		},
		Mtu:         1500,
		IpAddresses: []string{"10.0.0.11/24"},
	}

	// Memif100012 is an example of a memory interface configuration.
	Memif100012 = interfaces.Interfaces_Interface{
		Name:    "memif100012",
		Type:    interfaces.InterfaceType_MEMORY_INTERFACE,
		Enabled: true,
		Memif: &interfaces.Interfaces_Interface_Memif{
			Master:         true,
			SocketFilename: "/tmp/memif1.sock",
		},
		Mtu:         1500,
		IpAddresses: []string{"10.0.0.12/24"},
	}

	// Memif100013 is an example of a memory interface configuration.
	Memif100013 = interfaces.Interfaces_Interface{
		Name:    "memif100013",
		Type:    interfaces.InterfaceType_MEMORY_INTERFACE,
		Enabled: true,
		Memif: &interfaces.Interfaces_Interface_Memif{
			Master:         true,
			SocketFilename: "/tmp/memif1.sock",
		},
		Mtu:         1500,
		IpAddresses: []string{"10.0.0.13/24"},
	}

	// VxlanVni5 is an example of a memory interface configuration.
	VxlanVni5 = interfaces.Interfaces_Interface{
		Name:    "VxlanVni5",
		Type:    interfaces.InterfaceType_VXLAN_TUNNEL,
		Enabled: true,
		Vxlan: &interfaces.Interfaces_Interface_Vxlan{
			SrcAddress: "192.168.1.1",
			DstAddress: "192.168.1.2",
			Vni:        5,
		},
	}

	// AfPacketVeth1 is an example of a memory interface configuration.
	AfPacketVeth1 = interfaces.Interfaces_Interface{
		Name:    "AfPacketVeth1",
		Type:    interfaces.InterfaceType_AF_PACKET_INTERFACE,
		Enabled: true,
		Afpacket: &interfaces.Interfaces_Interface_Afpacket{
			HostIfName: "veth1",
		},
	}

	// BDMemif100011ToMemif100012 is an example of a bridge domain configuration.
	BDMemif100011ToMemif100012 = l2.BridgeDomains_BridgeDomain{
		Name:                "aaa",
		Flood:               false,
		UnknownUnicastFlood: false,
		Forward:             true,
		Learn:               true,
		ArpTermination:      false,
		MacAge:              0,
	}
)

Functions

func BfdAuthKeyBuilder

func BfdAuthKeyBuilder(id uint32, authType bfd.SingleHopBFD_Key_AuthenticationType, secret string) bfd.SingleHopBFD_Key

BfdAuthKeyBuilder creates BFD authentication key

func BfdAuthSessionBuilder

func BfdAuthSessionBuilder(iface string, srcAddr string, dstAddr string, desInt uint32, reqInt uint32, multiplier uint32) bfd.SingleHopBFD_Session

BfdAuthSessionBuilder creates BFD session including authentication

func BfdEchoFunctionBuilder

func BfdEchoFunctionBuilder(iface string) bfd.SingleHopBFD_EchoFunction

BfdEchoFunctionBuilder builds BFD echo source

func BfdSessionBuilder

func BfdSessionBuilder(iface string, srcAddr string, dstAddr string, desInt uint32, reqInt uint32, multiplier uint32) bfd.SingleHopBFD_Session

BfdSessionBuilder creates BFD session without authentication

func LoopbackBuilder

func LoopbackBuilder(ifname string, ipAddr string) *interfaces.Interfaces_Interface

LoopbackBuilder new instance for testing purposes

func MemifBuilder

func MemifBuilder(ifname string, ipAddr string, master bool, id uint32) *interfaces.Interfaces_Interface

MemifBuilder new instance for testing purposes

func TapInterfaceBuilder

func TapInterfaceBuilder(name string, ip string) interfaces.Interfaces_Interface

TapInterfaceBuilder serves to create test interface

Types

This section is empty.

Jump to

Keyboard shortcuts

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