netutil

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package netutil provides network-related helper functions for testing.

Index

Constants

View Source
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 CIDRs

func CIDRs(cidr string, count uint32) (<-chan string, error)

CIDRs returns a channel of the specified number of CIDR strings starting from the given CIDR.

func LoopbackInterface

func LoopbackInterface(t *testing.T, dut *ondatra.DUTDevice, index int) string

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

func NextAggregateInterface(t *testing.T, dut *ondatra.DUTDevice) string

NextAggregateInterface returns the aggregate interface with the lowest non-zero index that according to the dut's telemetry is not yet configured.

func NextBundleInterface

func NextBundleInterface(t *testing.T, dut *ondatra.DUTDevice) string

NextBundleInterface returns the aggregate interface with the lowest non-zero index that, according to the device's telemetry, is not yet configured. Deprecated: Use NextAggregateInterface instead.

func SystemIDs

func SystemIDs(startID string, count uint32) (<-chan string, error)

SystemIDs returns a channel of the specified number of hex-formatted system IDs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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