Documentation ¶
Overview ¶
Package binding holds the Ondatra binding interface.
Index ¶
- type ATE
- type AbstractATE
- func (a *AbstractATE) CustomData() map[string]any
- func (*AbstractATE) DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error)
- func (*AbstractATE) DialIxNetwork(context.Context) (*IxNetwork, error)
- func (*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 (*AbstractDUT) DialCLI(context.Context) (StreamClient, error)
- func (*AbstractDUT) DialConsole(context.Context) (StreamClient, error)
- func (*AbstractDUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.GNMIClient, error)
- func (*AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error)
- func (*AbstractDUT) DialGNSI(context.Context, ...grpc.DialOption) (GNSIClients, error)
- func (*AbstractDUT) DialGRIBI(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error)
- func (*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 (*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 (*AbstractGNOIClients) BGP() bpb.BGPClient
- func (*AbstractGNOIClients) CertificateManagement() cpb.CertificateManagementClient
- func (*AbstractGNOIClients) Diag() dpb.DiagClient
- func (*AbstractGNOIClients) FactoryReset() frpb.FactoryResetClient
- func (*AbstractGNOIClients) File() fpb.FileClient
- func (*AbstractGNOIClients) Healthz() hpb.HealthzClient
- func (*AbstractGNOIClients) Layer2() lpb.Layer2Client
- func (*AbstractGNOIClients) LinkQualification() plqpb.LinkQualificationClient
- func (*AbstractGNOIClients) MPLS() mpb.MPLSClient
- func (*AbstractGNOIClients) OS() ospb.OSClient
- func (*AbstractGNOIClients) OTDR() otpb.OTDRClient
- func (*AbstractGNOIClients) System() spb.SystemClient
- func (*AbstractGNOIClients) WavelengthRouter() wpb.WavelengthRouterClient
- type AbstractGNSIClients
- func (*AbstractGNSIClients) AccountingPull() accpb.AccountingPullClient
- func (*AbstractGNSIClients) AccountingPush() accpb.AccountingPushClient
- func (*AbstractGNSIClients) Authz() authzpb.AuthzClient
- func (*AbstractGNSIClients) Certz() certzpb.CertzClient
- func (*AbstractGNSIClients) Credentialz() credzpb.CredentialzClient
- func (*AbstractGNSIClients) Pathz() pathzpb.PathzClient
- type AbstractStreamClient
- type Binding
- type DUT
- type Device
- type Dims
- type GNOIClients
- type GNSIClients
- 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 (*AbstractATE) DialGNMI(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error)
DialGNMI returns an unimplemented error.
func (*AbstractATE) DialIxNetwork ¶
func (*AbstractATE) DialIxNetwork(context.Context) (*IxNetwork, error)
DialIxNetwork returns an unimplemented error.
func (*AbstractATE) DialOTG ¶
func (*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 (*AbstractDUT) DialCLI(context.Context) (StreamClient, error)
DialCLI returns an unimplemented error.
func (*AbstractDUT) DialConsole ¶
func (*AbstractDUT) DialConsole(context.Context) (StreamClient, error)
DialConsole returns an unimplemented error.
func (*AbstractDUT) DialGNMI ¶
func (*AbstractDUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.GNMIClient, error)
DialGNMI returns an unimplemented error.
func (*AbstractDUT) DialGNOI ¶
func (*AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error)
DialGNOI returns an unimplemented error.
func (*AbstractDUT) DialGNSI ¶ added in v0.2.1
func (*AbstractDUT) DialGNSI(context.Context, ...grpc.DialOption) (GNSIClients, error)
DialGNSI returns an unimplemented error.
func (*AbstractDUT) DialGRIBI ¶
func (*AbstractDUT) DialGRIBI(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error)
DialGRIBI returns an unimplemented error.
func (*AbstractDUT) DialP4RT ¶
func (*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 (*AbstractGNOIClients) BGP() bpb.BGPClient
BGP logs a fatal unimplemented error.
func (*AbstractGNOIClients) CertificateManagement ¶
func (*AbstractGNOIClients) CertificateManagement() cpb.CertificateManagementClient
CertificateManagement logs a fatal unimplemented error.
func (*AbstractGNOIClients) Diag ¶
func (*AbstractGNOIClients) Diag() dpb.DiagClient
Diag logs a fatal unimplemented error.
func (*AbstractGNOIClients) FactoryReset ¶
func (*AbstractGNOIClients) FactoryReset() frpb.FactoryResetClient
FactoryReset logs a fatal unimplemented error.
func (*AbstractGNOIClients) File ¶
func (*AbstractGNOIClients) File() fpb.FileClient
File logs a fatal unimplemented error.
func (*AbstractGNOIClients) Healthz ¶
func (*AbstractGNOIClients) Healthz() hpb.HealthzClient
Healthz logs a fatal unimplemented error.
func (*AbstractGNOIClients) Layer2 ¶
func (*AbstractGNOIClients) Layer2() lpb.Layer2Client
Layer2 logs a fatal unimplemented error.
func (*AbstractGNOIClients) LinkQualification ¶
func (*AbstractGNOIClients) LinkQualification() plqpb.LinkQualificationClient
LinkQualification logs a fatal unimplemented error.
func (*AbstractGNOIClients) MPLS ¶
func (*AbstractGNOIClients) MPLS() mpb.MPLSClient
MPLS logs a fatal unimplemented error.
func (*AbstractGNOIClients) OS ¶
func (*AbstractGNOIClients) OS() ospb.OSClient
OS logs a fatal unimplemented error.
func (*AbstractGNOIClients) OTDR ¶
func (*AbstractGNOIClients) OTDR() otpb.OTDRClient
OTDR logs a fatal unimplemented error.
func (*AbstractGNOIClients) System ¶
func (*AbstractGNOIClients) System() spb.SystemClient
System logs a fatal unimplemented error.
func (*AbstractGNOIClients) WavelengthRouter ¶
func (*AbstractGNOIClients) WavelengthRouter() wpb.WavelengthRouterClient
WavelengthRouter logs a fatal unimplemented error.
type AbstractGNSIClients ¶ added in v0.2.1
type AbstractGNSIClients struct{}
AbstractGNSIClients is implementation support for the GNSIClients interface.
func (*AbstractGNSIClients) AccountingPull ¶ added in v0.2.1
func (*AbstractGNSIClients) AccountingPull() accpb.AccountingPullClient
AccountingPull logs a fatal unimplemented error.
func (*AbstractGNSIClients) AccountingPush ¶ added in v0.2.1
func (*AbstractGNSIClients) AccountingPush() accpb.AccountingPushClient
AccountingPush logs a fatal unimplemented error.
func (*AbstractGNSIClients) Authz ¶ added in v0.2.1
func (*AbstractGNSIClients) Authz() authzpb.AuthzClient
Authz logs a fatal unimplemented error.
func (*AbstractGNSIClients) Certz ¶ added in v0.2.1
func (*AbstractGNSIClients) Certz() certzpb.CertzClient
Certz logs a fatal unimplemented error.
func (*AbstractGNSIClients) Credentialz ¶ added in v0.2.1
func (*AbstractGNSIClients) Credentialz() credzpb.CredentialzClient
Credentialz logs a fatal unimplemented error.
func (*AbstractGNSIClients) Pathz ¶ added in v0.2.1
func (*AbstractGNSIClients) Pathz() pathzpb.PathzClient
Pathz logs a fatal unimplemented error.
type AbstractStreamClient ¶
type AbstractStreamClient struct{}
AbstractStreamClient is implementation support for the StreamClient interface.
func (*AbstractStreamClient) Close ¶
func (*AbstractStreamClient) Close() error
Close returns an unimplemented error.
func (*AbstractStreamClient) SendCommand ¶
SendCommand returns an unimplemented error.
func (*AbstractStreamClient) Stderr ¶
func (*AbstractStreamClient) Stderr() io.ReadCloser
Stderr logs a fatal unimplemented error.
func (*AbstractStreamClient) Stdin ¶
func (*AbstractStreamClient) Stdin() io.WriteCloser
Stdin logs a fatal unimplemented error.
func (*AbstractStreamClient) Stdout ¶
func (*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) // DialGNSI creates a client connection to the DUT's gNSI endpoint. // Implementations must append transport security options necessary to reach the server. DialGNSI(context.Context, ...grpc.DialOption) (GNSIClients, 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 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 GNSIClients ¶ added in v0.2.1
type GNSIClients interface { Authz() authzpb.AuthzClient Pathz() pathzpb.PathzClient Certz() certzpb.CertzClient Credentialz() credzpb.CredentialzClient AccountingPull() accpb.AccountingPullClient AccountingPush() accpb.AccountingPushClient // contains filtered or unexported methods }
GNSIClients stores APIs to GNSI services. All implementations of this interface must embed AbstractGNSIClients.
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. |