Skip to content

Commit

Permalink
Health 1.1 system_generic_health_check (#3693)
Browse files Browse the repository at this point in the history
* removing deviations that are not required and adding code for components presence

* skipping test for FFF

* edited the check from lineCards to chassisLineCards
  • Loading branch information
lvaish05 authored Feb 26, 2025
1 parent 5b8036a commit 300f44f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ platform_exceptions: {
vendor: JUNIPER
}
deviations: {
linecard_cpu_utilization_unsupported: true
consistent_component_names_unsupported: true
controller_card_cpu_utilization_unsupported: true
fabric_drop_counter_unsupported: true
linecard_memory_utilization_unsupported: true
qos_voq_drop_counter_unsupported: true
qos_inqueue_drop_counter_unsupported: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ func TestComponentStatus(t *testing.T) {
controllerCards := components.FindComponentsByType(t, dut, controllerCardType)
lineCards := components.FindComponentsByType(t, dut, lineCardType)
fabricCards := components.FindComponentsByType(t, dut, fabricCardType)
fabrics := make([]string, 0)
for _, f := range fabricCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val()
if !compMtyVal && ok {
fabrics = append(fabrics, f)
}
}
fabricCards = fabrics
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}
lineCards = chassisLineCards
checkComponents := append(controllerCards, lineCards...)
checkComponents = append(checkComponents, fabricCards...)
if len(checkComponents) == 0 {
Expand Down Expand Up @@ -246,6 +262,20 @@ func TestLineCardsNoHighCPUSpike(t *testing.T) {

lineCards := components.FindComponentsByType(t, dut, lineCardType)
cpuCards := components.FindComponentsByType(t, dut, cpuType)
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}

for _, lc := range chassisLineCards {
if !gnmi.Get(t, dut, gnmi.OC().Component(lc).Removable().State()) {
t.Skipf("Skip the test on non-removable linecard.")
}
}
lineCards = chassisLineCards
if len(lineCards) == 0 || len(cpuCards) == 0 {
t.Errorf("ERROR: No controllerCard or cpuCard has been found.")
}
Expand Down Expand Up @@ -288,10 +318,19 @@ func TestComponentsNoHighMemoryUtilization(t *testing.T) {

controllerCards := components.FindComponentsByType(t, dut, controllerCardType)
lineCards := components.FindComponentsByType(t, dut, lineCardType)
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}
lineCards = chassisLineCards
cardList := append(controllerCards, lineCards...)
if len(cardList) == 0 {
t.Errorf("ERROR: No card has been found.")
}

for _, component := range cardList {
t.Run(component, func(t *testing.T) {
query := gnmi.OC().Component(component).State()
Expand All @@ -301,7 +340,9 @@ func TestComponentsNoHighMemoryUtilization(t *testing.T) {
if componentType == lineCardType && deviations.LinecardMemoryUtilizationUnsupported(dut) {
t.Skipf("INFO: Skipping test for linecard component %s due to deviation linecard_memory_utilization_unsupported", component)
}

if componentType == lineCardType && !gnmi.Get(t, dut, gnmi.OC().Component(component).Removable().State()) {
t.Skipf("Skip the test on non-removable linecard.")
}
memoryState := componentState.GetMemory()
if memoryState == nil {
t.Errorf("ERROR: %s - Device: %s - %s: %-40s - Type: %-20s - Memory data not available",
Expand Down

0 comments on commit 300f44f

Please sign in to comment.