testhelper

package
v0.0.0-...-ecac43f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package testhelper contains APIs that help in writing GPINs Ondatra tests.

Index

Constants

View Source
const (
	FrontPanelPortPrefix = "Ethernet"
)

FrontPanelPortPrefix defines prefix string for front panel ports.

Variables

This section is empty.

Functions

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 AwaitFullyQualifiedInterfaceName

func AwaitFullyQualifiedInterfaceName(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, timeout time.Duration, val string)

func AwaitFullyQualifiedName

func AwaitFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string, timeout time.Duration, val string)

func AwaitHealthIndicator

func AwaitHealthIndicator(t *testing.T, dut *ondatra.DUTDevice, name string, timeout time.Duration, val E_Interface_HealthIndicator)

func AwaitLacpKey

func AwaitLacpKey(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, timeout time.Duration, val uint16)

func AwaitSystemFeatureLabel

func AwaitSystemFeatureLabel(t *testing.T, dut *ondatra.DUTDevice, timeout time.Duration, val *System_FeatureLabel)

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

func CollateralFlapAllowed(t *testing.T, dut *ondatra.DUTDevice, pmdType string) (bool, error)

CollateralFlapAllowed indicates if collateral link flap is allowed on the platform, pmd type.

func ComponentChassisBaseMacAddress

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

func ComponentChassisFullyQualifiedName

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

func ComponentChassisMacAddressPoolSize

func ComponentChassisMacAddressPoolSize(t *testing.T, dut *ondatra.DUTDevice, name string) uint32

func ComponentChassisModelName

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

func ComponentChassisPlatform

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

func ComponentStorageSide

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

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 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

func CurrentBreakoutModeForPort(t *testing.T, dut *ondatra.DUTDevice, port string) (string, error)

CurrentBreakoutModeForPort returns the currently configured breakout mode for given port.

func DUTPortNames

func DUTPortNames(dut *ondatra.DUTDevice) []string

DUTPortNames returns the port names of the DUT.

func EthernetPMD

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

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 FPGAResetCauseMap(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) map[int]*ResetCause

func FPGAResetCount

func FPGAResetCount(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) uint8

func FPGAType

func FPGAType(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo) string

func FanSpeedControlPct

func FanSpeedControlPct(t *testing.T, dut *ondatra.DUTDevice, f *FanInfo) uint64

func FrontPanelPortListForDevice

func FrontPanelPortListForDevice(t *testing.T, dut *ondatra.DUTDevice) ([]string, error)

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 FullyQualifiedInterfaceName

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

func GNOIAble

func GNOIAble(t *testing.T, d *ondatra.DUTDevice) error

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

func GeneratePortChannelInterface(portChannelName string) oc.Interface

GeneratePortChannelInterface will return a minimal PortChannel interface that tests can extend as needed.

func GetConfig

func GetConfig(t *testing.T, dut *ondatra.DUTDevice) []byte

func GetFullyQualifiedName

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

func GetFullyQualifiedNameFromConfig

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

func GetLatestAvailableFirmwareVersion

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

func HealthzGetPortDebugData

func HealthzGetPortDebugData(t *testing.T, d *ondatra.DUTDevice, intfName string) error

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

func IsFrontPanelPort(port string) bool

IsFrontPanelPort returns true if the specified port is a front panel port.

func IsParentPort

func IsParentPort(t *testing.T, dut *ondatra.DUTDevice, port string) (bool, error)

IsParentPort returns whether the specified port is a parent port or not.

func LookupComponentTypeOCCompliant

func LookupComponentTypeOCCompliant(t *testing.T, dut *ondatra.DUTDevice, name string) (string, bool)

func MaxLanesPerPort

func MaxLanesPerPort(t *testing.T, dut *ondatra.DUTDevice) (uint8, error)

MaxLanesPerPort returns the maximum number of ASIC lanes per port on the dut.

func ParentPortNumber

func ParentPortNumber(port string) (string, error)

ParentPortNumber returns the port number of the parent of the port.

func PhysicalPort

func PhysicalPort(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) (string, error)

PhysicalPort returns the physical port corresponding to the given interface.

func PortMediaType

func PortMediaType(t *testing.T, dut *ondatra.DUTDevice, interfaceName string) (string, error)

PortMediaType returns the media type of the requested port.

func PortPMDFromModel

func PortPMDFromModel(t *testing.T, dut *ondatra.DUTDevice, port string) (string, error)

PortPMDFromModel returns the port pmdtype from the model.

func PortTransceiver

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

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 RebootTimeForDevice

func RebootTimeForDevice(t *testing.T, d *ondatra.DUTDevice) (time.Duration, error)

RebootTimeForDevice returns the maximum time that the device might take to reboot.

func ReplaceComponentIntegratedCircuitNodeID

func ReplaceComponentIntegratedCircuitNodeID(t *testing.T, dut *ondatra.DUTDevice, name string, val uint64)

func ReplaceConfigMetaData

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

func ReplaceFullyQualifiedInterfaceName

func ReplaceFullyQualifiedInterfaceName(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, value string)

func ReplaceFullyQualifiedName

func ReplaceFullyQualifiedName(t *testing.T, dut *ondatra.DUTDevice, name string, value string)

func ReplaceHealthIndicator

func ReplaceHealthIndicator(t *testing.T, dut *ondatra.DUTDevice, name string, val E_Interface_HealthIndicator)

func RunSSH

func RunSSH(addr string, cmd string) (string, error)

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 SensorType(t *testing.T, dut *ondatra.DUTDevice, ts *TemperatureSensorInfo) string

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 StorageAvgEraseCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint32

func StorageIOErrors

func StorageIOErrors(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64

func StorageMaxEraseCount

func StorageMaxEraseCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint32

func StoragePowerOnSeconds

func StoragePowerOnSeconds(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64

func StorageRawReadErrorRate

func StorageRawReadErrorRate(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64

func StorageReallocatedSectorCount

func StorageReallocatedSectorCount(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64

func StorageSsdLifeLeft

func StorageSsdLifeLeft(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) uint64

func StorageThroughputPerformance

func StorageThroughputPerformance(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64

func StorageWriteAmplificationFactor

func StorageWriteAmplificationFactor(t *testing.T, dut *ondatra.DUTDevice, s *StorageDeviceInfo) float64

func StringToYgnmiPath

func StringToYgnmiPath(path string) (*gpb.Path, error)

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 SystemConfigMetaData

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

func SystemConfigMetaDataFromConfig

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

func TransceiverEmpty

func TransceiverEmpty(t *testing.T, d *ondatra.DUTDevice, port string) (bool, error)

TransceiverEmpty returns true if the transceiver status is 0, false if the status is 1

func TransceiverNumberForPort

func TransceiverNumberForPort(t *testing.T, dut *ondatra.DUTDevice, port string) (int, error)

TransceiverNumberForPort fetches the transceiver corresponding to the port.

func Uint16ListToString

func Uint16ListToString(a []uint16) string

Uint16ListToString returns comma separate string representation of list of uint16.

func UpdateLacpKey

func UpdateLacpKey(t *testing.T, dut *ondatra.DUTDevice, interfaceName string, val uint16)

func VerifyPortsOperStatus

func VerifyPortsOperStatus(t *testing.T, d *ondatra.DUTDevice, ports ...string) error

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.

func WaitForInterfaceState

func WaitForInterfaceState(t *testing.T, dut *ondatra.DUTDevice, intfName string, expectedOperSatus oc.E_Interface_OperStatus, timeout time.Duration) error

WaitForInterfaceState polls interface oper-status until it matches the expected oper-status.

func WrapError

func WrapError(err error, format string, args ...any) error

WrapError wraps a new error with new line or creates a new error if err == nil. It has been created because errors.Wrapf() returns nil if err == nil.

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.

func NewDUTInfo

func NewDUTInfo(t *testing.T, dut *ondatra.DUTDevice) DUTInfo

NewDUTInfo creates the DUTInfo structure for a given DUTDevice

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 (E_Interface_HealthIndicator) ΛMap

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 FPGAResetCause(t *testing.T, dut *ondatra.DUTDevice, f *FPGAInfo, index int) E_ResetCause_Cause

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

type GNMIConfig

type GNMIConfig interface {
	ConfigGet() ([]byte, error)
}

GNMIConfig provides an interface to implement config get.

type GNMIConfigDUT

type GNMIConfigDUT struct {
	DUT *ondatra.DUTDevice
}

GNMIConfigDUT contains the DUT for which the config get is being requested for.

type Interface_FullyQualifiedInterfaceNamePath

type Interface_FullyQualifiedInterfaceNamePath struct {
	*ygnmi.NodePath
	// contains filtered or unexported fields
}

type OperStatusInfo

type OperStatusInfo struct {
	Up      []string
	Down    []string
	Testing []string
	Invalid []string
}

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

type P4InfoDetails interface {
	P4Info() (*p4infopb.P4Info, error)
}

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

type PeerPorts struct {
	Host string
	Peer string
}

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

type RandomInterfaceParams struct {
	PortList   []string
	IsParent   bool
	OperDownOk bool
}

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

type System_ConfigMetaDataPath struct {
	*ygnmi.NodePath
	// contains filtered or unexported fields
}

System_ConfigMetaDataPath represents the /openconfig-system/system/state/config-meta-data YANG schema element.

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

func (t *System_ConfigMetaDataPath) ΛEnumTypeMap() map[string][]reflect.Type

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 SystemFeatureLabel(t *testing.T, dut *ondatra.DUTDevice, label uint32) *System_FeatureLabel

func SystemFeatureLabelFromConfig

func SystemFeatureLabelFromConfig(t *testing.T, dut *ondatra.DUTDevice, label uint32) *System_FeatureLabel

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

type System_FeatureLabelPath struct {
	*ygnmi.NodePath
}

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

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 TearDown

type TearDown interface {
	Teardown(t *testing.T)
}

TearDown provides an interface to implement the teardown routine.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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