def test_net_with_connectors_too_many(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) baseboard = read_dmidecode._get_connectors( read_file(filedir, "connector.txt"), baseboard) expect = [{ "type": "motherboard", "working": "yes", "brand": "ASUSTeK Computer INC.", "model": "P6T DELUXE V2", "sn": "723627130020069", "ps2-ports-n": 1, "usb-ports-n": 7, "firewire-ports-n": 3, "ide-ports-n": 1, "sata-ports-n": 6, "mini-jack-ports-n": 7, "ethernet-ports-1000m-n": 3, "mac": "00:c0:11:fe:fe:11, 00:c0:11:fe:fe:22, 00:c0:11:fe:fe:42", "sas-sata-ports-n": 2, "notes": "Unknown connector: None / Other (AUDIO / AUDIO)", }] output = read_dmidecode._get_net(read_file(filedir, "net_too_many.txt"), baseboard) assert output == expect
def test_connector(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) expect = { "type": "motherboard", "working": "yes", "brand": "ASUSTeK Computer INC.", "model": "P5VD2-VM", "sn": "123456789000", "serial-ports-n": 1, "parallel-ports-n": 1, "usb-ports-n": 8, "ps2-ports-n": 2, "sata-ports-n": 3, "esata-ports-n": 1, "vga-ports-n": 1, "ethernet-ports-n": 1, "mini-jack-ports-n": 3, "ide-ports-n": 2, "notes": "Unknown connector: None / None (SPDIF_OUT / SPDIF_OUT)", } output = read_dmidecode._get_connectors( read_file(filedir, "connector.txt"), baseboard) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "SiS", "model": "65x/M650/740", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_77_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand-manufacturer": "SiS", "brand": "ASUSTeK Computer Inc.", "model": "771/671", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "Lenovo", "model": "Mobile 4 Series Chipset", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "Microsoft Corporation", "model": "HD Graphics 515", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): # VGA core graphics processor core VGA processor graphics core VGA processor is the core of this laptop expect = [{ "type": "graphics-card", "working": "yes", "brand": "Lenovo 3rd Gen Core processor Graphics Controller", "model": "VGA controller", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "ASUSTeK Computer Inc.", "model": "S3 UniChrome Pro", "internal-name": "P4M890", "brand-manufacturer": "VIA", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand-manufacturer": "AMD/ATI", "brand": "Apple Inc. Radeon Pro 560X", "model": "Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X", "capacity-byte": 4294967296, }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand-manufacturer": "AMD/ATI", "brand": "PC Partner Limited / Sapphire Technology Tahiti PRO", "model": "Radeon HD 7950/8950 OEM / R9 280", "capacity-byte": 3221225472, }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_connector(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) expect = { "type": "motherboard", "working": "yes", "brand": "Microsoft Corporation", "model": "Surface Pro 4", "sn": "A01012111654643A", } output = read_dmidecode._get_connectors( read_file(filedir, "connector.txt"), baseboard) assert output == expect
def test_lspci_integrated(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "Hewlett-Packard Company", "model": "82945G/GZ", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, read_file(filedir, "82945G/lspci.txt"), read_file(filedir, "82945G/glxinfo.txt"), ) assert output == expect
def test_connector(): baseboard = read_dmidecode._get_baseboard(read_file(filedir, "baseboard.txt")) # This is entirely wrong and is not reflected by any means from reality and the real motherboard, but the manufacturer # dropped all this garbage into the DMI information, so here we go... expect = { "type": "motherboard", "working": "yes", "brand": "ASRock", "model": "H110M-ITX/ac", "sn": "M80-69017400518", } output = read_dmidecode._get_connectors(read_file(filedir, "connector.txt"), baseboard) assert output == expect
def test_lspci(): expect = [{ "type": "graphics-card", "working": "yes", "brand-manufacturer": "Nvidia", "brand": "Apple Inc.", "internal-name": "GK107M", "model": "GeForce GT 750M Mac Edition", "capacity-byte": 2147483648, }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_lspci(): expect = [{ "brand": "ASUSTeK Computer Inc.", "brand-manufacturer": "Nvidia", "capacity-byte": 1073741824, "internal-name": "GF106", "model": "GeForce GTS 450", "type": "graphics-card", "working": "yes", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "lspci.txt"), read_file(filedir, "glxinfo.txt")) assert output == expect
def test_ecc_ram2(): expect = [ { "type": "ram", "working": "yes", "brand": "Kingston", "sn": "2853609420", "frequency-hertz": 667000000, "capacity-byte": 1073741824, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, { "type": "ram", "working": "yes", "brand": "Kingston", "sn": "2836829644", "frequency-hertz": 667000000, "capacity-byte": 1073741824, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, ] output = read_decode_dimms.parse_decode_dimms( read_file(filedir, "ECC/R480-R479.txt")) assert output == expect
def test_ecc_ram1_not_an_hex(): expect = [ { "type": "ram", "working": "yes", "brand": "Kingston", "model": "K", "sn": "0F00xb4r", "frequency-hertz": 667000000, "capacity-byte": 2147483648, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, { "type": "ram", "working": "yes", "brand": "Kingston", "model": "K", "sn": "0xCA33B3RC", "frequency-hertz": 667000000, "capacity-byte": 2147483648, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, ] output = read_decode_dimms.parse_decode_dimms( read_file(filedir, "ECC/R451-R450-notanhex.txt")) assert output == expect
def test_lscpu(): expect = [ { "type": "cpu", "working": "yes", "isa": "x86-64", "model": "Xeon 5160", "brand": "Intel", "core-n": 2, "thread-n": 2, "frequency-hertz": 3000000000, }, { "type": "cpu", "working": "yes", "isa": "x86-64", "model": "Xeon 5160", "brand": "Intel", "core-n": 2, "thread-n": 2, "frequency-hertz": 3000000000, }, ] output = read_lscpu.parse_lscpu(read_file(filedir, "lscpu.txt")) assert isinstance(expect, list) assert len(expect) == 2 assert output == expect
def test_ram(): expect = [ { "brand": "Micron Technology", "capacity-byte": 8589934592, "frequency-hertz": 1600000000, "model": "CT102464BA160B.C16", "ram-ecc": "no", "ram-timings": "11-11-11-28", "ram-type": "ddr3", "sn": "1949761536", "type": "ram", "working": "yes", }, { "brand": "Micron Technology", "capacity-byte": 8589934592, "frequency-hertz": 1600000000, "model": "CT102464BA160B.C16", "ram-ecc": "no", "ram-timings": "11-11-11-28", "ram-type": "ddr3", "sn": "2172780544", "type": "ram", "working": "yes", }, ] output = read_decode_dimms.parse_decode_dimms( read_file(filedir, "dimms.txt")) assert len(output) == 2, "2 RAM modules are found" assert output == expect
def test_net_without_connectors(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) expect = [{ "type": "motherboard", "working": "yes", "brand": "ASUSTeK Computer INC.", "model": "P6T DELUXE V2", "sn": "723627130020069", "ethernet-ports-1000m-n": 2, "mac": "00:c0:11:fe:fe:11, 00:c0:11:fe:fe:22", }] output = read_dmidecode._get_net(read_file(filedir, "net.txt"), baseboard) assert output == expect
def test_ram(): expect = [ { "ram-ecc": "no", "ram-type": "ddr3", "brand": "G Skill Intl", "capacity-byte": 8589934592, "frequency-hertz": 1333000000, "model": "F3-1600C7-8GTX", "type": "ram", "working": "yes", "ram-timings": "9-9-9-24", }, { "ram-ecc": "no", "ram-type": "ddr3", "brand": "G Skill Intl", "capacity-byte": 8589934592, "frequency-hertz": 1333000000, "model": "F3-1600C7-8GTX", "type": "ram", "working": "yes", "ram-timings": "9-9-9-24", }, ] output = read_decode_dimms.parse_decode_dimms( read_file(filedir, "dimms.txt")) assert len(output) == 2, "2 RAM modules are found" assert output == expect
def test_ecc_ram1(): expect = [ { "type": "ram", "working": "yes", "brand": "Kingston", "model": "K", "sn": "3375612524", "frequency-hertz": 667000000, "capacity-byte": 2147483648, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, { "type": "ram", "working": "yes", "brand": "Kingston", "model": "K", "sn": "3392385900", "frequency-hertz": 667000000, "capacity-byte": 2147483648, "ram-type": "ddr2", "ram-ecc": "yes", "ram-timings": "5-5-5-15", }, ] output = read_decode_dimms.parse_decode_dimms( read_file(filedir, "ECC/R451-R450.txt")) assert output == expect
def test_connector(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) expect = { "type": "motherboard", "working": "yes", "brand": "Intel Corporation", "model": "D975XBX2", "sn": "BAOB4B9001YY", "ide-ports-n": 2, } output = read_dmidecode._get_connectors( read_file(filedir, "connector.txt"), baseboard) assert output == expect
def test_lspci_dedicated3(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "ASUSTeK Computer Inc.", "internal-name": "GM204", "model": "GeForce GTX 970", "capacity-byte": 4294967296, "brand-manufacturer": "Nvidia", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "dedicated/lspci-gtx-970.txt"), read_file(filedir, "dedicated/glxinfo-gtx-970.txt"), ) assert output == expect
def test_lspci_dedicated2(): expect = [{ "type": "graphics-card", "working": "yes", "brand": "ASUSTeK Computer Inc.", "internal-name": "G96", "model": "GeForce 9400 GT", "capacity-byte": 1073741824, "brand-manufacturer": "Nvidia", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( True, read_file(filedir, "dedicated/lspci-9400GT.txt"), read_file(filedir, "dedicated/glxinfo-9400GT.txt"), ) assert output == expect
def test_lspci_integrated_cpu_3(): filesubdir = "integrated/on-cpu/Xeon/" expect = [{ "type": "graphics-card", "working": "yes", "brand": "ASRock Incorporation", "model": "Xeon E3-1200 v3/4th Gen Core Processor", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, os.path.join(read_file(filedir, f"{filesubdir}/lspci.txt")), os.path.join(read_file(filedir, f"{filesubdir}/glxinfo.txt")), ) assert output == expect
def test_lspci_integrated_cpu_1(): filesubdir = "integrated/on-cpu/Acer Swift 3/" expect = [{ "type": "graphics-card", "working": "yes", "brand": "Acer Incorporated", "model": "Skylake GT2 [HD Graphics 520]", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, os.path.join(read_file(filedir, f"{filesubdir}/lspci.txt")), os.path.join(read_file(filedir, f"{filesubdir}/glxinfo.txt")), ) assert output == expect
def test_chassis(): # At least it's not assuming stuff it cannot know... expect = [{ "type": "case", }] output = read_dmidecode.parse_case(read_file(filedir, "chassis.txt")) assert output == expect
def test_lspci_integrated_cpu_2(): filesubdir = "integrated/on-cpu/HP EliteBook 2540p (i5 M540)/" # Yeeeeah, nice and detailed - not. expect = [{ "type": "graphics-card", "working": "yes", "brand": "Hewlett-Packard Company Core Processor", "brand-manufacturer": "Intel", }] output = read_lspci_and_glxinfo.parse_lspci_and_glxinfo( False, os.path.join(read_file(filedir, f"{filesubdir}/lspci.txt")), os.path.join(read_file(filedir, f"{filesubdir}/glxinfo.txt")), ) assert output == expect
def test_connector(): baseboard = read_dmidecode._get_baseboard( read_file(filedir, "baseboard.txt")) expect = { "type": "motherboard", "working": "yes", "brand": "Matsonic", "model": "MS8318E", "sn": "00000000", "parallel-ports-n": 1, } output = read_dmidecode._get_connectors( read_file(filedir, "connector.txt"), baseboard) assert output == expect