{"modulePath":"github.com/emnify/vpp-agent","version":"v1.0.4","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\nPackage testing provides tools and input data for unit testing of ifplugin. What remains to be defined are scenarios.\n\n## Variables\n\n```go\nvar (\n\t// Memif100011Master is an example of a memory interface configuration. (Master=true)\n\tMemif100011Master = interfaces.Interfaces_Interface{\n\t\tName:    \"memif1\",\n\t\tType:    interfaces.InterfaceType_MEMORY_INTERFACE,\n\t\tEnabled: true,\n\t\tMemif: \u0026interfaces.Interfaces_Interface_Memif{\n\t\t\tMaster:         true,\n\t\t\tSocketFilename: \"/tmp/memif1.sock\",\n\t\t},\n\t\tMtu:         1500,\n\t\tIpAddresses: []string{\"10.0.0.11/24\"},\n\t}\n\n\t// Memif100011Slave is an example of a memory interface configuration. Intentionaly similar to Memif100011.\n\t// Here is only one different Master=false.\n\tMemif100011Slave = interfaces.Interfaces_Interface{\n\t\tName:    \"memif1\",\n\t\tType:    interfaces.InterfaceType_MEMORY_INTERFACE,\n\t\tEnabled: true,\n\t\tMemif: \u0026interfaces.Interfaces_Interface_Memif{\n\t\t\tMaster:         false,\n\t\t\tSocketFilename: \"/tmp/memif1.sock\",\n\t\t},\n\t\tMtu:         1500,\n\t\tIpAddresses: []string{\"10.0.0.11/24\"},\n\t}\n\n\t// Memif100012 is an example of a memory interface configuration.\n\tMemif100012 = interfaces.Interfaces_Interface{\n\t\tName:    \"memif100012\",\n\t\tType:    interfaces.InterfaceType_MEMORY_INTERFACE,\n\t\tEnabled: true,\n\t\tMemif: \u0026interfaces.Interfaces_Interface_Memif{\n\t\t\tMaster:         true,\n\t\t\tSocketFilename: \"/tmp/memif1.sock\",\n\t\t},\n\t\tMtu:         1500,\n\t\tIpAddresses: []string{\"10.0.0.12/24\"},\n\t}\n\n\t// Memif100013 is an example of a memory interface configuration.\n\tMemif100013 = interfaces.Interfaces_Interface{\n\t\tName:    \"memif100013\",\n\t\tType:    interfaces.InterfaceType_MEMORY_INTERFACE,\n\t\tEnabled: true,\n\t\tMemif: \u0026interfaces.Interfaces_Interface_Memif{\n\t\t\tMaster:         true,\n\t\t\tSocketFilename: \"/tmp/memif1.sock\",\n\t\t},\n\t\tMtu:         1500,\n\t\tIpAddresses: []string{\"10.0.0.13/24\"},\n\t}\n\n\t// VxlanVni5 is an example of a memory interface configuration.\n\tVxlanVni5 = interfaces.Interfaces_Interface{\n\t\tName:    \"VxlanVni5\",\n\t\tType:    interfaces.InterfaceType_VXLAN_TUNNEL,\n\t\tEnabled: true,\n\t\tVxlan: \u0026interfaces.Interfaces_Interface_Vxlan{\n\t\t\tSrcAddress: \"192.168.1.1\",\n\t\t\tDstAddress: \"192.168.1.2\",\n\t\t\tVni:        5,\n\t\t},\n\t}\n\n\t// AfPacketVeth1 is an example of a memory interface configuration.\n\tAfPacketVeth1 = interfaces.Interfaces_Interface{\n\t\tName:    \"AfPacketVeth1\",\n\t\tType:    interfaces.InterfaceType_AF_PACKET_INTERFACE,\n\t\tEnabled: true,\n\t\tAfpacket: \u0026interfaces.Interfaces_Interface_Afpacket{\n\t\t\tHostIfName: \"veth1\",\n\t\t},\n\t}\n\n\t// BDMemif100011ToMemif100012 is an example of a bridge domain configuration.\n\tBDMemif100011ToMemif100012 = l2.BridgeDomains_BridgeDomain{\n\t\tName:                \"aaa\",\n\t\tFlood:               false,\n\t\tUnknownUnicastFlood: false,\n\t\tForward:             true,\n\t\tLearn:               true,\n\t\tArpTermination:      false,\n\t\tMacAge:              0,\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc BfdAuthKeyBuilder(id uint32, authType bfd.SingleHopBFD_Key_AuthenticationType, secret string) bfd.SingleHopBFD_Key\n```\nBfdAuthKeyBuilder creates BFD authentication key\n\n```go\nfunc BfdAuthSessionBuilder(iface string, srcAddr string, dstAddr string, desInt uint32, reqInt uint32, multiplier uint32) bfd.SingleHopBFD_Session\n```\nBfdAuthSessionBuilder creates BFD session including authentication\n\n```go\nfunc BfdEchoFunctionBuilder(iface string) bfd.SingleHopBFD_EchoFunction\n```\nBfdEchoFunctionBuilder builds BFD echo source\n\n```go\nfunc BfdSessionBuilder(iface string, srcAddr string, dstAddr string, desInt uint32, reqInt uint32, multiplier uint32) bfd.SingleHopBFD_Session\n```\nBfdSessionBuilder creates BFD session without authentication\n\n```go\nfunc LoopbackBuilder(ifname string, ipAddr string) *interfaces.Interfaces_Interface\n```\nLoopbackBuilder new instance for testing purposes\n\n```go\nfunc MemifBuilder(ifname string, ipAddr string, master bool, id uint32) *interfaces.Interfaces_Interface\n```\nMemifBuilder new instance for testing purposes\n\n```go\nfunc TapInterfaceBuilder(name string, ip string) interfaces.Interfaces_Interface\n```\nTapInterfaceBuilder serves to create test interface\n\n","path":"github.com/emnify/vpp-agent/plugins/defaultplugins/ifplugin/testing","name":"testing","synopsis":"Package testing provides tools and input data for unit testing of ifplugin.","isRedistributable":true}
