def test_fru_empty(self): data = { ('fru', 'print'): '', } session = ipmi.IPMI('localhost') session.tool = lambda c, s: data.get((c, s)) fru = session.get_fru() self.assertEqual(fru, {})
def test_fru_thomas_krenn(self): session = ipmi.IPMI('localhost') session.tool = lambda c, s: self.DATA_KRENN.get((c, s)) fru = session.get_fru() self.assertEqual(fru, { 'Builtin FRU Device': { 'Board Serial': '', 'Product Part Number': 'SC113TQ', 'Product Serial': '9000078907', 'Board Part Number': 'Winbond Hermon', 'Product Manufacturer': 'Thomas-Krenn.AG', 'Chassis Type': 'Unknown', 'Chassis Part Number': 'SC113TQ-R650CB', 'Product Name': '1HE Supermicro SC113TQ-R650CB', 'Board Product': 'X8DT3-LN4F', None: 'FRU Device Description', 'Board Mfg': 'Super Micro', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996' } })
def test_components(self): session = ipmi.IPMI('localhost') session.tool = lambda c, s: self.DATA_SUN.get((c, s)) fru = session.get_fru() dev = Device.create(sn='00010101', model_name='Sun Fire', model_type=DeviceType.rack_server, priority=0) ipmi._add_ipmi_components(dev, fru) cpus = dev.processor_set.all() self.assertEquals(len(cpus), 1) self.assertEquals(cpus[0].index, 1) self.assertEquals(cpus[0].model.name, 'CPU Intel(R) Xeon(R) Cpu L5520 @ 2.27Ghz 2270MHz 0') self.assertEquals(cpus[0].label, 'Intel(R) Xeon(R) Cpu L5520 @ 2.27Ghz') mem = dev.memory_set.all() sizes = [m.size or m.model.size for m in mem] self.assertEquals(sizes, [4096] * 6) labels = [m.label for m in mem] self.assertEquals(labels, ['4GB DDR3 SDRAM 666'] * 6)
def test_fru_sun_fire(self): session = ipmi.IPMI('localhost') session.tool = lambda c, s: self.DATA_SUN.get((c, s)) fru = session.get_fru() self.assertEqual( fru, { '/SYS': { None: 'FRU Device Description', 'Board Extra': 'X4170/4270/4275', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '501-7917-11', 'Board Product': 'ASSY,MOTHERBOARD,X4170/X4270/X4275', 'Board Serial': '9328MSL-09304H08BT', 'Product Extra': '080020FFFFFFFFFFFFFF00144FE79268', 'Product Manufacturer': 'ORACLE CORPORATION', 'Product Name': 'SUN FIRE X4270 SERVER', 'Product Part Number': '4457207-6', 'Product Serial': '0936XF707F' }, '/UUID': { None: 'FRU Device Description', 'Product Extra': '080020FFFFFFFFFFFFFF00144FE79268' }, 'Builtin FRU Device': { None: 'FRU Device Description', 'Product Manufacturer': 'Oracle Corporation', 'Product Name': 'ILOM INTEGRATED SP', 'Product Serial': '00:11:22:33:44:55' }, 'CPLD': { None: 'FRU Device Description', 'Product Name': 'CPLD', 'Product Version': 'FW:1.6' }, 'DBP': { None: 'FRU Device Description', 'Board Extra': 'SASBP', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '511-1257-02', 'Board Product': 'BD,SATA,16DSK,BKPL,2U', 'Board Serial': 'A3921H' }, 'DBP/HDD0': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD1': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD10': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD11': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD12': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD13': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD14': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD15': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD2': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD3': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD4': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD5': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD6': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD7': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD8': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'DBP/HDD9': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'FB0': { None: 'FRU Device Description', 'Board Extra': 'FANBD', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '541-2211-04', 'Board Product': 'ASY,FAN,BOARD,H2M2G2', 'Board Serial': '9226LHF-0930B301H3' }, 'FB1': { None: 'FRU Device Description', 'Board Extra': 'FANBD', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '541-2211-04', 'Board Product': 'ASY,FAN,BOARD,H2M2G2', 'Board Serial': '9226LHF-0930B301H5' }, 'MB': { None: 'FRU Device Description', 'Board Extra': 'X4170/4270/4275', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '501-7917-11', 'Board Product': 'ASSY,MOTHERBOARD,X4170/X4270/X4275', 'Board Serial': '9328MSL-09304H08BT', 'Product Extra': '080020FFFFFFFFFFFFFF00144FE79268', 'Product Manufacturer': 'ORACLE CORPORATION', 'Product Name': 'SUN FIRE X4270 SERVER', 'Product Part Number': '4457207-6', 'Product Serial': '9936XF707F' }, 'MB/BIOS': { None: 'FRU Device Description', 'Product Manufacturer': 'AMERICAN MEGATRENDS', 'Product Name': 'SYSTEM BIOS', 'Product Part Number': 'AMIBIOS8', 'Product Version': '07060304' }, 'MB/NET0': { None: 'FRU Device Description', 'Product Extra': '00:14:4F:E7:92:64', 'Product Manufacturer': 'INTEL', 'Product Name': 'GIGABIT ETHERNET CONTROLLERS', 'Product Part Number': '82575EB', 'Product Serial': '00:14:4F:E7:92:69' }, 'MB/NET1': { None: 'FRU Device Description', 'Product Extra': '00:14:4F:E7:92:65', 'Product Manufacturer': 'INTEL', 'Product Name': 'GIGABIT ETHERNET CONTROLLERS', 'Product Part Number': '82575EB', 'Product Serial': '00:14:4F:E7:92:69' }, 'MB/NET2': { None: 'FRU Device Description', 'Product Extra': '00:14:4F:E7:92:66', 'Product Manufacturer': 'INTEL', 'Product Name': 'GIGABIT ETHERNET CONTROLLERS', 'Product Part Number': '82575EB', 'Product Serial': '00:14:4F:E7:92:69' }, 'MB/NET3': { None: 'FRU Device Description', 'Product Extra': '00:14:4F:E7:92:67', 'Product Manufacturer': 'INTEL', 'Product Name': 'GIGABIT ETHERNET CONTROLLERS', 'Product Part Number': '82575EB', 'Product Serial': '00:14:4F:E7:92:69' }, 'MB/P0': { None: 'FRU Device Description', 'Product Manufacturer': 'INTEL', 'Product Name': 'INTEL(R) XEON(R) CPU L5520 @ 2.27GHZ', 'Product Part Number': '060A', 'Product Version': '05' }, 'MB/P0/D0': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P0/D1': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '42221369', 'Product Version': '00' }, 'MB/P0/D2': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '9222085A', 'Product Version': '00' }, 'MB/P0/D3': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P0/D4': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '922214AF', 'Product Version': '00' }, 'MB/P0/D5': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '922212FE', 'Product Version': '00' }, 'MB/P0/D6': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P0/D7': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '92221301', 'Product Version': '00' }, 'MB/P0/D8': { None: 'FRU Device Description', 'Product Manufacturer': 'SAMSUNG', 'Product Name': '4GB DDR3 SDRAM 666', 'Product Part Number': 'M393B5170EH1-CH9', 'Product Serial': '9221B058', 'Product Version': '00' }, 'MB/P1': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D0': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D1': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D2': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D3': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D4': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D5': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D6': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D7': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/P1/D8': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'MB/R1': { None: 'FRU Device Description', 'Board Extra': 'ACTIVE_RISER', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '511-1139-02', 'Board Product': 'ASSY,ACTIVE_RISER,X4270/X4275', 'Board Serial': '9328MSL-09275K04PC' }, 'MB/R2': { None: 'FRU Device Description', 'Board Extra': 'ACTIVE_RISER', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '511-1139-02', 'Board Product': 'ASSY,ACTIVE_RISER,X4270/X4275', 'Board Serial': '9328MSL-09275K04PD' }, 'PADCRD': { None: 'FRU Device Description', 'Board Extra': '2U Paddle', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '541-3513-02', 'Board Product': 'BD,SATA,2U,PADDLE_CARD', 'Board Serial': '9226LHF-09300001MG' }, 'PCIE1/F20CARD': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'PCIE2/F20CARD': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'PCIE4/F20CARD': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'PCIE5/F20CARD': { None: 'FRU Device Description', 'Device not present (Requested sensor, data, or record not found)': 'Device not present (Requested sensor, data, or record not found)' }, 'PDB': { None: 'FRU Device Description', 'Board Extra': 'PDB', 'Board Mfg Date': 'Mon Jan 1 00:00:00 1996', 'Board Part Number': '541-2073-09', 'Board Product': 'PDB,H+V,BUS_BAR,2U', 'Board Serial': '9226LHF-0930B500MC', 'Product Part Number': '4457207-6', 'Product Serial': '9936XF707F' }, 'PS0': { None: 'FRU Device Description', 'Board Mfg': 'POWER ONE', 'Board Mfg Date': 'Wed Jun 24 19:44:00 2009', 'Board Part Number': '300-1897-04', 'Board Product': 'A217', 'Board Serial': '9908BAO-0926A30L9J' }, 'PS1': { None: 'FRU Device Description', 'Board Mfg': 'POWER ONE', 'Board Mfg Date': 'Tue Jun 9 20:01:00 2009', 'Board Part Number': '300-1897-04', 'Board Product': 'A217', 'Board Serial': '9908BAO-0924A30JG9' }, 'SP/NET0': { None: 'FRU Device Description', 'Product Manufacturer': 'ASPEED', 'Product Name': 'ETHERNET CONTROLLER', 'Product Part Number': 'AST2100', 'Product Serial': '00:14:4f:e7:92:69' }, 'SP/NET1': { None: 'FRU Device Description', 'Product Manufacturer': 'ASPEED', 'Product Name': 'ETHERNET CONTROLLER', 'Product Part Number': 'AST2100', 'Product Serial': '00:14:4f:e7:92:69' } })