Documentation ¶
Overview ¶
Package binding holds the Ondatra binding interface.
Index ¶
- type ATE
- type AbstractATE
- func (a *AbstractATE) CustomData() map[string]any
- func (a *AbstractATE) DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error)
- func (a *AbstractATE) DialIxNetwork(context.Context) (*IxNetwork, error)
- func (a *AbstractATE) DialOTG(context.Context, ...grpc.DialOption) (gosnappi.GosnappiApi, error)
- func (a *AbstractATE) HardwareModel() string
- func (a *AbstractATE) Name() string
- func (a *AbstractATE) Ports() map[string]*Port
- func (a *AbstractATE) SoftwareVersion() string
- func (a *AbstractATE) String() string
- func (a *AbstractATE) Vendor() opb.Device_Vendor
- type AbstractDUT
- func (d *AbstractDUT) CustomData() map[string]any
- func (d *AbstractDUT) DialCLI(context.Context) (StreamClient, error)
- func (d *AbstractDUT) DialConsole(context.Context) (StreamClient, error)
- func (d *AbstractDUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.GNMIClient, error)
- func (d *AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error)
- func (d *AbstractDUT) DialGRIBI(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error)
- func (d *AbstractDUT) DialP4RT(context.Context, ...grpc.DialOption) (p4pb.P4RuntimeClient, error)
- func (d *AbstractDUT) HardwareModel() string
- func (d *AbstractDUT) Name() string
- func (d *AbstractDUT) Ports() map[string]*Port
- func (d *AbstractDUT) PushConfig(ctx context.Context, config string, reset bool) error
- func (d *AbstractDUT) SoftwareVersion() string
- func (d *AbstractDUT) String() string
- func (d *AbstractDUT) Vendor() opb.Device_Vendor
- type AbstractGNOIClients
- func (g *AbstractGNOIClients) BGP() bpb.BGPClient
- func (g *AbstractGNOIClients) CertificateManagement() cpb.CertificateManagementClient
- func (g *AbstractGNOIClients) Diag() dpb.DiagClient
- func (g *AbstractGNOIClients) FactoryReset() frpb.FactoryResetClient
- func (g *AbstractGNOIClients) File() fpb.FileClient
- func (g *AbstractGNOIClients) Healthz() hpb.HealthzClient
- func (g *AbstractGNOIClients) Interface() ipb.InterfaceClient
- func (g *AbstractGNOIClients) Layer2() lpb.Layer2Client
- func (g *AbstractGNOIClients) LinkQualification() plqpb.LinkQualificationClient
- func (g *AbstractGNOIClients) MPLS() mpb.MPLSClient
- func (g *AbstractGNOIClients) OS() ospb.OSClient
- func (g *AbstractGNOIClients) OTDR() otpb.OTDRClient
- func (g *AbstractGNOIClients) System() spb.SystemClient
- func (g *AbstractGNOIClients) WavelengthRouter() wpb.WavelengthRouterClient
- type AbstractStreamClient
- type Binding
- type DUT
- type Device
- type Dims
- type GNOIClients
- type IxNetwork
- type Port
- type Reservation
- type StreamClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ATE ¶
type ATE interface { Device // DialIxNetwork creates a client connection to the ATE's IxNetwork endpoint. DialIxNetwork(context.Context) (*IxNetwork, error) // DialGNMI creates a client connection to the ATE's gNMI endpoint. // Implementations must append transport security options necessary to reach the server. // This method must be implemented to receive gNMI from OTG but not from IxNetwork; // Implementing DialIxNetwork is sufficient for gNMI support for IxNetwork. DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error) // DialOTG creates a client connection to the ATE's OTG endpoint. // Implementations must append transport security options necessary to reach the server. DialOTG(context.Context, ...grpc.DialOption) (gosnappi.GosnappiApi, error) // contains filtered or unexported methods }
ATE is a reserved ATE. All implementations of this interface must embed AbstractATE.
type AbstractATE ¶
type AbstractATE struct {
Dims *Dims
}
AbstractATE is implementation support for the ATE interface. All implementations of the ATE interface must embed this type.
func (*AbstractATE) CustomData ¶ added in v0.1.1
func (a *AbstractATE) CustomData() map[string]any
CustomData returns custom data for the ATE.
func (*AbstractATE) DialGNMI ¶
func (a *AbstractATE) DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error)
DialGNMI returns an unimplemented error.
func (*AbstractATE) DialIxNetwork ¶
func (a *AbstractATE) DialIxNetwork(context.Context) (*IxNetwork, error)
DialIxNetwork returns an unimplemented error.
func (*AbstractATE) DialOTG ¶
func (a *AbstractATE) DialOTG(context.Context, ...grpc.DialOption) (gosnappi.GosnappiApi, error)
DialOTG returns an unimplemented error.
func (*AbstractATE) HardwareModel ¶
func (a *AbstractATE) HardwareModel() string
HardwareModel returns the hardware model of the ATE.
func (*AbstractATE) Ports ¶
func (a *AbstractATE) Ports() map[string]*Port
Ports returns the reserved ports on the ATE.
func (*AbstractATE) SoftwareVersion ¶
func (a *AbstractATE) SoftwareVersion() string
SoftwareVersion returns the software version of the ATE.
func (*AbstractATE) String ¶
func (a *AbstractATE) String() string
func (*AbstractATE) Vendor ¶
func (a *AbstractATE) Vendor() opb.Device_Vendor
Vendor returns the vendor of the ATE.
type AbstractDUT ¶
type AbstractDUT struct {
*Dims
}
AbstractDUT is a reserved DUT. All implementations of the DUT interface must embed this type.
func (*AbstractDUT) CustomData ¶ added in v0.1.1
func (d *AbstractDUT) CustomData() map[string]any
CustomData returns custom data for the DUT.
func (*AbstractDUT) DialCLI ¶
func (d *AbstractDUT) DialCLI(context.Context) (StreamClient, error)
DialCLI returns an unimplemented error.
func (*AbstractDUT) DialConsole ¶
func (d *AbstractDUT) DialConsole(context.Context) (StreamClient, error)
DialConsole returns an unimplemented error.
func (*AbstractDUT) DialGNMI ¶
func (d *AbstractDUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.GNMIClient, error)
DialGNMI returns an unimplemented error.
func (*AbstractDUT) DialGNOI ¶
func (d *AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error)
DialGNOI returns an unimplemented error.
func (*AbstractDUT) DialGRIBI ¶
func (d *AbstractDUT) DialGRIBI(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error)
DialGRIBI returns an unimplemented error.
func (*AbstractDUT) DialP4RT ¶
func (d *AbstractDUT) DialP4RT(context.Context, ...grpc.DialOption) (p4pb.P4RuntimeClient, error)
DialP4RT returns an unimplemented error.
func (*AbstractDUT) HardwareModel ¶
func (d *AbstractDUT) HardwareModel() string
HardwareModel returns the hardware model of the DUT.
func (*AbstractDUT) Ports ¶
func (d *AbstractDUT) Ports() map[string]*Port
Ports returns the reserved ports on the DUT.
func (*AbstractDUT) PushConfig ¶
PushConfig returns an unimplemented error.
func (*AbstractDUT) SoftwareVersion ¶
func (d *AbstractDUT) SoftwareVersion() string
SoftwareVersion returns the software version of the DUT.
func (*AbstractDUT) String ¶
func (d *AbstractDUT) String() string
func (*AbstractDUT) Vendor ¶
func (d *AbstractDUT) Vendor() opb.Device_Vendor
Vendor returns the vendor of the DUT.
type AbstractGNOIClients ¶
type AbstractGNOIClients struct{}
AbstractGNOIClients is implementation support for the GNOIClients interface.
func (*AbstractGNOIClients) BGP ¶
func (g *AbstractGNOIClients) BGP() bpb.BGPClient
BGP logs a fatal unimplemented error.
func (*AbstractGNOIClients) CertificateManagement ¶
func (g *AbstractGNOIClients) CertificateManagement() cpb.CertificateManagementClient
CertificateManagement logs a fatal unimplemented error.
func (*AbstractGNOIClients) Diag ¶
func (g *AbstractGNOIClients) Diag() dpb.DiagClient
Diag logs a fatal unimplemented error.
func (*AbstractGNOIClients) FactoryReset ¶
func (g *AbstractGNOIClients) FactoryReset() frpb.FactoryResetClient
FactoryReset logs a fatal unimplemented error.
func (*AbstractGNOIClients) File ¶
func (g *AbstractGNOIClients) File() fpb.FileClient
File logs a fatal unimplemented error.
func (*AbstractGNOIClients) Healthz ¶
func (g *AbstractGNOIClients) Healthz() hpb.HealthzClient
Healthz logs a fatal unimplemented error.
func (*AbstractGNOIClients) Interface ¶
func (g *AbstractGNOIClients) Interface() ipb.InterfaceClient
Interface logs a fatal unimplemented error.
func (*AbstractGNOIClients) Layer2 ¶
func (g *AbstractGNOIClients) Layer2() lpb.Layer2Client
Layer2 logs a fatal unimplemented error.
func (*AbstractGNOIClients) LinkQualification ¶
func (g *AbstractGNOIClients) LinkQualification() plqpb.LinkQualificationClient
LinkQualification logs a fatal unimplemented error.
func (*AbstractGNOIClients) MPLS ¶
func (g *AbstractGNOIClients) MPLS() mpb.MPLSClient
MPLS logs a fatal unimplemented error.
func (*AbstractGNOIClients) OS ¶
func (g *AbstractGNOIClients) OS() ospb.OSClient
OS logs a fatal unimplemented error.
func (*AbstractGNOIClients) OTDR ¶
func (g *AbstractGNOIClients) OTDR() otpb.OTDRClient
OTDR logs a fatal unimplemented error.
func (*AbstractGNOIClients) System ¶
func (g *AbstractGNOIClients) System() spb.SystemClient
System logs a fatal unimplemented error.
func (*AbstractGNOIClients) WavelengthRouter ¶
func (g *AbstractGNOIClients) WavelengthRouter() wpb.WavelengthRouterClient
WavelengthRouter logs a fatal unimplemented error.
type AbstractStreamClient ¶
type AbstractStreamClient struct{}
AbstractStreamClient is implementation support for the StreamClient interface.
func (*AbstractStreamClient) Close ¶
func (s *AbstractStreamClient) Close() error
Close returns an unimplemented error.
func (*AbstractStreamClient) SendCommand ¶
SendCommand returns an unimplemented error.
func (*AbstractStreamClient) Stderr ¶
func (s *AbstractStreamClient) Stderr() io.ReadCloser
Stderr logs a fatal unimplemented error.
func (*AbstractStreamClient) Stdin ¶
func (s *AbstractStreamClient) Stdin() io.WriteCloser
Stdin logs a fatal unimplemented error.
func (*AbstractStreamClient) Stdout ¶
func (s *AbstractStreamClient) Stdout() io.ReadCloser
Stdout logs a fatal unimplemented error.
type Binding ¶
type Binding interface { // Reserve reserves resources matching the criteria in the specified testbed. // The framework has already verified that the testbed is valid, and will // validate that the returned reservation matches the testbed criteria. // // The testbed resources must be reserved for the specified runTime, or // until Release is called. A runTime of zero means the caller requested an // unlimited runTime. The implementation is free to impose a maximum limit on // the runTime and return an error if it exceeds that limit. The framework has // already checked that the runTime is not negative. // // This method may block for up to the specified waitTime for all testbed // resources to become available. Given a zero waitTime, the implementation // must choose a reasonable duration. The framework has already checked that // the waitTime is not negative. // // The 'partial' map gives a partial mapping of device and port IDs in the // testbed to concrete names to constrain the topology that is reserved. // // Devices in the returned reservation should be initialiazed with a fixed // base configuration. Implementations are encouraged to make this base // configuration "minimal," meaning a configuration that ensures the device // is reachable and capable of being configured further, but little else, // so that tests make as few assumptions about the devices as possible. Reserve(ctx context.Context, tb *opb.Testbed, runTime, waitTime time.Duration, partial map[string]string) (*Reservation, error) // Release releases the reserved testbed. // It is not called if the reservation was fetched. Release(ctx context.Context) error // FetchReservation looks up and returns the pre-existing reservation with // the specified ID. FetchReservation(ctx context.Context, id string) (*Reservation, error) }
Binding is a strategy interface for Ondatra vendor implementations.
The framework enforces that at most testbed is reserved at a time, so implementations can assume that these methods are never called out of order, e.g. Release() is never be called without a prior Reserve().
type DUT ¶
type DUT interface { Device // PushConfig adds config to the device. If reset is true, the device // is reset to its base config before the specified config is added. // The following Go template functions are allowed in config: // - {{ port "<portID>" }}: replaced with the physical port name // - {{ secrets "<arg1>" "<arg2>" }}: left untouched, returned as-is PushConfig(ctx context.Context, config string, reset bool) error // DialCLI creates a client connection to the DUT's CLI endpoint. DialCLI(context.Context) (StreamClient, error) // DialConsole creates a client connection to the DUT's Console endpoint. DialConsole(context.Context) (StreamClient, error) // DialGNMI creates a client connection to the DUT's gNMI endpoint. // Implementations must append transport security options necessary to reach the server. DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error) // DialGNOI creates a client connection to the DUT's gNOI endpoint. // Implementations must append transport security options necessary to reach the server. DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error) // DialGRIBI creates a client connection to the DUT's gRIBI endpoint. // Implementations must append transport security options necessary to reach the server. DialGRIBI(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error) // DialP4RT creates a client connection to the DUT's P4RT endpoint. // Implementations must append transport security options necessary to reach the server. DialP4RT(context.Context, ...grpc.DialOption) (p4pb.P4RuntimeClient, error) // contains filtered or unexported methods }
DUT is a reserved DUT. All implementations of this interface must embed AbstractDUT.
type Device ¶
type Device interface { Name() string Vendor() opb.Device_Vendor HardwareModel() string SoftwareVersion() string Ports() map[string]*Port CustomData() map[string]any }
Device is a reserved DUT or ATE.
type Dims ¶
type Dims struct { Name string Vendor opb.Device_Vendor HardwareModel string SoftwareVersion string Ports map[string]*Port CustomData map[string]any }
Dims contains the dimensions of reserved DUT or ATE.
type GNOIClients ¶
type GNOIClients interface { BGP() bpb.BGPClient CertificateManagement() cpb.CertificateManagementClient Diag() dpb.DiagClient FactoryReset() frpb.FactoryResetClient File() fpb.FileClient Healthz() hpb.HealthzClient Interface() ipb.InterfaceClient Layer2() lpb.Layer2Client LinkQualification() plqpb.LinkQualificationClient MPLS() mpb.MPLSClient OS() ospb.OSClient OTDR() otpb.OTDRClient System() spb.SystemClient WavelengthRouter() wpb.WavelengthRouterClient // contains filtered or unexported methods }
GNOIClients stores APIs to GNOI services. All implementations of this interface must embed AbstractGNOIClients.
type IxNetwork ¶
type IxNetwork struct { // Session is an IxNetwork session for an ATE. Session *ixweb.Session // ChassisHost is an optional hostname or IP address to use when assigning // Ixia VPorts. If empty, defaults to the name of the reserved ATE. ChassisHost string // SyslogHost is an optional hostname or IP address to which IxNetwork should // stream logs. If empty, syslog streaming is not enabled. SyslogHost string }
IxNetwork provides information for an IxNetwork session.
type Reservation ¶
Reservation holds the reserved DUTs and ATEs as an id map.
type StreamClient ¶
type StreamClient interface { // SendCommand always expects a clean "prompt" on the underlying // device. If the device is interleaving Stdin writes with SendCommand // the underlying channel must be at a clean prompt to allow SendCommand // to complete the operation. Additionaly, the result buffer will be fully // consumed by SendCommand, ensuring it leaves a clean prompt behind. SendCommand(context.Context, string) (string, error) Stdin() io.WriteCloser Stdout() io.ReadCloser Stderr() io.ReadCloser Close() error // contains filtered or unexported methods }
StreamClient provides the interface for streaming IO to DUT. All implementations of this interface must embed AbstractStreamClient.
Directories ¶
Path | Synopsis |
---|---|
Package grpcutil contains gRPC utilities useful to binding implementations.
|
Package grpcutil contains gRPC utilities useful to binding implementations. |
testservice
Package testservice provides an interface for testing with the Test service.
|
Package testservice provides an interface for testing with the Test service. |
Package ixweb provides a connection to the Ixia Web Platform.
|
Package ixweb provides a connection to the Ixia Web Platform. |
Package portgraph searches for a graph that satisfies a set of constraints.
|
Package portgraph searches for a graph that satisfies a set of constraints. |