Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System-1: System testing : Added Deviation #3667

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
```
12 changes: 10 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,15 @@ 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
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1258,3 +1258,8 @@ func IsisDisSysidUnsupported(dut *ondatra.DUTDevice) bool {
func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIsisDatabaseOverloadsUnsupported()
}

// 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 @@ -664,6 +664,10 @@ message Metadata {
bool isis_dis_sysid_unsupported = 239;
// Cisco: b/378616912
bool isis_database_overloads_unsupported = 240;
// 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 = 241;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
112 changes: 64 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.

Loading