feat: improve inspur parsing and pci.ids integration

This commit is contained in:
2026-02-17 18:09:36 +03:00
parent b33cca5fcc
commit 758fa66282
26 changed files with 43567 additions and 247 deletions

View File

@@ -0,0 +1,20 @@
package server
import (
"testing"
"git.mchus.pro/mchus/logpile/internal/models"
)
func TestNormalizePCIeSerialComponentName_PrefersPartOverGenericClass(t *testing.T) {
got := normalizePCIeSerialComponentName(models.PCIeDevice{DeviceClass:"Display Controller", PartNumber:"GH100 [H200 NVL]"})
if got != "GH100 [H200 NVL]" {
t.Fatalf("expected part number, got %q", got)
}
}
func TestNormalizePCIeSerialComponentName_UsesClassWhenSpecific(t *testing.T) {
got := normalizePCIeSerialComponentName(models.PCIeDevice{DeviceClass:"I350 Gigabit Network Connection", PartNumber:"I350T4V2"})
if got != "I350T4V2" {
t.Fatalf("expected part number for readability, got %q", got)
}
}