Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health 1.1 system_generic_health_check #3693

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
Loading