示例#1
0
def test__missing_dmi_type16():
    expected_result = {
        'ecc-memory': '',
        'baseboard-manufacturer': 'Supermicro',
        'baseboard-product-name': 'X11SPH-nCTPF',
        'system-manufacturer': 'QEMU',
        'system-product-name': 'Standard PC (Q35 + ICH9, 2009)',
        'system-serial-number': 'Not Specified',
        'system-version': 'pc-q35-5.2',
    }
    obj = SystemService(Service)
    obj._parse_dmi(missing_dmi_type16)
    assert obj.CACHE == expected_result
示例#2
0
def test__missing_dmi_type1():
    expected_result = {
        'ecc-memory': True,
        'baseboard-manufacturer': 'Supermicro',
        'baseboard-product-name': 'X11SPH-nCTPF',
        'system-manufacturer': '',
        'system-product-name': '',
        'system-serial-number': '',
        'system-version': '',
    }
    obj = SystemService(Service)
    obj._parse_dmi(missing_dmi_type1)
    assert obj.CACHE == expected_result
示例#3
0
def test__missing_dmi():
    expected_result = {
        'ecc-memory': '',
        'baseboard-manufacturer': '',
        'baseboard-product-name': '',
        'system-manufacturer': '',
        'system-product-name': '',
        'system-serial-number': '',
        'system-version': '',
    }
    obj = SystemService(Service)
    obj._parse_dmi(missing_dmi)
    assert obj.CACHE == expected_result
示例#4
0
def test__double_colon_dmi():
    expected_result = {
        'ecc-memory': True,
        'baseboard-manufacturer': 'Supermicro',
        'baseboard-product-name': 'X9DRi-LN4+/X9DR3-LN4+',
        'system-manufacturer': 'Supermicro',
        'system-product-name': 'X9DRi-LN4+/X9DR3-LN4+',
        'system-serial-number': '0123456789',
        'system-version': '0123456789',
    }
    obj = SystemService(Service)
    obj._parse_dmi(double_colon_dmi)
    assert obj.CACHE == expected_result
示例#5
0
def test__full_dmi():
    expected_result = {
        'ecc-memory': True,
        'baseboard-manufacturer': 'Supermicro',
        'baseboard-product-name': 'X11SPH-nCTPF',
        'system-manufacturer': 'iXsystems',
        'system-product-name': 'TRUENAS-M60',
        'system-serial-number': 'A1-111111',
        'system-version': '0123456789',
    }
    obj = SystemService(Service)
    obj._parse_dmi(full_dmi)
    assert obj.CACHE == expected_result
示例#6
0
def test__missing_dmi_type2():
    expected_result = {
        'bios-release-date': '',
        'ecc-memory': True,
        'baseboard-manufacturer': '',
        'baseboard-product-name': '',
        'system-manufacturer': 'QEMU',
        'system-product-name': 'Standard PC (Q35 + ICH9, 2009)',
        'system-serial-number': 'Not Specified',
        'system-version': 'pc-q35-5.2',
    }
    obj = SystemService(Service)
    obj._parse_dmi(missing_dmi_type2)
    assert obj.CACHE == expected_result