Skip to content

Commit

Permalink
Update gNMI-1.4 with FAN_TRAY type. (#3046)
Browse files Browse the repository at this point in the history
* add fan_tray type to readme

* Add FAN_TRAY type to telemetry_inventory_test.go.

* add NumFanTrays arg

* skip fan tray telemetry check when 0 are expected

* add FAN_TRAY as platform_type to README.

* validate that fan tray parent is the chassis.

* validate fan component's parent.

* Add deviation for fan tray type.

* Use fan tray deviation in telemetry_inventory_test.

* fix call to FanTrayTypeUnsupported.

* Remove switch_chip_id_unsupported from Nokia.

* Add arg_num_fans.

* Skip fan validation when args_num_fans is 0.

* Update args.go

* Fix metadata.pb.go.

* Fix metadata.pb.go.

* Fix deviations.go typo.

* Only check that FAN has ancestor chassis, not the immediate parent type.

* Fix metadata.pg.go.

* FIx metadata.pb.go.

* Fix metadata.pb.go.

* Remove fan_tray deviation from metadata.proto.

* Remove fan_tray deviation from deviations.go.

* Remove fan_tray deviation from metadata.textproto.

* Update metadata.proto

* Remove fan_tray deviation from telemetry_inventory_test.go.

* Fix metadata.pb.go.

* Fix brackets in telemetry_inventory_test.go.
  • Loading branch information
SydneyCaulfeild authored Jul 16, 2024
1 parent ddb15d8 commit 0db4711
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 74 deletions.
114 changes: 57 additions & 57 deletions feature/platform/tests/telemetry_inventory_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Validate Telemetry for each FRU within chassis.

## Procedure

For each of the following component types (linecard, chassis, fan, controller
For each of the following component types (linecard, chassis, fan, fan_tray, controller
card, power supply, disk, flash, NPU, transceiver, fabric card), validate:

* Presence of component within gNMI telemetry.
Expand All @@ -30,62 +30,62 @@ TODO:

```yaml
paths:
/components/component/state/description:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "FABRIC", "FAN", "FRU", "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/install-component:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/install-position:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/location:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/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", "FRU", "LINECARD", "POWER_SUPPLY"]
/components/component/state/part-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FRU", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/serial-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FRU", "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/subcomponents/subcomponent/name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/components/component/subcomponents/subcomponent/state/name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/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"]
/components/component/controller-card/config/power-admin-state:
platform_type: ["CONTROLLER_CARD"]
/components/component/fabric/config/power-admin-state:
platform_type: ["FABRIC"]
/components/component/linecard/config/power-admin-state:
platform_type: ["LINECARD"]
/components/component/state/description:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "FABRIC", "FAN", "FAN_TRAY", "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", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR"]
/components/component/state/install-component:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/install-position:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/components/component/state/location:
platform_type: ["FABRIC", "FAN", "FAN_TRAY", "FRU", "CONTROLLER_CARD", "LINECARD", "POWER_SUPPLY", "TRANSCEIVER"]
/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", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/components/component/state/oper-status:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/parent:
platform_type: ["CONTROLLER_CARD", "FABRIC", "FAN", "FAN_TRAY", "LINECARD", "POWER_SUPPLY"]
/components/component/state/part-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/serial-no:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "LINECARD", "POWER_SUPPLY", "STORAGE", "TRANSCEIVER"]
/components/component/state/type:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "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/subcomponents/subcomponent/name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/components/component/subcomponents/subcomponent/state/name:
platform_type: ["CHASSIS", "CONTROLLER_CARD", "CPU", "FABRIC", "FAN", "FAN_TRAY", "INTEGRATED_CIRCUIT", "LINECARD", "POWER_SUPPLY", "SENSOR", "STORAGE", "TRANSCEIVER"]
/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"]
/components/component/controller-card/config/power-admin-state:
platform_type: ["CONTROLLER_CARD"]
/components/component/fabric/config/power-admin-state:
platform_type: ["FABRIC"]
/components/component/linecard/config/power-admin-state:
platform_type: ["LINECARD"]

rpcs:
gnmi:
Expand Down
13 changes: 13 additions & 0 deletions feature/platform/tests/telemetry_inventory_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,24 @@ platform_exceptions: {
model_name_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
backplane_facing_capacity_unsupported: true
install_position_and_install_component_unsupported: true
model_name_unsupported: true
storage_component_unsupported: true
switch_chip_id_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
}
deviations: {
backplane_facing_capacity_unsupported: true
install_position_and_install_component_unsupported: true
model_name_unsupported: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var componentType = map[string]oc.E_PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT{
"Fabric": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC,
"Linecard": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD,
"Fan": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FAN,
"Fan Tray": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FAN_TRAY,
"PowerSupply": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_POWER_SUPPLY,
"Supervisor": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CONTROLLER_CARD,
"SwitchChip": oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT,
Expand Down Expand Up @@ -115,6 +116,7 @@ func TestMain(m *testing.M) {
// - Fabric card
// - FabricChip
// - Fan
// - Fan Tray
// - Supervisor or Controller
// - Validate telemetry components/component/state/software-version.
// - SwitchChip
Expand Down Expand Up @@ -200,20 +202,36 @@ func TestHardwareCards(t *testing.T) {
}, {
desc: "Fan",
cardFields: properties{
descriptionValidation: true,
idValidation: false,
installPositionAndComponentValidation: true,
nameValidation: true,
partNoValidation: true,
serialNoValidation: true,
mfgNameValidation: false,
mfgDateValidation: false,
hwVerValidation: false,
fwVerValidation: false,
rrValidation: false,
operStatus: oc.PlatformTypes_COMPONENT_OPER_STATUS_ACTIVE,
parentValidation: false,
pType: componentType["Fan"],
descriptionValidation: true,
idValidation: false,
nameValidation: true,
partNoValidation: true,
serialNoValidation: true,
mfgNameValidation: false,
mfgDateValidation: false,
hwVerValidation: false,
fwVerValidation: false,
rrValidation: false,
operStatus: oc.PlatformTypes_COMPONENT_OPER_STATUS_ACTIVE,
parentValidation: true,
pType: componentType["Fan"],
},
}, {
desc: "Fan Tray",
cardFields: properties{
descriptionValidation: true,
idValidation: false,
nameValidation: true,
partNoValidation: true,
serialNoValidation: true,
mfgNameValidation: false,
mfgDateValidation: false,
hwVerValidation: false,
fwVerValidation: false,
rrValidation: false,
operStatus: oc.PlatformTypes_COMPONENT_OPER_STATUS_ACTIVE,
parentValidation: true,
pType: componentType["Fan Tray"],
},
}, {
desc: "Linecard",
Expand Down Expand Up @@ -338,6 +356,10 @@ func TestHardwareCards(t *testing.T) {
t.Skip("Skip Linecard Telemetry check for fixed form factor devices.")
} else if tc.desc == "Supervisor" && *args.NumControllerCards <= 0 {
t.Skip("Skip Supervisor Telemetry check for fixed form factor devices.")
} else if tc.desc == "Fan Tray" && *args.NumFanTrays == 0 {
t.Skip("Skip Fan Tray Telemetry check for fixed form factor devices.")
} else if tc.desc == "Fan" && *args.NumFans == 0 {
t.Skip("Skip Fan Telemetry check for fixed form factor devices.")
}
cards := components[tc.desc]
t.Logf("%s components count: %d", tc.desc, len(cards))
Expand Down
2 changes: 2 additions & 0 deletions internal/args/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ var (
NumControllerCards = flag.Int("arg_num_controller_cards", -1, "The expected number of controller cards. Some devices with a single controller report 0, which is a valid expected value. Expectation is not checked for values < 0.")
NumLinecards = flag.Int("arg_num_linecards", -1, "The expected number of linecards. Some devices with a single linecard report 0, which is a valid expected value. Expectation is not checked for values < 0.")
NumFabrics = flag.Int("arg_num_fabrics", -1, "The expected number of fabrics. Some devices with a single fabric report 0, which is a valid expected value. Expectation is not checked for values < 0.")
NumFans = flag.Int("arg_num_fans", 0, "The expected number of fans (default is 0, meaning the device is not expected to have fans so none are validated).")
NumFanTrays = flag.Int("arg_num_fan_trays", 0, "The expected number of fan trays (default is 0, meaning the device is not expected to have fan trays so none are validated).")
P4RTNodeName1 = flag.String("arg_p4rt_node_name_1", "", "The P4RT Node Name for the first FAP. Test that reserves ports in the same FAP should configure this P4RT Node. The value will only be used if deviation ExplicitP4RTNodeComponent is applied.")
P4RTNodeName2 = flag.String("arg_p4rt_node_name_2", "", "The P4RT Node Name for the second FAP. Test that reserves ports in two different FAPs should configure this P4RT Node in addition to the Node defined in P4RTNodeName1. The value will only be used if deviation ExplicitP4RTNodeComponent is applied.")
FullConfigReplaceTime = flag.Duration("arg_full_config_replace_time", 0, "Time taken for gNMI set operation to complete full configuration replace. Expected duration is in nanoseconds. Expectation is not checked when value is 0.")
Expand Down
5 changes: 2 additions & 3 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 0db4711

Please sign in to comment.