Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
FolderOrigin-RevId: /usr/local/google/home/gdennis/copybara/temp/folder-destination17516511173282992841/.
  • Loading branch information
GGN Engprod Team authored and greg-dennis committed Oct 25, 2023
1 parent e1005a2 commit 3233494
Show file tree
Hide file tree
Showing 56 changed files with 60,455 additions and 47,753 deletions.
7 changes: 3 additions & 4 deletions binding/abstract.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

log "github.com/golang/glog"
"github.com/open-traffic-generator/snappi/gosnappi"
"github.com/openconfig/gnoigo"
"google.golang.org/grpc"

gpb "github.com/openconfig/gnmi/proto/gnmi"
Expand Down Expand Up @@ -108,7 +109,7 @@ func (*AbstractDUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.
}

// DialGNOI returns an unimplemented error.
func (*AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error) {
func (*AbstractDUT) DialGNOI(context.Context, ...grpc.DialOption) (gnoigo.Clients, error) {
return nil, errors.New("DialGNOI unimplemented")
}

Expand Down Expand Up @@ -183,7 +184,7 @@ func (*AbstractATE) DialOTG(context.Context, ...grpc.DialOption) (gosnappi.Gosna

func (*AbstractATE) mustEmbedAbstractATE() {}

var _ GNOIClients = &AbstractGNOIClients{}
var _ gnoigo.Clients = &AbstractGNOIClients{}

// AbstractGNOIClients is implementation support for the GNOIClients interface.
type AbstractGNOIClients struct{}
Expand Down Expand Up @@ -266,8 +267,6 @@ func (*AbstractGNOIClients) WavelengthRouter() wpb.WavelengthRouterClient {
return nil
}

func (g *AbstractGNOIClients) mustEmbedAbstractGNOIClients() {}

var _ GNSIClients = &AbstractGNSIClients{}

// AbstractGNSIClients is implementation support for the GNSIClients interface.
Expand Down
35 changes: 4 additions & 31 deletions binding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ import (
"golang.org/x/net/context"

"github.com/open-traffic-generator/snappi/gosnappi"
"github.com/openconfig/gnoigo"
"github.com/openconfig/ondatra/binding/ixweb"
"google.golang.org/grpc"

gpb "github.com/openconfig/gnmi/proto/gnmi"
bpb "github.com/openconfig/gnoi/bgp"
cpb "github.com/openconfig/gnoi/cert"
dpb "github.com/openconfig/gnoi/diag"
frpb "github.com/openconfig/gnoi/factory_reset"
fpb "github.com/openconfig/gnoi/file"
hpb "github.com/openconfig/gnoi/healthz"
lpb "github.com/openconfig/gnoi/layer2"
mpb "github.com/openconfig/gnoi/mpls"
ospb "github.com/openconfig/gnoi/os"
otpb "github.com/openconfig/gnoi/otdr"
plqpb "github.com/openconfig/gnoi/packet_link_qualification"
spb "github.com/openconfig/gnoi/system"
wpb "github.com/openconfig/gnoi/wavelength_router"
acctzpb "github.com/openconfig/gnsi/acctz"
authzpb "github.com/openconfig/gnsi/authz"
certzpb "github.com/openconfig/gnsi/certz"
Expand Down Expand Up @@ -151,7 +139,7 @@ type DUT interface {

// DialGNOI creates a client connection to the DUT's gNOI endpoint.
// See the interface comment for proper handling of dial options.
DialGNOI(context.Context, ...grpc.DialOption) (GNOIClients, error)
DialGNOI(context.Context, ...grpc.DialOption) (gnoigo.Clients, error)

// DialGNSI creates a client connection to the DUT's gNSI endpoint.
// See the interface comment for proper handling of dial options.
Expand Down Expand Up @@ -221,23 +209,8 @@ type IxNetwork struct {
}

// GNOIClients stores APIs to GNOI services.
// All implementations of this interface must embed AbstractGNOIClients.
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
mustEmbedAbstractGNOIClients()
}
// Deprecated: Use gnoigo.Clients instead.
type GNOIClients = gnoigo.Clients

// GNSIClients stores APIs to GNSI services.
// All implementations of this interface must embed AbstractGNSIClients.
Expand Down
2 changes: 1 addition & 1 deletion device.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (v Vendor) String() string {

// GNMIOpts returns a new set of options to customize gNMI queries.
func (d *Device) GNMIOpts() *gnmi.Opts {
useGetForCfg := d.Vendor() == CISCO || d.Vendor() == JUNIPER
useGetForCfg := d.Vendor() == CISCO || d.Vendor() == JUNIPER || d.Vendor() == NOKIA
return gnmi.NewOpts(d.Name(), useGetForCfg, d.clientFn)
}

Expand Down
6 changes: 0 additions & 6 deletions dut.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/openconfig/ondatra/binding"
"github.com/openconfig/ondatra/config"
"github.com/openconfig/ondatra/console"
"github.com/openconfig/ondatra/operations"
"github.com/openconfig/ondatra/raw"
)

Expand Down Expand Up @@ -49,11 +48,6 @@ func (d *DUTDevice) Console() *console.Console {
return console.New(d.res.(binding.DUT))
}

// Operations returns a handle to the DUT operations API.
func (d *DUTDevice) Operations() *operations.Operations {
return operations.New(d.res.(binding.DUT))
}

// RawAPIs returns a handle to raw protocol APIs on the DUT.
func (d *DUTDevice) RawAPIs() *raw.DUTAPIs {
return raw.NewDUTAPIs(d.res.(binding.DUT))
Expand Down
5 changes: 3 additions & 2 deletions fakebind/fakebind.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

log "github.com/golang/glog"
"github.com/open-traffic-generator/snappi/gosnappi"
"github.com/openconfig/gnoigo"
"github.com/openconfig/ondatra/binding"
"github.com/openconfig/ondatra/internal/testbed"
"google.golang.org/grpc"
Expand Down Expand Up @@ -91,7 +92,7 @@ type DUT struct {
DialCLIFn func(context.Context) (binding.CLIClient, error)
DialConsoleFn func(context.Context) (binding.ConsoleClient, error)
DialGNMIFn func(context.Context, ...grpc.DialOption) (gpb.GNMIClient, error)
DialGNOIFn func(context.Context, ...grpc.DialOption) (binding.GNOIClients, error)
DialGNOIFn func(context.Context, ...grpc.DialOption) (gnoigo.Clients, error)
DialGNSIFn func(context.Context, ...grpc.DialOption) (binding.GNSIClients, error)
DialGRIBIFn func(context.Context, ...grpc.DialOption) (grpb.GRIBIClient, error)
DialP4RTFn func(context.Context, ...grpc.DialOption) (p4pb.P4RuntimeClient, error)
Expand Down Expand Up @@ -130,7 +131,7 @@ func (d *DUT) DialGNMI(ctx context.Context, opts ...grpc.DialOption) (gpb.GNMICl
}

// DialGNOI delegates to d.DialGNOIFn.
func (d *DUT) DialGNOI(ctx context.Context, opts ...grpc.DialOption) (binding.GNOIClients, error) {
func (d *DUT) DialGNOI(ctx context.Context, opts ...grpc.DialOption) (gnoigo.Clients, error) {
if d.DialGNOIFn == nil {
log.Fatal("fakebind DialGNOI called but DialGNOIFn not set")
}
Expand Down
Loading

0 comments on commit 3233494

Please sign in to comment.