Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
cakhil45 committed Oct 30, 2024
1 parent 63a162a commit 9b9715c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 50 deletions.
21 changes: 21 additions & 0 deletions feature/system/tests/system_base_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,24 @@ used for mTLS.
2. Each test will then create a client to those services and valid each service is properly
listening on the standard port.
3. Validate client properly connects and execute a simple RPC to validate no errors are returned.

## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC
paths used for test setup are not listed here.

```yaml
rpcs:
gnmi:
gNMI.Set:
/system/config/motd-banner
/system/config/hostname
/system/clock/config/timezone-name
gNMI.Get:
/system/state/motd-banner
/system/state/hostname
/system/state/current-datetime
/system/state/boot-time
/system/clock/state/timezone-name
gNMI.Subscribe:
```
11 changes: 9 additions & 2 deletions feature/system/tests/system_base_test/g_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"testing"
"time"

"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/binding/introspect"
"google.golang.org/grpc"
Expand Down Expand Up @@ -58,8 +59,14 @@ func TestGNMIClient(t *testing.T) {
dut := ondatra.DUT(t, "dut")
conn := dialConn(t, dut, introspect.GNMI, 9339)
c := gpb.NewGNMIClient(conn)
if _, err := c.Get(context.Background(), &gpb.GetRequest{Encoding: gpb.Encoding_JSON_IETF, Path: []*gpb.Path{{Elem: []*gpb.PathElem{}}}}); err != nil {
t.Fatalf("gnmi.Get failed: %v", err)
if deviations.GnmiGetRequiresConfigType(dut) {
if _, err := c.Get(context.Background(), &gpb.GetRequest{Encoding: gpb.Encoding_JSON_IETF, Path: []*gpb.Path{{Elem: []*gpb.PathElem{}}}, Type: gpb.GetRequest_CONFIG}); err != nil {
t.Fatalf("gnmi.Get failed: %v", err)
}
} else {
if _, err := c.Get(context.Background(), &gpb.GetRequest{Encoding: gpb.Encoding_JSON_IETF, Path: []*gpb.Path{{Elem: []*gpb.PathElem{}}}}); err != nil {
t.Fatalf("gnmi.Get failed: %v", err)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions feature/system/tests/system_base_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ platform_exceptions: {
}
deviations: {
cli_takes_precedence_over_oc: true
gnmi_get_requires_config_type: true
}
}
4 changes: 4 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,7 @@ func OperationalModeUnsupported(dut *ondatra.DUTDevice) bool {
func BgpSessionStateIdleInPassiveMode(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpSessionStateIdleInPassiveMode()
}
// GnmiGetRequiresConfigType return true if Gnmi Get is not supported without type config
func GnmiGetRequiresConfigType(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetGnmiGetRequiresConfigType()
}
4 changes: 4 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ message Metadata {
// BGP session state idle is supported in passive mode instead of active
// Cisco: b/376021545
bool bgp_session_state_idle_in_passive_mode = 229;
// gnmi_get_requires_config_type is set to true for devices that require type to be specified as config
// in default it will be false
// Juniper: b/361547597
bool gnmi_get_requires_config_type = 230;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
Expand Down
111 changes: 63 additions & 48 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b9715c

Please sign in to comment.