Skip to content
Closed
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
8 changes: 7 additions & 1 deletion feature/gnmi/tests/gnmi_ni_test/gnmi_ni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ func ConfigureAdditionalNetworkInstance(batch *gnmi.SetBatch, t *testing.T, dut
// Get and validate states for default and custom networkinstances.
gnmiServerList := gnmi.GetAll(t, dut, gnmi.OC().System().GrpcServerAny().State())
for _, gnmiServer := range gnmiServerList {
if gnmiServer.GetName() == deviations.DefaultNetworkInstance(dut) {
if gnmiServer.GetName() == deviations.DefaultNetworkInstance(dut) && dut.Vendor() != ondatra.CISCO {
defaultInstanceState := gnmi.Get(t, dut, gnmi.OC().System().GrpcServer(deviations.DefaultNetworkInstance(dut)).State())
validateGnmiServerState(t, defaultInstanceState)
}

if gnmiServer.GetName() == deviations.GrpcDefaultServerName(dut) {
defaultInstanceState := gnmi.Get(t, dut, gnmi.OC().System().GrpcServer(deviations.GrpcDefaultServerName(dut)).State())
validateGnmiServerState(t, defaultInstanceState)
}

if gnmiServer.GetName() == customVRFName {
customInstanceState := gnmi.Get(t, dut, gnmi.OC().System().GrpcServer(customVRFName).State())
validateGnmiServerState(t, customInstanceState)
Expand Down
2 changes: 1 addition & 1 deletion feature/gnmi/tests/gnmi_ni_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ platform_exceptions: {
vendor: CISCO
}
deviations: {
interface_enabled: true
grpc_default_server_name: "gNXI-DEFAULT"
}
}
platform_exceptions: {
Expand Down
19 changes: 12 additions & 7 deletions internal/cfgplugins/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ import (

// CreateGNMIServer creates a gNMI server on the DUT on a given network-instance.
func CreateGNMIServer(batch *gnmi.SetBatch, t testing.TB, d *ondatra.DUTDevice, nip *NetworkInstanceParams) {
var ni string
var servername, ni string
if nip.Default {
ni = deviations.DefaultNetworkInstance(d)
if name := deviations.GrpcDefaultServerName(d); name != "" {
servername, ni = name, nip.Name
} else if name := deviations.DefaultNetworkInstance(d); name != "" {
servername, ni = name, name
}
} else {
ni = nip.Name
servername, ni = nip.Name, nip.Name
}
t.Logf("Creating gNMI server on network instance: %s", ni)
gnmiServerPath := gnmi.OC().System().GrpcServer(ni)

t.Logf("Creating gNMI server on network instance: %s", servername)
gnmiServerPath := gnmi.OC().System().GrpcServer(servername)
gnmi.BatchUpdate(batch, gnmiServerPath.Config(), &oc.System_GrpcServer{
Name: ygot.String(ni),
Name: ygot.String(servername),
Port: ygot.Uint16(9339),
Enable: ygot.Bool(true),
NetworkInstance: ygot.String(ni),
// Services: []oc.E_SystemGrpc_GRPC_SERVICE{oc.SystemGrpc_GRPC_SERVICE_GNMI},
Services: []oc.E_SystemGrpc_GRPC_SERVICE{oc.SystemGrpc_GRPC_SERVICE_GNMI, oc.SystemGrpc_GRPC_SERVICE_GNSI},
})
}

Expand Down
8 changes: 8 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@
return lookupDUTDeviations(dut).GetMplsExpIngressClassifierOcUnsupported()
}

// Devices that do not propagate IGP metric through redistribution

Check failure on line 1516 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function DefaultNoIgpMetricPropagation should be of the form "DefaultNoIgpMetricPropagation ..."
func DefaultNoIgpMetricPropagation(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetDefaultNoIgpMetricPropagation()
}
Expand Down Expand Up @@ -1543,7 +1543,7 @@
return lookupDUTDeviations(dut).GetMissingSystemDescriptionConfigPath()
}

// FEC uncorrectable errors accumulate over time and are not cleared unless the component is reset on target

Check failure on line 1546 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function NonIntervalFecErrorCounter should be of the form "NonIntervalFecErrorCounter ..."
func NonIntervalFecErrorCounter(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetNonIntervalFecErrorCounter()
}
Expand Down Expand Up @@ -1768,3 +1768,11 @@
func SyslogNonDefaultVrfUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSyslogNonDefaultVrfUnsupported()
}

// Set user provided default server name
func GrpcDefaultServerName(dut *ondatra.DUTDevice) string {
if grpcDefaultServerName := lookupDUTDeviations(dut).GetGrpcDefaultServerName(); grpcDefaultServerName != "" {
return grpcDefaultServerName
}
return "DEFAULT"
}
3 changes: 3 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,9 @@ message Metadata {
// Cisco: https://partnerissuetracker.corp.google.com/u/0/issues/459659437
bool syslog_non_default_vrf_unsupported = 351;

// Set user provided default server name
string grpc_default_server_name = 352;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300;
}
Expand Down
Loading
Loading