Skip to content

Commit

Permalink
GNMI-1.18: Skipping check for empty integrated-circuit and removing d…
Browse files Browse the repository at this point in the history
…eviations (openconfig#3560)

* GNMI-1.18: Skipping check for empty integrated-circuit and removing deviations
   1. Removing all deviations for Nokia
   2. Skipping checks for empty integrated-circuit/switch-chip

"This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."

* updated the commit to use findActiveComponenet function

* Restoring the check for removable component

---------

Co-authored-by: krisb <krishna.bovilla@nokia.com>
  • Loading branch information
trathod1 and bkreddy143 authored Dec 26, 2024
1 parent dd9f5ea commit dc08c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
}
deviations: {
interface_enabled: true
explicit_port_speed: true
explicit_interface_in_default_vrf: true
qos_queue_requires_id: true
missing_value_for_defaults: true
}
}
platform_exceptions: {
platform: {
vendor: ARISTA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestMain(m *testing.M) {
func TestSampledBackplaneCapacityCounters(t *testing.T) {
dut := ondatra.DUT(t, "dut")

ics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT)
ics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT)
if len(ics) == 0 {
t.Fatalf("Get IntegratedCircuit card list for %q: got 0, want > 0", dut.Model())
}
Expand All @@ -65,7 +65,6 @@ func TestSampledBackplaneCapacityCounters(t *testing.T) {
if !isCompNameExpected(t, ic, dut.Vendor()) {
continue
}

t.Run(fmt.Sprintf("Backplane:%s", ic), func(t *testing.T) {
if deviations.BackplaneFacingCapacityUnsupported(dut) {
t.Skipf("Skipping check for BackplanceFacingCapacity due to deviation BackplaneFacingCapacityUnsupported")
Expand Down Expand Up @@ -110,20 +109,16 @@ func gnmiOptsForOnChange(t *testing.T, dut *ondatra.DUTDevice) *gnmi.Opts {
func TestOnChangeBackplaneCapacityCounters(t *testing.T) {
dut := ondatra.DUT(t, "dut")

ics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT)
ics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT)
if len(ics) == 0 {
t.Fatalf("Get IntegratedCircuit card list for %q: got 0, want > 0", dut.Model())
}
t.Logf("IntegratedCircuit components count: %d", len(ics))

fabrics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC)
fabrics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC)
t.Logf("fabrics are %v", fabrics)
removable_fabrics := make([]string, 0)
for _, f := range fabrics {
compMtyVal, compMtyPresent := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val()
if compMtyPresent && compMtyVal {
continue
}
if gnmi.Get(t, dut, gnmi.OC().Component(f).Removable().State()) {
removable_fabrics = append(removable_fabrics, f)
}
Expand Down Expand Up @@ -226,7 +221,6 @@ func getBackplaneCapacityCounters(t *testing.T, dut *ondatra.DUTDevice, ics []st
if !isCompNameExpected(t, ic, dut.Vendor()) {
continue
}

t.Run(fmt.Sprintf("Backplane:%s", ic), func(t *testing.T) {
if deviations.BackplaneFacingCapacityUnsupported(dut) {
t.Skipf("Skipping check for BackplanceFacingCapacity due to deviation BackplaneFacingCapacityUnsupported")
Expand Down

0 comments on commit dc08c6f

Please sign in to comment.