diff --git a/hwinfo/host/__init__.py b/hwinfo/host/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hwinfo/host/dmidecode.py b/hwinfo/host/dmidecode.py new file mode 100644 index 0000000..a4e6b70 --- /dev/null +++ b/hwinfo/host/dmidecode.py @@ -0,0 +1,19 @@ +"""Module for host related info""" + +from hwinfo.util import CommandParser + +class DmidecodeParser(CommandParser): + + ITEM_REGEXS = [ + # BIOS Info + r'BIOS\ Information\n(.)*Vendor:\ (?P.*)\n', + r'BIOS\ Information\n(.)*\n\tVersion:\ (?P.*)\n', + r'BIOS\ Information\n(.)*\n(.)*\n\tRelease\ Date:\ (?P.*)\n', + # System Info + r'System\ Information\n\tManufacturer:\ (?P.*)\n', + r'System\ Information\n(.)*\n\tProduct\ Name:\ (?P.*)\n', + r'System\ Information\n(.)*\n(.)*\n(.)*\n\tSerial\ Number:\ (?P.*)\n', + r'System\ Information\n(.)*\n(.)*\n(.)*\n(.)*\n\tUUID:\ (?P.*)\n', + ] + + diff --git a/hwinfo/host/tests/data/dmidecode b/hwinfo/host/tests/data/dmidecode new file mode 100644 index 0000000..f345785 --- /dev/null +++ b/hwinfo/host/tests/data/dmidecode @@ -0,0 +1,673 @@ +# dmidecode 2.11 +SMBIOS 2.6 present. +65 structures occupying 3022 bytes. +Table at 0xBF79C000. + +Handle 0xDA00, DMI type 218, 11 bytes +OEM-specific Type + Header and Data: + DA 0B 00 DA B2 00 17 00 0E 20 00 + +Handle 0x0000, DMI type 0, 24 bytes +BIOS Information + Vendor: Dell Inc. + Version: 1.0.0 + Release Date: 02/11/2010 + Address: 0xF0000 + Runtime Size: 64 kB + ROM Size: 4096 kB + Characteristics: + ISA is supported + PCI is supported + PNP is supported + BIOS is upgradeable + BIOS shadowing is allowed + Boot from CD is supported + Selectable boot is supported + EDD is supported + Japanese floppy for Toshiba 1.2 MB is supported (int 13h) + 5.25"/360 kB floppy services are supported (int 13h) + 5.25"/1.2 MB floppy services are supported (int 13h) + 3.5"/720 kB floppy services are supported (int 13h) + 8042 keyboard services are supported (int 9h) + Serial services are supported (int 14h) + CGA/mono video services are supported (int 10h) + ACPI is supported + USB legacy is supported + BIOS boot specification is supported + Function key-initiated network boot is supported + Targeted content distribution is supported + BIOS Revision: 1.0 + +Handle 0x0100, DMI type 1, 27 bytes +System Information + Manufacturer: Dell Inc. + Product Name: PowerEdge R310 + Version: Not Specified + Serial Number: GZ7BS4J + UUID: 4C4C4544-005A-3710-8042-C7C04F53344A + Wake-up Type: Power Switch + SKU Number: Not Specified + Family: Not Specified + +Handle 0x0200, DMI type 2, 9 bytes +Base Board Information + Manufacturer: Dell Inc. + Product Name: 0P229K + Version: A00 + Serial Number: ..CN1374004L0079. + Asset Tag: Not Specified + +Handle 0x0300, DMI type 3, 21 bytes +Chassis Information + Manufacturer: Dell Inc. + Type: Rack Mount Chassis + Lock: Present + Version: Not Specified + Serial Number: GZ7BS4J + Asset Tag: Not Specified + Boot-up State: Safe + Power Supply State: Safe + Thermal State: Safe + Security Status: Unknown + OEM Information: 0x00000000 + Height: 1 U + Number Of Power Cords: Unspecified + Contained Elements: 0 + +Handle 0x0400, DMI type 4, 40 bytes +Processor Information + Socket Designation: CPU1 + Type: Central Processor + Family: Xeon + Manufacturer: Intel + ID: E5 06 01 00 FF FB EB BF + Signature: Type 0, Family 6, Model 30, Stepping 5 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + DS (Debug store) + ACPI (ACPI supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + SS (Self-snoop) + HTT (Multi-threading) + TM (Thermal monitor supported) + PBE (Pending break enabled) + Version: Intel(R) Xeon(R) CPU X3450 @ 2.67GHz + Voltage: 1.2 V + External Clock: 4800 MHz + Max Speed: 3600 MHz + Current Speed: 2666 MHz + Status: Populated, Enabled + Upgrade: Socket LGA1366 + L1 Cache Handle: 0x0700 + L2 Cache Handle: 0x0701 + L3 Cache Handle: 0x0702 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 4 + Core Enabled: 4 + Thread Count: 8 + Characteristics: + 64-bit capable + +Handle 0x0700, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 128 kB + Maximum Size: 128 kB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Data + Associativity: 8-way Set-associative + +Handle 0x0701, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 1024 kB + Maximum Size: 2048 kB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unified + Associativity: 8-way Set-associative + +Handle 0x0702, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 8192 kB + Maximum Size: 8192 kB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Handle 0x0800, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-15 female + Port Type: Video Port + +Handle 0x0801, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-15 female + Port Type: Video Port + +Handle 0x0802, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0803, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0804, DMI type 126, 9 bytes +Inactive + +Handle 0x0805, DMI type 126, 9 bytes +Inactive + +Handle 0x0806, DMI type 126, 9 bytes +Inactive + +Handle 0x0807, DMI type 126, 9 bytes +Inactive + +Handle 0x0808, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0809, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x080A, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_USB1 + Internal Connector Type: Access Bus (USB) + External Reference Designator: Not Specified + External Connector Type: None + Port Type: USB + +Handle 0x080B, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_USB2 + Internal Connector Type: Access Bus (USB) + External Reference Designator: Not Specified + External Connector Type: None + Port Type: USB + +Handle 0x080C, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA1 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x080D, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA2 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x080E, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA3 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x080F, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA4 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x0810, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA5 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x0811, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_SATA6 + Internal Connector Type: SAS/SATA Plug Receptacle + External Reference Designator: Not Specified + External Connector Type: None + Port Type: SATA + +Handle 0x0812, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x0813, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x0814, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-9 male + Port Type: Serial Port 16550A Compatible + +Handle 0x0900, DMI type 9, 17 bytes +System Slot Information + Designation: PCIE1 + Type: x8 PCI Express 2 x8 + Current Usage: Available + Length: Long + ID: 1 + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0901, DMI type 9, 17 bytes +System Slot Information + Designation: PCIE2 + Type: x8 PCI Express 2 x8 + Current Usage: Available + Length: Long + ID: 2 + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0902, DMI type 126, 17 bytes +Inactive + +Handle 0x0903, DMI type 126, 17 bytes +Inactive + +Handle 0x0904, DMI type 126, 17 bytes +Inactive + +Handle 0x0A00, DMI type 10, 12 bytes +On Board Device 1 Information + Type: Video + Status: Enabled + Description: Embedded Matrox G200 Video +On Board Device 2 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5716 NIC 1 +On Board Device 3 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5716 NIC 2 +On Board Device 4 Information + Type: SAS Controller + Status: Enabled + Description: Integrated SAS Controller + +Handle 0x0B00, DMI type 11, 5 bytes +OEM Strings + String 1: Dell System + String 2: 5[0000] + +Handle 0x7E00, DMI type 126, 154 bytes +Inactive + +Handle 0x0C00, DMI type 12, 5 bytes +System Configuration Options + Option 1: NVRAM_CLR: Clear user settable NVRAM areas and set defaults + Option 2: PWRD_EN: Close to enable password + +Handle 0x0D00, DMI type 13, 22 bytes +BIOS Language Information + Language Description Format: Long + Installable Languages: 1 + en|US|iso8859-1 + Currently Installed Language: en|US|iso8859-1 + +Handle 0x1000, DMI type 16, 15 bytes +Physical Memory Array + Location: System Board Or Motherboard + Use: System Memory + Error Correction Type: Multi-bit ECC + Maximum Capacity: 32 GB + Error Information Handle: Not Provided + Number Of Devices: 6 + +Handle 0x1100, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 2048 MB + Form Factor: DIMM + Set: 1 + Locator: DIMM_A1 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous Unbuffered (Unregistered) + Speed: 1333 MHz + Manufacturer: 00CE000080CE + Serial Number: 851C0D08 + Asset Tag: 02101800 + Part Number: M391B5673EH1-CH9 + Rank: 2 + +Handle 0x1101, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 2048 MB + Form Factor: DIMM + Set: 1 + Locator: DIMM_A2 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous Unbuffered (Unregistered) + Speed: 1333 MHz + Manufacturer: 00CE000080CE + Serial Number: 851C0DF9 + Asset Tag: 02101800 + Part Number: M391B5673EH1-CH9 + Rank: 2 + +Handle 0x1102, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 2048 MB + Form Factor: DIMM + Set: 2 + Locator: DIMM_A3 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous Unbuffered (Unregistered) + Speed: 1333 MHz + Manufacturer: 00CE000080CE + Serial Number: 851C0D7E + Asset Tag: 02101800 + Part Number: M391B5673EH1-CH9 + Rank: 2 + +Handle 0x1103, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 2048 MB + Form Factor: DIMM + Set: 2 + Locator: DIMM_A4 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous Unbuffered (Unregistered) + Speed: 1333 MHz + Manufacturer: 00CE000080CE + Serial Number: 851C0DE9 + Asset Tag: 02101800 + Part Number: M391B5673EH1-CH9 + Rank: 2 + +Handle 0x1104, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: No Module Installed + Form Factor: DIMM + Set: 3 + Locator: DIMM_A5 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous + Speed: Unknown + Manufacturer: + Serial Number: + Asset Tag: + Part Number: + Rank: Unknown + +Handle 0x1105, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: No Module Installed + Form Factor: DIMM + Set: 3 + Locator: DIMM_A6 + Bank Locator: Not Specified + Type: DDR3 + Type Detail: Synchronous + Speed: Unknown + Manufacturer: + Serial Number: + Asset Tag: + Part Number: + Rank: Unknown + +Handle 0x1300, DMI type 19, 15 bytes +Memory Array Mapped Address + Starting Address: 0x00000000000 + Ending Address: 0x000BFFFFFFF + Range Size: 3 GB + Physical Array Handle: 0x1000 + Partition Width: 2 + +Handle 0x1301, DMI type 19, 15 bytes +Memory Array Mapped Address + Starting Address: 0x00100000000 + Ending Address: 0x0023FFFFFFF + Range Size: 5 GB + Physical Array Handle: 0x1000 + Partition Width: 2 + +Handle 0x2000, DMI type 32, 11 bytes +System Boot Information + Status: No errors detected + +Handle 0x2600, DMI type 38, 18 bytes +IPMI Device Information + Interface Type: KCS (Keyboard Control Style) + Specification Version: 2.0 + I2C Slave Address: 0x10 + NV Storage Device: Not Present + Base Address: 0x0000000000000CA8 (I/O) + Register Spacing: 32-bit Boundaries + +Handle 0x2900, DMI type 41, 11 bytes +Onboard Device + Reference Designation: Embedded NIC 1 + Type: Ethernet + Status: Enabled + Type Instance: 1 + Bus Address: 0000:02:00.0 + +Handle 0x2901, DMI type 41, 11 bytes +Onboard Device + Reference Designation: Embedded NIC 2 + Type: Ethernet + Status: Enabled + Type Instance: 2 + Bus Address: 0000:02:00.1 + +Handle 0x2902, DMI type 41, 11 bytes +Onboard Device + Reference Designation: Integrated SAS + Type: SAS Controller + Status: Enabled + Type Instance: 4 + Bus Address: 0000:03:00.0 + +Handle 0x2903, DMI type 126, 11 bytes +Inactive + +Handle 0x2904, DMI type 41, 11 bytes +Onboard Device + Reference Designation: Embedded Video + Type: Video + Status: Enabled + Type Instance: 4 + Bus Address: 0000:01:03.0 + +Handle 0xD000, DMI type 208, 16 bytes +OEM-specific Type + Header and Data: + D0 10 00 D0 02 00 FE 00 A3 02 00 00 00 01 00 00 + +Handle 0xD200, DMI type 210, 12 bytes +OEM-specific Type + Header and Data: + D2 0C 00 D2 F8 03 04 03 06 80 04 05 + +Handle 0xD400, DMI type 212, 87 bytes +OEM-specific Type + Header and Data: + D4 57 00 D4 70 00 71 00 00 10 2D 2E 42 00 11 FE + 01 43 00 11 FE 00 70 01 11 9F 20 6F 01 11 9F 00 + 00 00 11 9F 20 00 00 11 9F 00 31 40 11 FB 00 32 + 40 11 FB 04 9D 00 11 FD 02 9E 00 11 FD 00 9F 00 + 26 FE 01 A0 00 26 FE 00 28 40 26 DF 20 29 40 26 + DF 00 FF FF 00 00 00 + +Handle 0xD401, DMI type 212, 242 bytes +OEM-specific Type + Header and Data: + D4 F2 01 D4 70 00 71 00 03 40 5A 6D 5C 00 78 BF + 40 5D 00 78 BF 00 6C 01 57 FC 00 6B 01 57 FC 01 + 6A 01 57 FC 02 12 02 57 EF 00 11 02 57 EF 10 77 + 01 54 FC 00 78 01 54 FC 01 79 01 54 FC 02 7A 01 + 54 FC 03 33 40 54 CF 00 34 40 54 CF 10 35 40 54 + CF 20 36 40 54 CF 30 1A 40 54 FB 04 1B 40 54 FB + 00 1C 40 54 F7 08 1D 40 54 F7 00 43 40 58 DF 20 + 42 40 58 DF 00 24 40 58 BF 40 25 40 58 BF 00 6E + 00 58 FC 01 2D 00 58 FC 02 DA 01 58 FC 03 22 40 + 58 EF 10 23 40 58 EF 00 BB 00 58 F3 04 BC 00 58 + F3 08 DB 01 58 F3 0C 2D 02 55 FE 01 2E 02 55 FE + 00 D8 00 55 7F 80 D9 00 55 7F 00 54 02 56 DF 00 + 57 02 56 DF 20 4D 02 56 BF 00 4E 02 56 BF 40 2D + 01 56 7F 80 2E 01 56 7F 00 00 C0 5C 00 0A 03 C0 + 67 00 05 83 00 76 00 00 84 00 77 00 00 FF FF 00 + 00 00 + +Handle 0xD402, DMI type 212, 172 bytes +OEM-specific Type + Header and Data: + D4 AC 02 D4 72 00 73 00 00 40 5D 5E D3 00 00 00 + 02 D4 00 02 00 02 4A 01 46 BF 40 4B 01 46 BF 00 + 00 90 2C 00 00 01 90 2D 00 00 DE 00 63 FE 01 26 + 40 42 FE 01 27 40 42 FE 00 17 01 4A FE 00 18 01 + 4A FE 01 19 01 4A FD 00 1A 01 4A FD 02 1B 01 4A + FB 00 1C 01 4A FB 04 1D 01 4A F7 00 1E 01 4A F7 + 08 1F 01 44 FE 00 20 01 44 FE 01 21 01 44 FD 00 + 22 01 44 FD 02 35 01 4B FC 00 37 01 4B FC 01 39 + 01 4B FC 02 3B 01 4B F3 04 02 40 46 DF 00 01 40 + 46 DF 20 FC 01 45 BF 00 FD 01 45 BF 40 00 00 45 + 7F 80 00 00 45 7F 00 FF FF 00 00 00 + +Handle 0xD403, DMI type 212, 97 bytes +OEM-specific Type + Header and Data: + D4 61 03 D4 72 00 73 00 00 40 5D 5E D1 00 46 FE + 00 D2 00 46 FE 01 40 01 47 EF 10 41 01 47 EF 00 + EB 01 47 FD 00 EA 01 47 FD 02 33 02 47 F3 04 32 + 02 47 F3 08 31 02 47 F3 00 6E 02 47 F3 00 4B 02 + 47 DF 00 4C 02 47 DF 20 44 01 4E CF 00 45 01 4E + CF 10 4A 02 4E F3 04 0C 80 4E F3 08 FF FF 00 00 + 00 + +Handle 0xD800, DMI type 216, 9 bytes +OEM-specific Type + Header and Data: + D8 09 00 D8 01 02 01 00 00 + Strings: + MATROX + VGA/VBE BIOS, Version V3.8WO + +Handle 0xDE00, DMI type 222, 16 bytes +OEM-specific Type + Header and Data: + DE 10 00 DE 01 08 FF FF 00 00 00 00 00 00 00 01 + +Handle 0x7F00, DMI type 127, 4 bytes +End Of Table + diff --git a/hwinfo/host/tests/test_dmidecode.py b/hwinfo/host/tests/test_dmidecode.py new file mode 100644 index 0000000..34419ce --- /dev/null +++ b/hwinfo/host/tests/test_dmidecode.py @@ -0,0 +1,52 @@ +"""Module for unittesting dmidecode methods""" + +import unittest +from hwinfo.host.dmidecode import * + +DATA_DIR = 'hwinfo/host/tests/data' + +class DmidecodeParserTests(unittest.TestCase): + + DATA_FILE = "%s/%s" % (DATA_DIR, 'dmidecode') + + DATA_REC = { + 'bios_vendor_name': 'Dell Inc.', + 'bios_version': '1.0.0', + 'bios_release_date': '02/11/2010', + 'system_manufacturer': 'Dell Inc.', + 'system_product_name': 'PowerEdge R310', + 'system_serial_number': 'GZ7BS4J', + 'system_uuid': '4C4C4544-005A-3710-8042-C7C04F53344A', + } + + + def setUp(self): + fh = open(self.DATA_FILE) + data = fh.read() + fh.close() + self.parser = DmidecodeParser(data) + + def _assert_equal(self, key): + rec = self.parser.parse() + return self.assertEqual(rec[key], self.DATA_REC[key]) + + def test_dmidecode_bios_vendor_name(self): + return self._assert_equal('bios_vendor_name') + + def test_dmidecode_bios_version(self): + return self._assert_equal('bios_version') + + def test_dmidecode_bios_release_date(self): + return self._assert_equal('bios_release_date') + + def test_dmidecode_system_manufacturer(self): + return self._assert_equal('system_manufacturer') + + def test_dmidecode_system_product_name(self): + return self._assert_equal('system_product_name') + + def test_dmidecode_system_serial_number(self): + return self._assert_equal('system_serial_number') + + def test_dmidecode_system_uuid(self): + return self._assert_equal('system_uuid')