diff --git a/internal/collector/sysinfo/hardware/hardware_windows_test.go b/internal/collector/sysinfo/hardware/hardware_windows_test.go index 6deb96f..440b072 100644 --- a/internal/collector/sysinfo/hardware/hardware_windows_test.go +++ b/internal/collector/sysinfo/hardware/hardware_windows_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ubuntu/ubuntu-insights/internal/collector/sysinfo" + "github.com/ubuntu/ubuntu-insights/internal/collector/sysinfo/hardware" "github.com/ubuntu/ubuntu-insights/internal/testutils" ) @@ -320,49 +320,49 @@ func TestCollectWindows(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - l := testutils.NewMockHandler() + l := testutils.NewMockHandler(slog.LevelDebug) - options := []sysinfo.Options{ - sysinfo.WithLogger(&l), - sysinfo.WithArch("amd64"), + options := []hardware.Options{ + hardware.WithLogger(&l), + hardware.WithArch("amd64"), } if tc.productInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeProductInfo", tc.productInfo) - options = append(options, sysinfo.WithProductInfo(cmdArgs)) + options = append(options, hardware.WithProductInfo(cmdArgs)) } if tc.cpuInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeCPUInfo", tc.cpuInfo) - options = append(options, sysinfo.WithCPUInfo(cmdArgs)) + options = append(options, hardware.WithCPUInfo(cmdArgs)) } if tc.gpuInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeGPUInfo", tc.gpuInfo) - options = append(options, sysinfo.WithGPUInfo(cmdArgs)) + options = append(options, hardware.WithGPUInfo(cmdArgs)) } if tc.memoryInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeMemoryInfo", tc.memoryInfo) - options = append(options, sysinfo.WithMemoryInfo(cmdArgs)) + options = append(options, hardware.WithMemoryInfo(cmdArgs)) } if tc.diskInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeDiskInfo", tc.diskInfo) - options = append(options, sysinfo.WithDiskInfo(cmdArgs)) + options = append(options, hardware.WithDiskInfo(cmdArgs)) } if tc.partitionInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakePartitionInfo", tc.partitionInfo) - options = append(options, sysinfo.WithPartitionInfo(cmdArgs)) + options = append(options, hardware.WithPartitionInfo(cmdArgs)) } if tc.screenInfo != "-" { cmdArgs := testutils.SetupFakeCmdArgs("TestFakeScreenInfo", tc.screenInfo) - options = append(options, sysinfo.WithScreenInfo(cmdArgs)) + options = append(options, hardware.WithScreenInfo(cmdArgs)) } - s := sysinfo.New(options...) + s := hardware.New(options...) got, err := s.Collect() if tc.wantErr { diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/bad_memory_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/bad_memory_information index 2b4962a..2b00898 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/bad_memory_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/bad_memory_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 0 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 0 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_cpu_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_cpu_information index 36f4ebf..03ea2b3 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_cpu_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_cpu_information @@ -1,44 +1,41 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: {} +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_disk_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_disk_information index 87a5ed9..afd0555 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_disk_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_disk_information @@ -1,34 +1,32 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_gpu_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_gpu_information index cc797de..eb5e886 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_gpu_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_gpu_information @@ -1,43 +1,41 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: [] - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: [] +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_memory_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_memory_information index 4159278..f52be0b 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_memory_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_memory_information @@ -1,48 +1,46 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: {} - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: {} +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_partition_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_partition_information index 9d5b1c2..29198ee 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_partition_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_partition_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" + partitions: [] + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_product_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_product_information index 89f0ec1..99de3df 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_product_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_product_information @@ -1,46 +1,44 @@ -hardware: - product: {} - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: {} +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_screen_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_screen_information index e722bd2..d9b697d 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_screen_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/error_screen_information @@ -1,39 +1,37 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: [] -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: [] diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/garbage_memory_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/garbage_memory_information index 2b4962a..2b00898 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/garbage_memory_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/garbage_memory_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 0 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 0 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_disk_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_disk_information index 757e5fc..4968b2c 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_disk_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_disk_information @@ -1,427 +1,425 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: [] - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: [] + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_partition_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_partition_information index 9d5b1c2..29198ee 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_partition_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/malicious_partition_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" + partitions: [] + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_cpu_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_cpu_information index 36f4ebf..03ea2b3 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_cpu_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_cpu_information @@ -1,44 +1,41 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: {} +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_disk_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_disk_information index 87a5ed9..afd0555 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_disk_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_disk_information @@ -1,34 +1,32 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_gpu_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_gpu_information index cc797de..eb5e886 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_gpu_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_gpu_information @@ -1,43 +1,41 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: [] - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: [] +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_memory_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_memory_information index 4159278..f52be0b 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_memory_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_memory_information @@ -1,48 +1,46 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: {} - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: {} +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_partition_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_partition_information index 9d5b1c2..29198ee 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_partition_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_partition_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - - name: "" - size: "" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" + partitions: [] + - name: "" size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} + partitions: [] + - name: "" + size: "" + partitions: [] + - name: "" + size: "" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_product_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_product_information index 89f0ec1..99de3df 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_product_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_product_information @@ -1,46 +1,44 @@ -hardware: - product: {} - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: {} +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_screen_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_screen_information index e722bd2..d9b697d 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_screen_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/missing_screen_information @@ -1,39 +1,37 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: [] -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: [] diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/negative_memory_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/negative_memory_information index 2b4962a..2b00898 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/negative_memory_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/negative_memory_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 0 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 0 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" diff --git a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/regular_hardware_information b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/regular_hardware_information index 3468a9e..85fef30 100644 --- a/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/regular_hardware_information +++ b/internal/collector/sysinfo/hardware/testdata/TestCollectWindows/golden/regular_hardware_information @@ -1,49 +1,47 @@ -hardware: - product: - Family: "1582.3" - Model: Star 11 CPP - Vendor: Micro-Star International Co., Ltd. - cpu: - Architecture: amd64 - Manufacturer: GenuineIntel - Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz - NumberOfCores: "8" - NumberOfLogicalProcessors: "16" - Sockets: "1" - gpus: - - Driver: nvldumdx.dll - Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU - Vendor: NVIDIA - - Driver: igdumdim0.dll - Name: Intel(R) UHD Graphics - Vendor: Intel Corporation - mem: - MemTotal: 68406489088 - blks: - - name: \\.\PHYSICALDRIVE0 - size: "2000396321280" - partitions: - - name: 'Disk #0, Partition #0' - size: "314572800" - partitions: [] - - name: 'Disk #0, Partition #1' - size: "943718400" - partitions: [] - - name: 'Disk #0, Partition #2' - size: "22153265152" - partitions: [] - - name: 'Disk #0, Partition #3' - size: "1976850972672" - partitions: [] - screens: - - name: Default Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" - - name: Generic PnP Monitor - physicalresolution: "" - size: "" - resolution: 1920x1080 - refreshrate: "" -software: {} +product: + Family: "1582.3" + Model: Star 11 CPP + Vendor: Micro-Star International Co., Ltd. +cpu: + Architecture: amd64 + Manufacturer: GenuineIntel + Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz + NumberOfCores: "8" + NumberOfLogicalProcessors: "16" + Sockets: "1" +gpus: + - Driver: nvldumdx.dll + Name: NVIDIA GeForce RTX 3050 Ti Laptop GPU + Vendor: NVIDIA + - Driver: igdumdim0.dll + Name: Intel(R) UHD Graphics + Vendor: Intel Corporation +mem: + MemTotal: 68406489088 +blks: + - name: \\.\PHYSICALDRIVE0 + size: "2000396321280" + partitions: + - name: 'Disk #0, Partition #0' + size: "314572800" + partitions: [] + - name: 'Disk #0, Partition #1' + size: "943718400" + partitions: [] + - name: 'Disk #0, Partition #2' + size: "22153265152" + partitions: [] + - name: 'Disk #0, Partition #3' + size: "1976850972672" + partitions: [] +screens: + - name: Default Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: "" + - name: Generic PnP Monitor + physicalresolution: "" + size: "" + resolution: 1920x1080 + refreshrate: ""