Exemplo n.º 1
0
def testDomainCapabilitiesx86():
    xml = open(DATADIR + "/kvm-x86_64-domcaps.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

    assert caps.machine == "pc-i440fx-6.1"
    assert caps.arch == "x86_64"
    assert caps.domain == "kvm"
    assert caps.path == "/usr/bin/qemu-system-x86_64"

    custom_mode = caps.cpu.get_mode("custom")
    assert bool(custom_mode)
    cpu_model = custom_mode.get_model("Opteron_G4")
    assert bool(cpu_model)
    assert cpu_model.usable

    models = caps.get_cpu_models()
    assert len(models) > 10
    assert "SandyBridge" in models

    assert caps.label_for_firmware_path(None) == "BIOS"
    assert "Custom:" in caps.label_for_firmware_path("/foobar")
    assert "UEFI" in caps.label_for_firmware_path("OVMF")

    assert caps.supports_filesystem_virtiofs()
    assert caps.supports_memorybacking_memfd()
Exemplo n.º 2
0
    def testDomainCapabilitiesx86(self):
        xml = open(DATADIR + "/kvm-x86_64-domcaps.xml").read()
        caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

        self.assertEqual(caps.machine, "pc-i440fx-2.1")
        self.assertEqual(caps.arch, "x86_64")
        self.assertEqual(caps.domain, "kvm")
        self.assertEqual(caps.path, "/bin/qemu-system-x86_64")

        custom_mode = caps.cpu.get_mode("custom")
        self.assertTrue(bool(custom_mode))
        cpu_model = custom_mode.get_model("Opteron_G4")
        self.assertTrue(bool(cpu_model))
        self.assertTrue(cpu_model.usable)

        models = caps.get_cpu_models()
        assert len(models) > 10
        assert "SandyBridge" in models

        assert caps.label_for_firmware_path(None) == "BIOS"
        assert "Custom:" in caps.label_for_firmware_path("/foobar")
        assert "UEFI" in caps.label_for_firmware_path("OVMF")
Exemplo n.º 3
0
def testDomainCapabilitiesx86():
    xml = open(DATADIR + "/kvm-x86_64-domcaps-latest.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

    custom_mode = caps.cpu.get_mode("custom")
    assert bool(custom_mode)
    cpu_model = custom_mode.get_model("Opteron_G4")
    assert bool(cpu_model)
    assert cpu_model.usable

    models = caps.get_cpu_models()
    assert len(models) > 10
    assert "SandyBridge" in models

    assert caps.label_for_firmware_path(None) == "BIOS"
    assert "Custom:" in caps.label_for_firmware_path("/foobar")
    assert "UEFI" in caps.label_for_firmware_path("OVMF")

    assert caps.supports_filesystem_virtiofs()
    assert caps.supports_memorybacking_memfd()

    xml = open(DATADIR + "/kvm-x86_64-domcaps-amd-sev.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)
    assert caps.supports_sev_launch_security()