Skip to content

Commit

Permalink
Update gNMI-1.4 with state/model-name. (openconfig#3051)
Browse files Browse the repository at this point in the history
* add model-name to README and code to gnmi-1.4
  • Loading branch information
SydneyCaulfeild authored Jun 10, 2024
1 parent 1146867 commit bfba0f7
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 80 deletions.
84 changes: 57 additions & 27 deletions feature/platform/tests/telemetry_inventory_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,60 @@ card, power supply, disk, flash, NPU, transceiver, fabric card), validate:

* TODO: /components/component/linecard/config

## Telemetry Parameter coverage

* /components/component[name=<heatsink-temperature-sensor>]/state/temperature/instant
* /components/component/storage
* TODO: /components/component/software-module
* TODO: /components/component/software-module/state/module-type
* /components/component/state/description
* /components/component/state/firmware-version
* /components/component/state/hardware-version
* /components/component/state/id
* /components/component/state/mfg-date
* /components/component/state/mfg-name
* /components/component/state/name
* /components/component/state/oper-status
* /components/component/state/parent
* /components/component/state/part-no
* /components/component/state/serial-no
* /components/component/state/software-version
* /components/component/state/type
* /components/component/state/temperature/alarm-status
* /components/component/state/temperature/instant
* /components/component/state/temperature/max
* /components/component/state/temperature/max-time
* /components/component/integrated-circuit/backplane-facing-capacity/state/available-pct
* /components/component/integrated-circuit/backplane-facing-capacity/state/consumed-capacity
* /components/component/integrated-circuit/backplane-facing-capacity/state/total
* /components/component/integrated-circuit/backplane-facing-capacity/state/total-operational-capacity
## OpenConfig Path and RPC Coverage

TODO:

/components/component/storage
/components/component/software-module
/components/component/software-module/state/module-type
/components/component/state/mfg-date
/components/component/state/software-version

```yaml
paths:
/components/component/state/description:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "FABRIC", "FAN", "LINECARD", "POWER_SUPPLY"]
/components/component/state/firmware-version:
platform_type: ["TRANSCEIVER"]
/components/component/state/hardware-version:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "FABRIC", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/id:
platform_type: ["CONTROLLER_CARD", "FABRIC", "FAN", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR"]
/components/component/state/mfg-name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "FABRIC", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/model-name:
platform_type: ["CHASSIS"]
/components/component/state/name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/components/component/state/oper-status:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/parent:
platform_type: ["CONTROLLER_CARD", "FABRIC", "LINECARD", "POWER_SUPPLY"]
/components/component/state/part-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/serial-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/type:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/components/component/state/temperature/alarm-status:
platform_type: ["SENSOR"]
/components/component/state/temperature/instant:
platform_type: ["SENSOR"]
/components/component/state/temperature/max:
platform_type: ["SENSOR"]
/components/component/state/temperature/max-time:
platform_type: ["SENSOR"]
/components/component/integrated-circuit/backplane-facing-capacity/state/available-pct:
platform_type: ["INTEGRATED_CIRCUIT"]
/components/component/integrated-circuit/backplane-facing-capacity/state/consumed-capacity:
platform_type: ["INTEGRATED_CIRCUIT"]
/components/component/integrated-circuit/backplane-facing-capacity/state/total:
platform_type: ["INTEGRATED_CIRCUIT"]
/components/component/integrated-circuit/backplane-facing-capacity/state/total-operational-capacity:
platform_type: ["INTEGRATED_CIRCUIT"]

rpcs:
gnmi:
gNMI.Get:
```
18 changes: 18 additions & 0 deletions feature/platform/tests/telemetry_inventory_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,30 @@ uuid: "44fed7d9-4c79-4952-8b83-fbd5f7138ae9"
plan_id: "gNMI-1.4"
description: "Telemetry: Inventory"
testbed: TESTBED_DUT_ATE_2LINKS
platform_exceptions: {
platform: {
vendor: ARISTA
}
deviations: {
model_name_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: CISCO
}
deviations: {
model_name_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
switch_chip_id_unsupported: true
backplane_facing_capacity_unsupported: true
model_name_unsupported: true
storage_component_unsupported: true
}
}
Expand All @@ -21,6 +38,7 @@ platform_exceptions: {
}
deviations: {
backplane_facing_capacity_unsupported: true
model_name_unsupported: true
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ type properties struct {
serialNoValidation bool
mfgNameValidation bool
mfgDateValidation bool
swVerValidation bool
hwVerValidation bool
fwVerValidation bool
rrValidation bool
operStatus oc.E_PlatformTypes_COMPONENT_OPER_STATUS
parentValidation bool
pType oc.Component_Type_Union
// If modelNameValidation is being used, the /components/component/state/model-name
// of the chassis component must be equal to the ondatra hardware_model name
// of its device.
modelNameValidation bool
swVerValidation bool
hwVerValidation bool
fwVerValidation bool
rrValidation bool
operStatus oc.E_PlatformTypes_COMPONENT_OPER_STATUS
parentValidation bool
pType oc.Component_Type_Union
}

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -93,6 +97,7 @@ func TestMain(m *testing.M) {
// - Validate telemetry /components/component/storage exists.
// - TempSensor
// - Validate telemetry /components/component/state/temperature/instant exists.
// - Validate telemetry /components/component/state/model-name for Chassis.
//
// Topology:
//
Expand Down Expand Up @@ -133,6 +138,7 @@ func TestHardwareCards(t *testing.T) {
serialNoValidation: true,
mfgNameValidation: true,
mfgDateValidation: false,
modelNameValidation: true,
hwVerValidation: true,
fwVerValidation: false,
rrValidation: false,
Expand Down Expand Up @@ -759,6 +765,14 @@ func ValidateComponentState(t *testing.T, dut *ondatra.DUTDevice, cards []*oc.Co
}
}

if p.modelNameValidation {
if deviations.ModelNameUnsupported(dut) {
t.Logf("Telemetry path /components/component/state/model-name is not supported due to deviation ModelNameUnsupported. Skipping model name validation.")
} else if card.GetModelName() != dut.Model() {
t.Errorf("Component %s ModelName: got %s, want %s (dut's hardware model)", cName, card.GetModelName(), dut.Model())
}
}

if p.pType != nil {
ptype := card.GetType()
t.Logf("Component %s Type: %v", cName, ptype)
Expand Down
12 changes: 10 additions & 2 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,12 +1024,20 @@ func DefaultRoutePolicyUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetDefaultRoutePolicyUnsupported()
}

// Devices does not support bgp max multipaths.
// BgpMaxMultipathPathsUnsupported returns true if the device does not support
// bgp max multipaths.
func BgpMaxMultipathPathsUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpMaxMultipathPathsUnsupported()
}

// Devices does not support multipath under neighbor or afisafi
// MultipathUnsupportedNeighborOrAfisafi returns true if the device does not
// support multipath under neighbor or afisafi.
func MultipathUnsupportedNeighborOrAfisafi(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetMultipathUnsupportedNeighborOrAfisafi()
}

// ModelNameUnsupported returns true if /components/components/state/model-name
// is not supported for any component type.
func ModelNameUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetModelNameUnsupported()
}
6 changes: 6 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ message Metadata {
// Devices does not multipath config at neighbor or afisafi level
// Juniper: b/341130490
bool multipath_unsupported_neighbor_or_afisafi = 193;
// Devices that do not support /components/component/state/model-name for
// any component types.
// Note that for model name to be supported, the
// /components/component/state/model-name of the chassis component must be
// equal to the canonical hardware model name of its device.
bool model_name_unsupported = 194;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19;
Expand Down
Loading

0 comments on commit bfba0f7

Please sign in to comment.