Documentation
¶
Overview ¶
Package netutil provides network-related helper functions for testing.
Index ¶
- Constants
- func AggregateInterface(t *testing.T, dut *ondatra.DUTDevice, index int) string
- func CIDRs(cidr string, count uint32) (<-chan string, error)
- func CommonTrafficQueues(t *testing.T, dut *ondatra.DUTDevice) *entname.CommonTrafficQueueNames
- func LoopbackInterface(t *testing.T, dut *ondatra.DUTDevice, index int) string
- func MeanRate[T constraints.Integer | constraints.Float](t testing.TB, vals []*ygnmi.Value[T]) float64
- func NextAggregateInterface(t *testing.T, dut *ondatra.DUTDevice) string
- func SystemIDs(startID string, count uint32) (<-chan string, error)
Constants ¶
const DefaultNetworkInstance = "DEFAULT"
DefaultNetworkInstance is the constant name for referring to the default network instance on the device. It has been standardized in OpenConfig.
Variables ¶
This section is empty.
Functions ¶
func AggregateInterface ¶ added in v0.1.22
AggregateInterface returns the vendor-specific name of the aggregate interface with the specified zero-based index.
func CIDRs ¶
CIDRs returns a channel of the specified number of CIDR strings starting from the given CIDR.
func CommonTrafficQueues ¶ added in v0.1.22
CommonTrafficQueues returns the vendors-specific names of common traffic class queues. See the definition of common queues here: https://github.com/openconfig/entity-naming/blob/main/README.md#traffic-queues
func LoopbackInterface ¶
LoopbackInterface returns the vendor-specific name of the loopback interface with the specified zero-based index.
func MeanRate ¶
func MeanRate[T constraints.Integer | constraints.Float](t testing.TB, vals []*ygnmi.Value[T]) float64
MeanRate calculates the average rate across the supplied interval from the values supplied in the vals slice. It sorts the values by timestamp and uses the earliest and latest to calculate the rate. Errors are reported using the supplied testing.TB.
func NextAggregateInterface ¶ added in v0.1.19
NextAggregateInterface returns the aggregate interface with the lowest non-zero index that according to the dut's telemetry is not yet configured.
Types ¶
This section is empty.