v0.169.1: disk-health card excludes logical/network storage (pbs/lvm/nfs/cifs)
The agent defaults SMART to UNKNOWN on non-physical targets, so they showed as spurious 'Nincs adat' rows. isPhysicalDisk now excludes those types (card + check). Test strengthened: a PBS/LVM fixture with UNKNOWN SMART must still be excluded.
This commit is contained in:
@@ -112,12 +112,14 @@ func TestDiskHealthRows_NilSmart(t *testing.T) {
|
||||
s, _, payload := diskCheckHarness(t)
|
||||
*payload = []agentapi.DiskInfo{
|
||||
{Name: "sdb", BackingDevice: "/dev/sdb", Smart: nil}, // physical, no smart → Nincs adat
|
||||
{Name: "felhom-pbs", Type: "pbs"}, // non-physical → excluded
|
||||
// PBS/LVM carry a default UNKNOWN SMART from the agent — must STILL be excluded (not disks).
|
||||
{Name: "felhom-pbs", Type: "pbs", Smart: &agentapi.SmartSummary{Health: agentapi.SmartUnknown}},
|
||||
{Name: "local-lvm", Type: "lvmthin", Smart: &agentapi.SmartSummary{Health: agentapi.SmartUnknown}},
|
||||
{Name: "sdc", BackingDevice: "/dev/sdc", Smart: &agentapi.SmartSummary{Health: agentapi.SmartPassed, TemperatureC: smartPtr(31)}}, // Rendben, 31°C
|
||||
}
|
||||
rows := s.diskHealthRows(context.Background())
|
||||
if len(rows) != 2 {
|
||||
t.Fatalf("want 2 physical-disk rows (pbs excluded), got %d: %+v", len(rows), rows)
|
||||
t.Fatalf("want 2 physical-disk rows (pbs+lvm excluded), got %d: %+v", len(rows), rows)
|
||||
}
|
||||
byLabel := map[string]DiskHealthRow{}
|
||||
for _, r := range rows {
|
||||
|
||||
Reference in New Issue
Block a user