Documentation ¶
Overview ¶
Package testhelper contains APIs that help in writing GPINs Ondatra tests.
Index ¶
- Constants
- func AssignPortsToAggregateID(t *testing.T, dut *ondatra.DUTDevice, portChannelName string, ...)
- func AvailablePortsOfPMDType(t *testing.T, d *ondatra.DUTDevice, ...) ([]string, error)
- func AwaitFullyQualifiedInterfaceName(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, ...)
- func AwaitFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string, timeout time.Duration, ...)
- func AwaitHealthIndicator(t *testing.T, dut *ondatra.DUTDevice, name string, timeout time.Duration, ...)
- func AwaitLacpKey(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, ...)
- func AwaitSystemFeatureLabel(t *testing.T, dut *ondatra.DUTDevice, timeout time.Duration, ...)
- func BreakoutStateInfoForPort(t *testing.T, dut *ondatra.DUTDevice, port string, currBreakoutMode string) (map[string]*PortBreakoutInfo, error)
- func CollateralFlapAllowed(t *testing.T, dut *ondatra.DUTDevice, pmdType string) (bool, error)
- func ComponentChassisBaseMacAddress(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func ComponentChassisFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func ComponentChassisMacAddressPoolSize(t *testing.T, dut *ondatra.DUTDevice, name string) uint32
- func ComponentChassisModelName(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func ComponentChassisPlatform(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func ComponentStorageSide(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func ConfigFromBreakoutMode(t *testing.T, dut *ondatra.DUTDevice, breakoutMode, port string) (*oc.Root, error)
- func ConfigPush(t *testing.T, dut *ondatra.DUTDevice, config *[]byte) error
- func CreateSubscribeRequest(params SubscribeRequestParams) (*gpb.SubscribeRequest, error)
- func CurrentBreakoutModeForPort(t *testing.T, dut *ondatra.DUTDevice, port string) (string, error)
- func DUTPortNames(dut *ondatra.DUTDevice) []string
- func EthernetPMD(t *testing.T, dut *ondatra.DUTDevice, xcvrName string) string
- func EthernetSpeedToBpsString(speed oc.E_IfEthernet_ETHERNET_SPEED) (string, error)
- func EthernetSpeedToUint64(speed oc.E_IfEthernet_ETHERNET_SPEED) (uint64, error)
- func ExpectedPortInfoForBreakoutMode(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, ...) (map[string]*PortBreakoutInfo, error)
- func FPGAResetCauseMap(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) map[int]*ResetCause
- func FPGAResetCount(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) uint8
- func FPGAType(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) string
- func FanSpeedControlPct(t *testing.T, dut *ondatra.DUTDevice, f *FanInfo) uint64
- func FrontPanelPortListForDevice(t *testing.T, dut *ondatra.DUTDevice) ([]string, error)
- func FrontPanelPortToIndexMappingForDevice(t *testing.T, dut *ondatra.DUTDevice) (map[string]int, error)
- func FullyQualifiedInterfaceName(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) string
- func GNMIAble(t *testing.T, d *ondatra.DUTDevice) error
- func GNOIAble(t *testing.T, d *ondatra.DUTDevice) error
- func GenerateLACPInterface(pcName string) oc.Lacp_Interface
- func GeneratePortChannelInterface(portChannelName string) oc.Interface
- func GetConfig(t *testing.T, dut *ondatra.DUTDevice) []byte
- func GetFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func GetFullyQualifiedNameFromConfig(t *testing.T, dut *ondatra.DUTDevice, name string) string
- func GetLatestAvailableFirmwareVersion(t *testing.T, dut *ondatra.DUTDevice, xcvrName string) string
- func HealthzGetPortDebugData(t *testing.T, d *ondatra.DUTDevice, intfName string) error
- func ImageVersionRegex() []string
- func IsFrontPanelPort(port string) bool
- func IsParentPort(t *testing.T, dut *ondatra.DUTDevice, port string) (bool, error)
- func LookupComponentTypeOCCompliant(t *testing.T, dut *ondatra.DUTDevice, name string) (string, bool)
- func MaxLanesPerPort(t *testing.T, dut *ondatra.DUTDevice) (uint8, error)
- func ParentPortNumber(port string) (string, error)
- func PeerPortsBySpeed(t *testing.T, host *ondatra.DUTDevice, peer *ondatra.DUTDevice) map[oc.E_IfEthernet_ETHERNET_SPEED][]PeerPorts
- func PhysicalPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) (string, error)
- func PortMediaType(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) (string, error)
- func PortPMDFromModel(t *testing.T, dut *ondatra.DUTDevice, port string) (string, error)
- func PortTransceiver(t *testing.T, dut *ondatra.DUTDevice, portName string) string
- func RandomInterface(t *testing.T, dut *ondatra.DUTDevice, params *RandomInterfaceParams) (string, error)
- func Reboot(t *testing.T, d *ondatra.DUTDevice, params *RebootParams) error
- func RebootTimeForDevice(t *testing.T, d *ondatra.DUTDevice) (time.Duration, error)
- func RemovePortChannelFromDevice(t *testing.T, timeout time.Duration, dut *ondatra.DUTDevice, ...) error
- func ReplaceComponentIntegratedCircuitNodeID(t *testing.T, dut *ondatra.DUTDevice, name string, val uint64)
- func ReplaceConfigMetaData(t *testing.T, dut *ondatra.DUTDevice, value string)
- func ReplaceFullyQualifiedInterfaceName(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, value string)
- func ReplaceFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string, value string)
- func ReplaceHealthIndicator(t *testing.T, dut *ondatra.DUTDevice, name string, ...)
- func RunSSH(addr string, cmd string) (string, error)
- func SensorType(t *testing.T, dut *ondatra.DUTDevice, ts *TemperatureSensorInfo) string
- func SpeedChangeOnlyPorts(t *testing.T, dut *ondatra.DUTDevice, port string, currBreakoutMode string, ...) (bool, int, error)
- func StorageAvgEraseCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint32
- func StorageIOErrors(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64
- func StorageMaxEraseCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint32
- func StoragePowerOnSeconds(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64
- func StorageRawReadErrorRate(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64
- func StorageReallocatedSectorCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64
- func StorageSsdLifeLeft(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64
- func StorageThroughputPerformance(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64
- func StorageWriteAmplificationFactor(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64
- func StringToYgnmiPath(path string) (*gpb.Path, error)
- func SupportedBreakoutModesForPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, ...) ([]string, error)
- func SupportedSpeedsForPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) ([]oc.E_IfEthernet_ETHERNET_SPEED, error)
- func SwitchNameRegex() string
- func SystemConfigMetaData(t *testing.T, dut *ondatra.DUTDevice) string
- func SystemConfigMetaDataFromConfig(t *testing.T, dut *ondatra.DUTDevice) string
- func TransceiverEmpty(t *testing.T, d *ondatra.DUTDevice, port string) (bool, error)
- func TransceiverNumberForPort(t *testing.T, dut *ondatra.DUTDevice, port string) (int, error)
- func Uint16ListToString(a []uint16) string
- func UpdateLacpKey(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, val uint16)
- func VerifyPortsOperStatus(t *testing.T, d *ondatra.DUTDevice, ports ...string) error
- func WaitForInterfaceState(t *testing.T, dut *ondatra.DUTDevice, intfName string, ...) error
- func WrapError(err error, format string, args ...any) error
- type BreakoutType
- type DUTInfo
- type E_Interface_HealthIndicator
- type E_ResetCause_Cause
- type GNMIConfig
- type GNMIConfigDUT
- type Interface_FullyQualifiedInterfaceNamePath
- type OperStatusInfo
- type P4InfoDetails
- type P4RTClient
- type P4RTClientOptions
- type PacketOut
- type PeerPorts
- type PortBreakoutInfo
- type PortProperties
- type RandomInterfaceParams
- type RandomPortBreakoutInfo
- type RandomPortWithSupportedBreakoutModesParams
- type RebootParams
- type ResetCause
- type SSHManager
- type SubscribeRequestParams
- type System_ConfigMetaDataPath
- type System_FeatureLabel
- func CreateFeatureLabel(label uint32) *System_FeatureLabel
- func SystemFeatureLabel(t *testing.T, dut *ondatra.DUTDevice, label uint32) *System_FeatureLabel
- func SystemFeatureLabelFromConfig(t *testing.T, dut *ondatra.DUTDevice, label uint32) *System_FeatureLabel
- func SystemFeatureLabels(t *testing.T, dut *ondatra.DUTDevice) []*System_FeatureLabel
- type System_FeatureLabelPath
- type TearDown
- type TearDownOptions
- type TemperatureSensorType
Constants ¶
const (
FrontPanelPortPrefix = "Ethernet"
)
FrontPanelPortPrefix defines prefix string for front panel ports.
Variables ¶
This section is empty.
Functions ¶
func AssignPortsToAggregateID ¶
func AssignPortsToAggregateID(t *testing.T, dut *ondatra.DUTDevice, portChannelName string, portNames ...string)
AssignPortsToAggregateID will assign the list of ports to the given aggregate ID on a device. The aggregate ID should correspond to an existing PortChannel interface or this call will fail.
func AvailablePortsOfPMDType ¶
func AvailablePortsOfPMDType(t *testing.T, d *ondatra.DUTDevice, pmdType oc.E_TransportTypes_ETHERNET_PMD_TYPE) ([]string, error)
AvailablePortsOfPMDType returns ports with matching PMD type.
func AwaitFullyQualifiedName ¶
func AwaitHealthIndicator ¶
func AwaitLacpKey ¶
func AwaitSystemFeatureLabel ¶
func BreakoutStateInfoForPort ¶
func BreakoutStateInfoForPort(t *testing.T, dut *ondatra.DUTDevice, port string, currBreakoutMode string) (map[string]*PortBreakoutInfo, error)
BreakoutStateInfoForPort returns the state values of physical channels and operational status information for ports in a given breakout mode.
func CollateralFlapAllowed ¶
CollateralFlapAllowed indicates if collateral link flap is allowed on the platform, pmd type.
func ComponentStorageSide ¶
func ConfigFromBreakoutMode ¶
func ConfigFromBreakoutMode(t *testing.T, dut *ondatra.DUTDevice, breakoutMode, port string) (*oc.Root, error)
ConfigFromBreakoutMode returns config with component and interface paths for given breakout mode. Breakout mode is in the format "numBreakouts1 x breakoutSpeed1 + numBreakouts2 x breakoutSpeed2 + ... Eg: "1x400G", 2x100G(4) + 1x200G(4)"
func ConfigPush ¶
ConfigPush pushes the given config onto the DUT. If nil is passed in for config, this function will use ConfigGet() to get a full config for the DUT.
func CreateSubscribeRequest ¶
func CreateSubscribeRequest(params SubscribeRequestParams) (*gpb.SubscribeRequest, error)
CreateSubscribeRequest creates SubscribeRequest message using the specified parameters that include the list of paths to be added in the request.
func CurrentBreakoutModeForPort ¶
CurrentBreakoutModeForPort returns the currently configured breakout mode for given port.
func DUTPortNames ¶
DUTPortNames returns the port names of the DUT.
func EthernetSpeedToBpsString ¶
func EthernetSpeedToBpsString(speed oc.E_IfEthernet_ETHERNET_SPEED) (string, error)
EthernetSpeedToBpsString returns speed in string format in bits/second.
func EthernetSpeedToUint64 ¶
func EthernetSpeedToUint64(speed oc.E_IfEthernet_ETHERNET_SPEED) (uint64, error)
EthernetSpeedToUint64 returns the speed in uint64 format.
func ExpectedPortInfoForBreakoutMode ¶
func ExpectedPortInfoForBreakoutMode(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, breakoutMode string) (map[string]*PortBreakoutInfo, error)
ExpectedPortInfoForBreakoutMode returns the expected port list, physical channels and port speed for a given breakout mode. Eg. Ethernet0 configured to a breakout mode of "2x100G(4) + 1x200G(4)" will return the following: Ethernet0:{0,1}, Ethernet2:{2,3}, Ethernet4:{4,5,6,7} The number of physical channels per breakout mode is used to compute the offset from the parent port number.
func FPGAResetCauseMap ¶
func FanSpeedControlPct ¶
func FrontPanelPortListForDevice ¶
FrontPanelPortListForDevice returns the list of front panel ports on the switch.
func FrontPanelPortToIndexMappingForDevice ¶
func FrontPanelPortToIndexMappingForDevice(t *testing.T, dut *ondatra.DUTDevice) (map[string]int, error)
FrontPanelPortToIndexMappingForDevice returns list of front panel port to index mapping.
func GNMIAble ¶
GNMIAble returns whether the gNMI server on the specified device is reachable or not.
func GNOIAble ¶
GNOIAble returns whether the gNOI server on the specified device is reachable or not.
func GenerateLACPInterface ¶
func GenerateLACPInterface(pcName string) oc.Lacp_Interface
GenerateLACPInterface creates a minimal LACP interface that tests can then extend as needed.
func GeneratePortChannelInterface ¶
GeneratePortChannelInterface will return a minimal PortChannel interface that tests can extend as needed.
func GetFullyQualifiedName ¶
func HealthzGetPortDebugData ¶
HealthzGetPortDebugData returns port debug data given an interface.
func ImageVersionRegex ¶
func ImageVersionRegex() []string
ImageVersionRegex returns the regular expressions for the image version of the switch.
func IsFrontPanelPort ¶
IsFrontPanelPort returns true if the specified port is a front panel port.
func IsParentPort ¶
IsParentPort returns whether the specified port is a parent port or not.
func MaxLanesPerPort ¶
MaxLanesPerPort returns the maximum number of ASIC lanes per port on the dut.
func ParentPortNumber ¶
ParentPortNumber returns the port number of the parent of the port.
func PeerPortsBySpeed ¶
func PeerPortsBySpeed(t *testing.T, host *ondatra.DUTDevice, peer *ondatra.DUTDevice) map[oc.E_IfEthernet_ETHERNET_SPEED][]PeerPorts
PeerPortsBySpeed iterates through all the available Ethernet ports on a host device, and determines if they have a matching port on the peer device. All host ports with a valid peer will be grouped together based on their speed.
func PhysicalPort ¶
PhysicalPort returns the physical port corresponding to the given interface.
func PortMediaType ¶
PortMediaType returns the media type of the requested port.
func PortPMDFromModel ¶
PortPMDFromModel returns the port pmdtype from the model.
func PortTransceiver ¶
func RandomInterface ¶
func RandomInterface(t *testing.T, dut *ondatra.DUTDevice, params *RandomInterfaceParams) (string, error)
RandomInterface picks a random front panel port which is operationally UP. Many tests typically need a link that is up, so we'll return a randomly selected interface if it is Operationally UP. Options can be passed to this method using RandomInterfaceParams struct.
func Reboot ¶
Reboot sends a RebootRequest message to the switch. It waits for a specified amount of time for the switch reboot to be successful. A switch reboot is considered to be successful if the gNOI server is up and the boot time is after the reboot request time.
func RebootTimeForDevice ¶
RebootTimeForDevice returns the maximum time that the device might take to reboot.
func RemovePortChannelFromDevice ¶
func RemovePortChannelFromDevice(t *testing.T, timeout time.Duration, dut *ondatra.DUTDevice, portChannelName string) error
RemovePortChannelFromDevice will cleanup all configs relating to a PortChannel on a given switch. It will also verify that the state has been updated before returning. If the state fails to converge then an error will be returned.
func ReplaceConfigMetaData ¶
func ReplaceHealthIndicator ¶
func RunSSH ¶
RunSSH runs a single SSH command on the device and returns its standard output. Handles the creation and closing of SSHManager, since the underlying SSHSession can only call one command.
func SensorType ¶
func SpeedChangeOnlyPorts ¶
func SpeedChangeOnlyPorts(t *testing.T, dut *ondatra.DUTDevice, port string, currBreakoutMode string, newBreakoutMode string) (bool, int, error)
SpeedChangeOnlyPorts returns 1. Whether changing from currBrekaoutMode to newBreakoutMode is overall a speed change operation. 2. Number of ports that will result in speed change only if 1 is true.
func StorageAvgEraseCount ¶
func StorageIOErrors ¶
func StorageMaxEraseCount ¶
func StoragePowerOnSeconds ¶
func StorageRawReadErrorRate ¶
func StorageSsdLifeLeft ¶
func SupportedBreakoutModesForPort ¶
func SupportedBreakoutModesForPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, breakoutType BreakoutType) ([]string, error)
SupportedBreakoutModesForPort returns list of supported breakout modes for given interface.
func SupportedSpeedsForPort ¶
func SupportedSpeedsForPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) ([]oc.E_IfEthernet_ETHERNET_SPEED, error)
SupportedSpeedsForPort returns list of supported speeds for given interface.
func SwitchNameRegex ¶
func SwitchNameRegex() string
SwitchNameRegex returns the regex for switch name.
func TransceiverEmpty ¶
TransceiverEmpty returns true if the transceiver status is 0, false if the status is 1
func TransceiverNumberForPort ¶
TransceiverNumberForPort fetches the transceiver corresponding to the port.
func Uint16ListToString ¶
Uint16ListToString returns comma separate string representation of list of uint16.
func UpdateLacpKey ¶
func VerifyPortsOperStatus ¶
VerifyPortsOperStatus verifies that the oper-status of the specified front panel ports is up. If front panel ports are not specified, then it verifies the oper-status for all ports on the device.
Types ¶
type BreakoutType ¶
type BreakoutType int
BreakoutType describes the possible types of breakout modes
const ( // Unset indicates a not set breakout mode to be used where breakout is not applicable. Unset BreakoutType = iota // Any indicates any breakout modes (mixed as well as non-mixed) Any // Mixed indicates mixed breakout modes only Mixed // NonMixed indicates non mixed breakout only NonMixed // Channelized indicates breakout mode with at least one more port other than parent port. // This mode is used to test breakout with subinterface config on child port. Channelized // SpeedChangeOnly indicates breakout mode that results in a speed change only (no lane change) on requested number of ports. SpeedChangeOnly )
type DUTInfo ¶
type DUTInfo struct {
// contains filtered or unexported fields
}
DUTInfo contains dut related info.
type E_Interface_HealthIndicator ¶
type E_Interface_HealthIndicator int64
const ( Interface_HealthIndicator_UNSET E_Interface_HealthIndicator = 0 Interface_HealthIndicator_GOOD E_Interface_HealthIndicator = 1 Interface_HealthIndicator_BAD E_Interface_HealthIndicator = 2 )
func (E_Interface_HealthIndicator) IsYANGGoEnum ¶
func (h E_Interface_HealthIndicator) IsYANGGoEnum()
func (E_Interface_HealthIndicator) String ¶
func (h E_Interface_HealthIndicator) String() string
func (E_Interface_HealthIndicator) ΛMap ¶
func (h E_Interface_HealthIndicator) ΛMap() map[string]map[int64]ygot.EnumDefinition
type E_ResetCause_Cause ¶
type E_ResetCause_Cause int64
const ( ResetCause_Cause_UNSET E_ResetCause_Cause = 0 ResetCause_Cause_UNKNOWN E_ResetCause_Cause = 1 ResetCause_Cause_POWER E_ResetCause_Cause = 2 ResetCause_Cause_SWITCH E_ResetCause_Cause = 3 ResetCause_Cause_WATCHDOG E_ResetCause_Cause = 4 ResetCause_Cause_SOFTWARE E_ResetCause_Cause = 5 ResetCause_Cause_EMULATOR E_ResetCause_Cause = 6 ResetCause_Cause_CPU E_ResetCause_Cause = 7 )
func FPGAResetCause ¶
func (E_ResetCause_Cause) IsYANGGoEnum ¶
func (E_ResetCause_Cause) IsYANGGoEnum()
func (E_ResetCause_Cause) String ¶
func (e E_ResetCause_Cause) String() string
func (E_ResetCause_Cause) ΛMap ¶
func (E_ResetCause_Cause) ΛMap() map[string]map[int64]ygot.EnumDefinition
type GNMIConfig ¶
GNMIConfig provides an interface to implement config get.
type GNMIConfigDUT ¶
GNMIConfigDUT contains the DUT for which the config get is being requested for.
func (GNMIConfigDUT) ConfigGet ¶
func (d GNMIConfigDUT) ConfigGet() ([]byte, error)
ConfigGet returns a full config for the given DUT.
type OperStatusInfo ¶
OperStatusInfo returns the list of interfaces with the following oper-status: 1) UP 2) DOWN 3) TESTING 4) Any other value
func FetchPortsOperStatus ¶
func FetchPortsOperStatus(t *testing.T, d *ondatra.DUTDevice, ports ...string) (*OperStatusInfo, error)
FetchPortsOperStatus fetches the oper-status of the specified front panel ports. If front panel ports are not specified, then it fetches the oper-status for all ports on the device. It returns the list of ports with oper-status values present in OperStatusInfo struct.
type P4InfoDetails ¶
P4InfoDetails is an interface to get P4Info of a chassis.
type P4RTClient ¶
type P4RTClient struct {
// contains filtered or unexported fields
}
P4RTClient wraps P4RuntimeClient and implements methods for performing P4RT operations.
func FetchP4RTClient ¶
func FetchP4RTClient(t *testing.T, d *ondatra.DUTDevice, p p4pb.P4RuntimeClient, options *P4RTClientOptions) (*P4RTClient, error)
FetchP4RTClient method fetches P4RTClient associated with a device. If the client does not exist, then it creates one and caches it for future use. During client creation, it performs master arbitration and P4Info push.
func (*P4RTClient) FetchP4Info ¶
func (p *P4RTClient) FetchP4Info() (*p4infopb.P4Info, error)
FetchP4Info fetches P4Info from the switch.
func (*P4RTClient) P4Info ¶
func (p *P4RTClient) P4Info() (*p4infopb.P4Info, error)
P4Info gets P4Info of the switch.
func (*P4RTClient) PushP4Info ¶
func (p *P4RTClient) PushP4Info() error
PushP4Info pushes P4Info into the switch.
func (*P4RTClient) SendPacketOut ¶
func (p *P4RTClient) SendPacketOut(t *testing.T, packetOut *PacketOut) error
SendPacketOut instructs the P4RT server on the switch to perform packet-out operation.
func (*P4RTClient) SetMastership ¶
func (p *P4RTClient) SetMastership() error
SetMastership tries to configure P4RT client as master by sending master arbitration request to the switch.
type P4RTClientOptions ¶
type P4RTClientOptions struct {
// contains filtered or unexported fields
}
P4RTClientOptions contains the fields for creation of P4RTClient.
type PacketOut ¶
type PacketOut struct { SubmitToIngress bool EgressPort string Count uint Interval time.Duration Packet []byte }
PacketOut structure enables the user to specify the following information for performing packet-out operation on the switch: EgressPort: Front panel port from which the packet needs to be sent out. Count: Number of packets to be egressed. Interval: Time interval between successive packet-out operations. Packet: Raw packet to be sent out.
type PeerPorts ¶
PeerPorts holds the name of 2 Ethernet interfaces. These interfaces will be on separate machines, but connected to each other by a cable.
type PortBreakoutInfo ¶
type PortBreakoutInfo struct { PhysicalChannels []uint16 OperStatus oc.E_Interface_OperStatus PortSpeed oc.E_IfEthernet_ETHERNET_SPEED }
PortBreakoutInfo contains list of resultant ports for a given breakout mode and physical channels and operational status for each interface.
type PortProperties ¶
type PortProperties struct {
// contains filtered or unexported fields
}
PortProperties contains front panel port information.
type RandomInterfaceParams ¶
RandomInterfaceParams contains optional list of parameters than can be passed to RandomInterface(): PortList: If passed, only ports in this list must be considered when picking a random interface. IsParent: If set, only parent ports must be considered. OperDownOk: If set, then operationally down ports can also be picked.
type RandomPortBreakoutInfo ¶
type RandomPortBreakoutInfo struct { PortName string // Randomly selected port on switch. CurrBreakoutMode string // Currently configured breakout mode on the port. SupportedBreakoutMode string // Supported breakout mode on port different from current breakout mode. }
RandomPortBreakoutInfo contains information about a randomly picked port on the switch.
func RandomPortWithSupportedBreakoutModes ¶
func RandomPortWithSupportedBreakoutModes(t *testing.T, dut *ondatra.DUTDevice, params *RandomPortWithSupportedBreakoutModesParams) (*RandomPortBreakoutInfo, error)
RandomPortWithSupportedBreakoutModes attempts to get a random port from list of front panel ports that supports at least one more breakout mode other than the currently configured breakout mode.
type RandomPortWithSupportedBreakoutModesParams ¶
type RandomPortWithSupportedBreakoutModesParams struct { CurrBreakoutType BreakoutType // mixed/non-mixed/any/channelized NewBreakoutType BreakoutType // mixed/non-mixed/any/channelized SpeedChangeOnlyPortCount int // number of ports that are required to change in speed only on breakout PortList []string // List of ports from which a random port can be selected }
RandomPortWithSupportedBreakoutModesParams contains list of additional parameters for RandomPortWithSupportedBreakoutModes
type RebootParams ¶
type RebootParams struct {
// contains filtered or unexported fields
}
RebootParams specify the reboot parameters used by the Reboot API.
func NewRebootParams ¶
func NewRebootParams() *RebootParams
NewRebootParams returns RebootParams structure with default values.
func (*RebootParams) WithCheckInterval ¶
func (p *RebootParams) WithCheckInterval(t time.Duration) *RebootParams
WithCheckInterval adds the time interval to check whether the reboot operation has been successful.
func (*RebootParams) WithLatencyMeasurement ¶
func (p *RebootParams) WithLatencyMeasurement(testTrackerID, title string) *RebootParams
WithLatencyMeasurement adds testtracker uuid and title for latency measurement.
func (*RebootParams) WithRequest ¶
func (p *RebootParams) WithRequest(r any) *RebootParams
WithRequest adds the reboot request in RebootParams. The reboot request can be one of the following: 1) RebootMethod such as syspb.RebootMethod_COLD. 2) RebootRequest protobuf.
func (*RebootParams) WithWaitTime ¶
func (p *RebootParams) WithWaitTime(t time.Duration) *RebootParams
WithWaitTime adds the period of time to wait for the reboot operation to be successful.
type ResetCause ¶
type ResetCause struct {
// contains filtered or unexported fields
}
func (*ResetCause) GetCause ¶
func (r *ResetCause) GetCause() E_ResetCause_Cause
func (*ResetCause) GetIndex ¶
func (r *ResetCause) GetIndex() int
type SSHManager ¶
type SSHManager struct { SSHSession *ssh.Session SFTPClient *sftp.Client // contains filtered or unexported fields }
SSHManager provides two ssh objects: ssh.Session and sftp.Client.
func NewSSHManager ¶
func NewSSHManager(addr string) (*SSHManager, error)
NewSSHManager returns a new SSHManager, which contains two ssh objects that can help in ssh & scp.
func (*SSHManager) Close ¶
func (s *SSHManager) Close() error
Close must be called to close the SSHManager.
type SubscribeRequestParams ¶
type SubscribeRequestParams struct { Target string Paths []ygnmi.PathStruct Mode gpb.SubscriptionList_Mode }
SubscribeRequestParams specifies the parameters that are used to create the SubscribeRequest. Target: The target to be specified in the prefix. Paths: List of paths to be added in the request. Mode: Subscription mode.
type System_ConfigMetaDataPath ¶
System_ConfigMetaDataPath represents the /openconfig-system/system/state/config-meta-data YANG schema element.
func ConfigMetaData ¶
func ConfigMetaData(n *system.SystemPath) *System_ConfigMetaDataPath
func (*System_ConfigMetaDataPath) IsYANGGoStruct ¶
func (*System_ConfigMetaDataPath) IsYANGGoStruct()
func (*System_ConfigMetaDataPath) Validate ¶
func (*System_ConfigMetaDataPath) Validate(opts ...ygot.ValidationOption) error
func (*System_ConfigMetaDataPath) ΛBelongingModule ¶
func (*System_ConfigMetaDataPath) ΛBelongingModule() string
func (*System_ConfigMetaDataPath) ΛEnumTypeMap ¶
type System_FeatureLabel ¶
type System_FeatureLabel struct {
Label *uint32 `` /* 196-byte string literal not displayed */
}
System_FeatureLabel represents the /openconfig-system/system/feature-labels/feature-label YANG schema element.
func CreateFeatureLabel ¶
func CreateFeatureLabel(label uint32) *System_FeatureLabel
CreateFeatureLabel retrieves the value with the specified keys from the receiver System. If the entry does not exist, then it is created. It returns the existing or new list member.
func SystemFeatureLabel ¶
func SystemFeatureLabels ¶
func SystemFeatureLabels(t *testing.T, dut *ondatra.DUTDevice) []*System_FeatureLabel
func (*System_FeatureLabel) GetLabel ¶
func (f *System_FeatureLabel) GetLabel() uint32
func (*System_FeatureLabel) IsYANGGoStruct ¶
func (*System_FeatureLabel) IsYANGGoStruct()
type System_FeatureLabelPath ¶
System_FeatureLabelPath represents the /openconfig-system/system/feature-labels/feature-label YANG schema element.
func SystemFeatureLabelPath ¶
func SystemFeatureLabelPath(n *system.SystemPath, Label uint32) *System_FeatureLabelPath
FeatureLabel (list): List of feature labels.
Defining module: "google-pins-system" Instantiating module: "openconfig-system" Path from parent: "feature-labels/feature-label" Path from root: "/system/feature-labels/feature-label" Label: uint32
func (*System_FeatureLabelPath) Config ¶
func (n *System_FeatureLabelPath) Config() ygnmi.ConfigQuery[*System_FeatureLabel]
Config returns a Query that can be used in gNMI operations. TODO: Kept ygnmi API as gnmi.Set doesn't work. For gnmi.Set to work, will have to add GO `json tag` parsing of `Label` to form the correct request.
type TearDownOptions ¶
type TearDownOptions struct { StartTime time.Time DUTName string IDs []string DUTDeviceInfo DUTInfo DUTPeerDeviceInfo DUTInfo SaveLogs func(t *testing.T, savePrefix string, dut, peer DUTInfo) }
TearDownOptions consist of the options to be taken into account by the teardown method.
func NewTearDownOptions ¶
func NewTearDownOptions(t *testing.T) TearDownOptions
NewTearDownOptions creates the TearDownOptions structure with default values.
func (TearDownOptions) Teardown ¶
func (o TearDownOptions) Teardown(t *testing.T)
Teardown performs the teardown routine after the test completion.
func (TearDownOptions) WithID ¶
func (o TearDownOptions) WithID(id string) TearDownOptions
WithID attaches an ID to the test.
func (TearDownOptions) WithIDs ¶
func (o TearDownOptions) WithIDs(ids []string) TearDownOptions
WithIDs attaches a list of IDs to the test.
type TemperatureSensorType ¶
type TemperatureSensorType int
TemperatureSensorType defines the type of temperature sensors.
const ( CPUTempSensor TemperatureSensorType = iota HeatsinkTempSensor ExhaustTempSensor InletTempSensor DimmTempSensor )
Type of temperature sensors.