def test_is_bare_metal():
    virt_what = VirtWhat(None, VWP(context_wrap("")))
    result = IsBareMetal(virt_what)
    assert isinstance(result, IsBareMetal)

    virt_what = VirtWhat(None, VWP(context_wrap("kvm")))
    with pytest.raises(SkipComponent):
        IsBareMetal(virt_what)
Exemplo n.º 2
0
def test_dmidecode_is_rhev():
    dmi = DMIDecode(context_wrap(DMIDECODE_BOGUS_OVIRT))
    ret = VirtWhat(dmi, None)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "kvm"
    assert ret.amended_generic == "rhev"
Exemplo n.º 3
0
def test_virtwhat_only():
    vw = VWP(context_wrap(T5))
    ret = VirtWhat(None, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "ovirt"
    assert ret.amended_generic == "ovirt"
Exemplo n.º 4
0
def test_vw_dmidecode_2():
    vw = VWP(context_wrap(T4))
    dmi = DMIDecode(context_wrap(DMIDECODE))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is False
    assert ret.is_physical is True
    assert ret.generic == "baremetal"
Exemplo n.º 5
0
def test_vw_virt_what_1():
    vw = VWP(context_wrap(T1))
    dmi = DMIDecode(context_wrap(DMIDECODE_AWS))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "kvm"
Exemplo n.º 6
0
def test_vw_dmidecode_is_rhev():
    vw = VWP(context_wrap(T5))
    dmi = DMIDecode(context_wrap(DMIDECODE_BOGUS_OVIRT))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "ovirt"
    assert ret.amended_generic == "rhev"
Exemplo n.º 7
0
def test_vw_dmidecode_4():
    vw = VWP(context_wrap(T4))
    dmi = DMIDecode(context_wrap(DMIDECODE_KVM))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "kvm"
    assert ret.amended_generic == "rhev"
Exemplo n.º 8
0
def test_vw_dmidecode_1():
    vw = VWP(context_wrap(T4))
    dmi = DMIDecode(context_wrap(DMIDECODE_AWS))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "xen"
    assert 'aws' in ret
Exemplo n.º 9
0
def test_vw_virt_what_specific():
    vw = VWP(context_wrap(T3))
    dmi = DMIDecode(context_wrap(DMIDECODE_AWS))
    ret = VirtWhat(dmi, vw)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "xen"
    assert 'xen-dom0' in ret
    assert 'aws' in ret
Exemplo n.º 10
0
def test_vw_dmidecode_5():
    dmi = DMIDecode(context_wrap(DMIDECODE_KVM))
    ret = VirtWhat(dmi, None)
    assert ret.is_virtual is True
    assert ret.is_physical is False
    assert ret.generic == "kvm"