otgvalidationhelpers

package
v0.0.0-...-1d3aa0f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package otgvalidationhelpers provides helper functions to validate OTG attributes for OTG tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowParams

type FlowParams struct {
	Name         string
	TolerancePct float32
}

FlowParams is a struct to hold OTG flow parameters.

type InterfaceParams

type InterfaceParams struct {
	Names []string
	Ports []string
}

InterfaceParams is a struct to hold OTG interface parameters.

type OTGValidation

type OTGValidation struct {
	Interface *InterfaceParams
	Flow      *FlowParams
}

OTGValidation is a struct to hold OTG validation parameters.

params := &OTGValidation{
	Interface: 	&InterfaceParams{Names: []string{"Interface1", "Interface2"}, Ports: []string{"Port1", "Port2"}},
	Flow:       &FlowParams{Name: "flow1", TolerancePct: 0.5},
}

	if err := params.ValidatePortIsActive(t, ate); err != nil {
		t.Errorf("ValidatePortIsActive(): got err: %q, want nil", err)
	}
	if err := params.IsIPv4Interfaceresolved(t, ate); err != nil {
		t.Errorf("IsIPv4Interfaceresolved(): got err: %q, want nil", err)
	}
	if err := params.ValidateLossOnFlows(t, ate); err != nil {
		t.Errorf("ValidateLossOnFlows(): got err: %q, want nil", err)
	}

func (*OTGValidation) IsIPv4Interfaceresolved

func (v *OTGValidation) IsIPv4Interfaceresolved(t *testing.T, ate *ondatra.ATEDevice) error

IsIPv4Interfaceresolved validates that the IPv4 interface is resolved based on the interface configured using otgconfighelpers.

func (*OTGValidation) IsIPv6Interfaceresolved

func (v *OTGValidation) IsIPv6Interfaceresolved(t *testing.T, ate *ondatra.ATEDevice) error

IsIPv6Interfaceresolved validates that the IPv6 interface is resolved based on the interface configured using otgconfighelpers.

func (*OTGValidation) ValidateLossOnFlows

func (v *OTGValidation) ValidateLossOnFlows(t *testing.T, ate *ondatra.ATEDevice) error

ValidateLossOnFlows validates the percentage of traffic loss on the flows.

func (*OTGValidation) ValidatePortIsActive

func (v *OTGValidation) ValidatePortIsActive(t *testing.T, ate *ondatra.ATEDevice) error

ValidatePortIsActive validates the OTG port status.

Jump to

Keyboard shortcuts

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