diff --git a/feature/platform/tests/telemetry_inventory_test/README.md b/feature/platform/tests/telemetry_inventory_test/README.md index bae1f9ff26f..8fc1a679831 100644 --- a/feature/platform/tests/telemetry_inventory_test/README.md +++ b/feature/platform/tests/telemetry_inventory_test/README.md @@ -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. @@ -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: diff --git a/feature/platform/tests/telemetry_inventory_test/metadata.textproto b/feature/platform/tests/telemetry_inventory_test/metadata.textproto index 3f060a21603..7edce911e30 100644 --- a/feature/platform/tests/telemetry_inventory_test/metadata.textproto +++ b/feature/platform/tests/telemetry_inventory_test/metadata.textproto @@ -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 } diff --git a/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go b/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go index 55b06f9f619..e88fc5e976d 100644 --- a/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go +++ b/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go @@ -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, @@ -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 @@ -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", @@ -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)) diff --git a/internal/args/args.go b/internal/args/args.go index c39bf70920c..c9f89b55ae1 100644 --- a/internal/args/args.go +++ b/internal/args/args.go @@ -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.") diff --git a/proto/metadata_go_proto/metadata.pb.go b/proto/metadata_go_proto/metadata.pb.go index 1cc537ebafb..b4e10db8c3d 100644 --- a/proto/metadata_go_proto/metadata.pb.go +++ b/proto/metadata_go_proto/metadata.pb.go @@ -21,12 +21,11 @@ package metadata_go_proto import ( - reflect "reflect" - sync "sync" - proto "github.com/openconfig/ondatra/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const (