feat: improve inspur parsing and pci.ids integration
This commit is contained in:
1 parent
b33cca5fcc
commit
758fa66282
26 files changed
+43564
-244
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user