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)
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"
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"
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"
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"
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"
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"
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
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
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"