11package gnmi_get_modes_test
22
33import (
4+ << << << < HEAD
45 "fmt"
6+ == == == =
7+ >> >> >> > [sdn_tests ]:Adding GNMI Get Modes test to pins_ondatra . (#12983 )
58 "context"
69 "encoding/json"
710 "strings"
811 "testing"
912
1013 "github.com/google/go-cmp/cmp"
14+ << << << < HEAD
1115 "github.com/google/go-cmp/cmp/cmpopts"
1216 "github.com/openconfig/gnmi/value"
1317 "github.com/openconfig/ondatra"
@@ -18,6 +22,14 @@ import (
1822 "google.golang.org/grpc"
1923 "google.golang.org/protobuf/testing/protocmp"
2024 "google.golang.org/protobuf/encoding/prototext"
25+ == == == =
26+ "github.com/openconfig/gnmi/value"
27+ "github.com/openconfig/ondatra"
28+ "github.com/openconfig/ygot/ygot"
29+ "github.com/sonic-net/sonic-mgmt/sdn_tests/pins_ondatra/infrastructure/binding/pinsbind"
30+ "github.com/sonic-net/sonic-mgmt/sdn_tests/pins_ondatra/infrastructure/testhelper/testhelper"
31+ "google.golang.org/grpc"
32+ >> >> >> > [sdn_tests ]:Adding GNMI Get Modes test to pins_ondatra. (#12983 )
2133
2234 gpb "github.com/openconfig/gnmi/proto/gnmi"
2335)
@@ -56,6 +68,7 @@ type getDataTypeTest struct {
5668 wantNotVal string
5769}
5870
71+ << << << < HEAD
5972func TestGNMIGetModes (t * testing.T ) {
6073 dut := ondatra .DUT (t , "DUT" )
6174 // Select a random front panel interface EthernetX.
@@ -366,6 +379,8 @@ func TestGNMIGetModes(t *testing.T) {
366379 }
367380}
368381
382+ == == == =
383+ >> >> >> > [sdn_tests ]:Adding GNMI Get Modes test to pins_ondatra . (#12983 )
369384// Helper function to create the Get Request.
370385func createGetRequest (dut * ondatra.DUTDevice , paths []* gpb.Path , dataType gpb.GetRequest_DataType ) * gpb.GetRequest {
371386 // Add Prefix information for the GetRequest.
@@ -461,6 +476,7 @@ func (c getDataTypeTest) dataTypeForLeafNonEmpty(t *testing.T) {
461476 }
462477}
463478
479+ << << << < HEAD
464480// Test for gNMI Get for Data Type for path when empty subtree is returned.
465481func (c getDataTypeTest ) dataTypeForPathEmpty (t * testing.T ) {
466482 t .Helper ()
@@ -1112,4 +1128,13 @@ func TestMissingTypeAssumesAll(t *testing.T) {
11121128 }
11131129 }
11141130 }
1131+ == == == =
1132+ func containsOneOfTheseSubstrings (haystack string , needles []string ) bool {
1133+ for i := range needles {
1134+ if strings .Contains (haystack , needles [i ]) {
1135+ return true
1136+ }
1137+ }
1138+ return false
1139+ >> >> >> > [sdn_tests ]:Adding GNMI Get Modes test to pins_ondatra . (#12983 )
11151140}
0 commit comments