Documentation
¶
Overview ¶
Package netutil provides network-related helper functions for testing.
Index ¶
- Constants
- func BundleInterface(t *testing.T, dut *ondatra.DUTDevice, id int) string
- func CIDRs(cidr string, count uint32) (<-chan string, error)
- func LoopbackInterface(t *testing.T, dut *ondatra.DUTDevice, id int) string
- func MeanRate[T constraints.Integer](t testing.TB, vals []*ygnmi.Value[T]) float64
- func NextBundleInterface(t *testing.T, dut *ondatra.DUTDevice) string
- func NextVLANInterface(t *testing.T, dut *ondatra.DUTDevice) string
- func SetInterfaceState(t testing.TB, dut *ondatra.DUTDevice, intf string, enabled bool)
- func SystemIDs(startID string, count uint32) (<-chan string, error)
- func VLANInterface(t *testing.T, dut *ondatra.DUTDevice, id int) string
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 BundleInterface ¶
BundleInterface returns the vendor-specific name of the bundle interface with the specified integer id.
func CIDRs ¶
CIDRs returns a channel of the specified number of CIDR strings starting from the given CIDR.
func LoopbackInterface ¶
LoopbackInterface returns the vendor-specific name of the loopback interface with the specified integer id.
func MeanRate ¶
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 NextBundleInterface ¶
NextBundleInterface returns the bundled interface with the lowest positive ID that, according to the device's telemetry, is not yet configured.
func NextVLANInterface ¶
NextVLANInterface returns the VLAN interface with the lowest positive ID that, according to the device's telemetry, is not yet configured.
func SetInterfaceState ¶
SetInterfaceState sets the state of a specified interface on a device.
Types ¶
This section is empty.