Skip to content

Commit

Permalink
Add some comments explaining test setup.
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
  • Loading branch information
phiggins committed Apr 16, 2020
1 parent f85082c commit f7e0e73
Show file tree
Hide file tree
Showing 2 changed files with 255 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/unit/plugins/windows/dmi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
end

context "with extra information that should be filtered out" do
# Each test case has 3 elements:
# * The name of the property as it comes from the Windows APIs
# * The transformed snake-case version of the property name
# * A unique dummy value per test case
FILTERED_KEYS = [
%w{Caption caption aaa},
%w{CreationClassName creation_class_name bbb},
Expand Down Expand Up @@ -133,6 +137,11 @@
end

context "with information that should be made to match other platforms" do
# Each test case has 4 elements:
# * The name of the property as it comes from the Windows APIs
# * The transformed snake-case version of the property name
# * The Unix equivalent of the property name
# * A unique dummy value per test case
RENAMED_KEYS = [
%w{Vendor vendor manufacturer aaa},
%w{IdentifyingNumber identifying_number serial_number bbb},
Expand Down
246 changes: 246 additions & 0 deletions win_ohai_new
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
{
"dmi": {
"chassis": {
"all_records": [
{
"AudibleAlarm": null,
"BreachDescription": null,
"CableManagementStrategy": null,
"Caption": "System Enclosure",
"ChassisTypes": [
1
],
"CreationClassName": "Win32_SystemEnclosure",
"CurrentRequiredOrProduced": null,
"Depth": null,
"Description": "System Enclosure",
"HeatGeneration": null,
"Height": null,
"HotSwappable": null,
"InstallDate": null,
"LockPresent": false,
"Manufacturer": "Oracle Corporation",
"Model": null,
"Name": "System Enclosure",
"NumberOfPowerCords": null,
"OtherIdentifyingInfo": null,
"PartNumber": null,
"PoweredOn": null,
"Removable": null,
"Replaceable": null,
"SecurityBreach": null,
"SecurityStatus": 3,
"SerialNumber": "",
"ServiceDescriptions": null,
"ServicePhilosophy": null,
"SKU": null,
"SMBIOSAssetTag": "",
"Status": null,
"Tag": "System Enclosure 0",
"TypeDescriptions": null,
"Version": "",
"VisibleAlarm": null,
"Weight": null,
"Width": null
}
],
"description": "System Enclosure",
"manufacturer": "Oracle Corporation",
"serial_number": "",
"smbios_asset_tag": "",
"tag": "System Enclosure 0",
"version": "",
"family": "System Enclosure"
},
"processor": {
"all_records": [
{
"AddressWidth": 64,
"Architecture": 9,
"AssetTag": null,
"Availability": 3,
"Caption": "Intel64 Family 6 Model 70 Stepping 1",
"Characteristics": null,
"ConfigManagerErrorCode": null,
"ConfigManagerUserConfig": null,
"CpuStatus": 0,
"CreationClassName": "Win32_Processor",
"CurrentClockSpeed": 2794,
"CurrentVoltage": null,
"DataWidth": 64,
"Description": "Intel64 Family 6 Model 70 Stepping 1",
"DeviceID": "CPU0",
"ErrorCleared": null,
"ErrorDescription": null,
"ExtClock": null,
"Family": 2,
"InstallDate": null,
"L2CacheSize": null,
"L2CacheSpeed": null,
"L3CacheSize": 0,
"L3CacheSpeed": 0,
"LastErrorCode": null,
"Level": 6,
"LoadPercentage": 0,
"Manufacturer": "GenuineIntel",
"MaxClockSpeed": 2794,
"Name": "Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz",
"NumberOfCores": 2,
"NumberOfEnabledCore": null,
"NumberOfLogicalProcessors": 2,
"OtherFamilyDescription": null,
"PartNumber": null,
"PNPDeviceID": null,
"PowerManagementCapabilities": null,
"PowerManagementSupported": false,
"ProcessorId": null,
"ProcessorType": null,
"Revision": 17921,
"Role": "CPU",
"SecondLevelAddressTranslationExtensions": false,
"SerialNumber": null,
"SocketDesignation": null,
"Status": "OK",
"StatusInfo": 3,
"Stepping": null,
"SystemCreationClassName": "Win32_ComputerSystem",
"SystemName": "VAGRANT-36IHG0U",
"ThreadCount": null,
"UniqueId": null,
"UpgradeMethod": 2,
"Version": "",
"VirtualizationFirmwareEnabled": false,
"VMMonitorModeExtensions": false,
"VoltageCaps": null
}
],
"description": "Intel64 Family 6 Model 70 Stepping 1",
"device_id": "CPU0",
"manufacturer": "GenuineIntel",
"role": "CPU",
"status": "OK",
"system_name": "VAGRANT-36IHG0U",
"version": "",
"family": "Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz"
},
"bios": {
"all_records": [
{
"BiosCharacteristics": [
4,
7,
15,
16,
27,
30,
32
],
"BIOSVersion": [
"VBOX - 1"
],
"BuildNumber": null,
"Caption": "Default System BIOS",
"CodeSet": null,
"CurrentLanguage": null,
"Description": "Default System BIOS",
"EmbeddedControllerMajorVersion": 110,
"EmbeddedControllerMinorVersion": 111,
"IdentificationCode": null,
"InstallableLanguages": null,
"InstallDate": null,
"LanguageEdition": null,
"ListOfLanguages": null,
"Manufacturer": "innotek GmbH",
"Name": "Default System BIOS",
"OtherTargetOS": null,
"PrimaryBIOS": true,
"ReleaseDate": "20061201000000.000000+000",
"SerialNumber": "0",
"SMBIOSBIOSVersion": "VirtualBox",
"SMBIOSMajorVersion": 2,
"SMBIOSMinorVersion": 5,
"SMBIOSPresent": true,
"SoftwareElementID": "Default System BIOS",
"SoftwareElementState": 3,
"Status": "OK",
"SystemBiosMajorVersion": 105,
"SystemBiosMinorVersion": 110,
"TargetOperatingSystem": 0,
"Version": "VBOX - 1"
}
],
"description": "Default System BIOS",
"manufacturer": "innotek GmbH",
"release_date": "20061201000000.000000+000",
"serial_number": "0",
"smbiosbios_version": "VirtualBox",
"software_element_id": "Default System BIOS",
"status": "OK",
"version": "VBOX - 1",
"family": "Default System BIOS"
},
"system": {
"all_records": [
{
"Caption": "Computer System Product",
"Description": "Computer System Product",
"IdentifyingNumber": "0",
"Name": "VirtualBox",
"SKUNumber": null,
"UUID": "DBF47626-9602-4396-B121-94A6DEB3A06D",
"Vendor": "innotek GmbH",
"Version": "1.2"
}
],
"description": "Computer System Product",
"uuid": "DBF47626-9602-4396-B121-94A6DEB3A06D",
"version": "1.2",
"manufacturer": "innotek GmbH",
"serial_number": "0",
"family": "VirtualBox"
},
"base_board": {
"all_records": [
{
"Caption": "Base Board",
"ConfigOptions": null,
"CreationClassName": "Win32_BaseBoard",
"Depth": null,
"Description": "Base Board",
"Height": null,
"HostingBoard": true,
"HotSwappable": false,
"InstallDate": null,
"Manufacturer": "Oracle Corporation",
"Model": null,
"Name": "Base Board",
"OtherIdentifyingInfo": null,
"PartNumber": null,
"PoweredOn": true,
"Product": "VirtualBox",
"Removable": false,
"Replaceable": false,
"RequirementsDescription": null,
"RequiresDaughterBoard": false,
"SerialNumber": "0",
"SKU": null,
"SlotLayout": null,
"SpecialRequirements": null,
"Status": "OK",
"Tag": "Base Board",
"Version": "1.2",
"Weight": null,
"Width": null
}
],
"description": "Base Board",
"manufacturer": "Oracle Corporation",
"product": "VirtualBox",
"serial_number": "0",
"status": "OK",
"tag": "Base Board",
"version": "1.2",
"family": "Base Board"
}
}
}

0 comments on commit f7e0e73

Please sign in to comment.