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/nhawke/copybara/temp/folder-destination14402920588799571502/.
  • Loading branch information
GGN Engprod Team authored and nhawke committed Jun 13, 2024
1 parent e6726c8 commit c5b17ab
Show file tree
Hide file tree
Showing 15 changed files with 51,008 additions and 48,869 deletions.
6 changes: 6 additions & 0 deletions binding/abstract.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
credzpb "github.com/openconfig/gnsi/credentialz"
pathzpb "github.com/openconfig/gnsi/pathz"

gnpsipb "github.com/openconfig/gnpsi/proto/gnpsi"
grpb "github.com/openconfig/gribi/v1/proto/service"
opb "github.com/openconfig/ondatra/proto"
p4pb "github.com/p4lang/p4runtime/go/p4/v1"
Expand Down Expand Up @@ -117,6 +118,11 @@ func (*AbstractDUT) DialP4RT(context.Context, ...grpc.DialOption) (p4pb.P4Runtim
return nil, errors.New("DialP4RT unimplemented")
}

// DialGNPSI returns an unimplemented error.
func (*AbstractDUT) DialGNPSI(context.Context, ...grpc.DialOption) (gnpsipb.GNPSIClient, error) {
return nil, errors.New("DialGNPSI unimplemented")
}

func (*AbstractDUT) mustEmbedAbstractDUT() {}

var _ ATE = &AbstractATE{}
Expand Down
5 changes: 5 additions & 0 deletions binding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
attestzpb "github.com/openconfig/attestz/proto/tpm_attestz"
enrollzpb "github.com/openconfig/attestz/proto/tpm_enrollz"
gpb "github.com/openconfig/gnmi/proto/gnmi"
gnpsipb "github.com/openconfig/gnpsi/proto/gnpsi"
acctzpb "github.com/openconfig/gnsi/acctz"
authzpb "github.com/openconfig/gnsi/authz"
certzpb "github.com/openconfig/gnsi/certz"
Expand Down Expand Up @@ -155,6 +156,10 @@ type DUT interface {
// See the interface comment for proper handling of dial options.
DialP4RT(context.Context, ...grpc.DialOption) (p4pb.P4RuntimeClient, error)

// DialGNPSI creates a client connection to the DUT's gNPSI endpoint.
// See the interface comment for proper handling of dial options.
DialGNPSI(context.Context, ...grpc.DialOption) (gnpsipb.GNPSIClient, error)

mustEmbedAbstractDUT()
}

Expand Down
10 changes: 10 additions & 0 deletions fakebind/fakebind.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"google.golang.org/grpc"

gpb "github.com/openconfig/gnmi/proto/gnmi"
gnpsipb "github.com/openconfig/gnpsi/proto/gnpsi"
grpb "github.com/openconfig/gribi/v1/proto/service"
opb "github.com/openconfig/ondatra/proto"
p4pb "github.com/p4lang/p4runtime/go/p4/v1"
Expand Down Expand Up @@ -96,6 +97,7 @@ type DUT struct {
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)
DialGNPSIFn func(context.Context, ...grpc.DialOption) (gnpsipb.GNPSIClient, error)
}

// PushConfig delegates to d.PushConfigFn.
Expand Down Expand Up @@ -146,6 +148,14 @@ func (d *DUT) DialGNSI(ctx context.Context, opts ...grpc.DialOption) (binding.GN
return d.DialGNSIFn(ctx, opts...)
}

// DialGNPSI delegates to d.DialGNPSIFn.
func (d *DUT) DialGNPSI(ctx context.Context, opts ...grpc.DialOption) (gnpsipb.GNPSIClient, error) {
if d.DialGNPSIFn == nil {
log.FatalContext(ctx, "fakebind DialGNPSI called but DialGNPSIFn not set")
}
return d.DialGNPSIFn(ctx, opts...)
}

// DialGRIBI delegates to d.DialGRIBIFn.
func (d *DUT) DialGRIBI(ctx context.Context, opts ...grpc.DialOption) (grpb.GRIBIClient, error) {
if d.DialGRIBIFn == nil {
Expand Down
4 changes: 3 additions & 1 deletion gnmi/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

set -e

git clone https://github.com/openconfig/public.git
OC_VERSION="v4.2.0"

git clone https://github.com/openconfig/public.git --branch $OC_VERSION
wget https://raw.githubusercontent.com/openconfig/gnmi/master/metadata/yang/gnmi-collector-metadata.yang
git clone https://github.com/open-traffic-generator/models-yang.git

Expand Down
104 changes: 64 additions & 40 deletions gnmi/oc/networkinstance/networkinstance-0.go
Original file line number Diff line number Diff line change
Expand Up @@ -2190,12 +2190,16 @@ func (n *NetworkInstancePathAny) SegmentRouting() *NetworkInstance_SegmentRoutin
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
func (n *NetworkInstancePath) TableAny() *NetworkInstance_TablePathAny {
ps := &NetworkInstance_TablePathAny{
NodePath: ygnmi.NewNodePath(
Expand Down Expand Up @@ -2226,12 +2230,16 @@ func (n *NetworkInstancePath) TableAny() *NetworkInstance_TablePathAny {
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
func (n *NetworkInstancePathAny) TableAny() *NetworkInstance_TablePathAny {
ps := &NetworkInstance_TablePathAny{
NodePath: ygnmi.NewNodePath(
Expand Down Expand Up @@ -2276,15 +2284,19 @@ func (n *NetworkInstance_TablePathAny) WithAddressFamily(AddressFamily oc.E_Type
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Protocol: oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE
// AddressFamily: oc.E_Types_ADDRESS_FAMILY
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
//
// Protocol: oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE
// AddressFamily: oc.E_Types_ADDRESS_FAMILY
func (n *NetworkInstancePath) Table(Protocol oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily oc.E_Types_ADDRESS_FAMILY) *NetworkInstance_TablePath {
ps := &NetworkInstance_TablePath{
NodePath: ygnmi.NewNodePath(
Expand Down Expand Up @@ -2315,15 +2327,19 @@ func (n *NetworkInstancePath) Table(Protocol oc.E_PolicyTypes_INSTALL_PROTOCOL_T
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
//
// Protocol: oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE
// AddressFamily: oc.E_Types_ADDRESS_FAMILY
// Protocol: oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE
// AddressFamily: oc.E_Types_ADDRESS_FAMILY
func (n *NetworkInstancePathAny) Table(Protocol oc.E_PolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily oc.E_Types_ADDRESS_FAMILY) *NetworkInstance_TablePathAny {
ps := &NetworkInstance_TablePathAny{
NodePath: ygnmi.NewNodePath(
Expand Down Expand Up @@ -2354,12 +2370,16 @@ func (n *NetworkInstancePathAny) Table(Protocol oc.E_PolicyTypes_INSTALL_PROTOCO
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
func (n *NetworkInstancePath) TableMap() *NetworkInstance_TablePathMap {
ps := &NetworkInstance_TablePathMap{
NodePath: ygnmi.NewNodePath(
Expand Down Expand Up @@ -2390,12 +2410,16 @@ func (n *NetworkInstancePath) TableMap() *NetworkInstance_TablePathMap {
// address families enabled, the protocol=BGP,
// address-family=IPv4 table is created by the system. The
//
// removal of the table should not require additional or
// explicit configurations
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
// removal of the table should not require additional or
// explicit configurations.
//
// Users cannot create or delete tables. Instead a user may
// configure table-connections which reference these tables.
//
// Defining module: "openconfig-network-instance"
// Instantiating module: "openconfig-network-instance"
// Path from parent: "tables/table"
// Path from root: "/network-instances/network-instance/tables/table"
func (n *NetworkInstancePathAny) TableMap() *NetworkInstance_TablePathMapAny {
ps := &NetworkInstance_TablePathMapAny{
NodePath: ygnmi.NewNodePath(
Expand Down
Loading

0 comments on commit c5b17ab

Please sign in to comment.