saiutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAft

func ConfigAft(vrf string, aft *oc.NetworkInstance_Afts) *configer

func ConfigNeighbor

func ConfigNeighbor(intf InterfaceRef, ip, mac string) *configer

func ConfigRIF

func ConfigRIF(portID string, mac string, vrf string) *configer

func ConfigVLANSubIntf

func ConfigVLANSubIntf(portID string, index uint32, smac string, vlan uint16, vrf string) *configer

func ConfigVRF

func ConfigVRF(name string) *configer

func CreateNeighbor

func CreateNeighbor(t testing.TB, dut *ondatra.DUTDevice, ip string, dmac string, rif uint64)

func CreateRIF

func CreateRIF(t testing.TB, dut *ondatra.DUTDevice, port *ondatra.Port, smac string, vrID uint64) uint64

func CreateRoute

func CreateRoute(t testing.TB, dut *ondatra.DUTDevice, prefix string, nexthop uint64, vrId uint64)

func MustParseMac

func MustParseMac(t testing.TB, mac string) net.HardwareAddr

Types

type Case

type Case struct {
	In, Out *Packet
	Config  []ConfigOp
}

A Case is single test case containing the config and the input and expect output.

type ConfigOp

type ConfigOp interface {
	Config(t testing.TB, s *Suite, dut *ondatra.DUTDevice)
	UnConfig(t testing.TB, s *Suite, dut *ondatra.DUTDevice)
}

ConfigOp is interface for applying a dataplane configuration option.

type InterfaceRef

type InterfaceRef struct {
	Intf    string
	SubIntf uint32
}

type Packet

type Packet struct {
	Layers []gopacket.SerializableLayer
	Port   string
}

Packet is a list of layers and a corresponding port.

type Suite

type Suite struct {
	BaseConfig []ConfigOp
	Case       []*Case
	// contains filtered or unexported fields
}

Suite contains a baseconfig and sets of tests dataplane packet tests.

func NewSuite

func NewSuite() *Suite

NewSuite returns a empty test suite.

func (*Suite) Run

func (cases *Suite) Run(t testing.TB, pm *binding.PortMgr)

Run runs all the cases and reports any diffs.

Jump to

Keyboard shortcuts

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