Пример #1
0
def testDomainCapabilitiesAArch64():
    xml = open(DATADIR + "/kvm-aarch64-domcaps.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

    assert "Default" in caps.label_for_firmware_path(None)

    assert not caps.supports_filesystem_virtiofs()
    assert not caps.supports_memorybacking_memfd()
Пример #2
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()
Пример #3
0
def testDomainCapabilities():
    xml = open(DATADIR + "/test-domcaps.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

    assert caps.os.loader.supported is True
    assert caps.os.loader.get_values() == ["/foo/bar", "/tmp/my_path"]
    assert caps.os.loader.enum_names() == ["type", "readonly"]
    assert caps.os.loader.get_enum("type").get_values() == ["rom", "pflash"]
Пример #4
0
    def testDomainCapabilitiesx86(self):
        xml = open("tests/capabilities-xml/kvm-x86_64-domcaps.xml").read()
        caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

        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)
Пример #5
0
    def testDomainCapabilities(self):
        xml = open("tests/capabilities-xml/test-domcaps.xml").read()
        caps = DomainCapabilities(utils.open_testdriver(), xml)

        self.assertEqual(caps.os.loader.supported, True)
        self.assertEqual(caps.os.loader.get_values(),
                         ["/foo/bar", "/tmp/my_path"])
        self.assertEqual(caps.os.loader.enum_names(), ["type", "readonly"])
        self.assertEqual(
            caps.os.loader.get_enum("type").get_values(), ["rom", "pflash"])
Пример #6
0
def testDomainCapabilities():
    xml = open(DATADIR + "/test-domcaps.xml").read()
    caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

    assert caps.machine == "my-machine-type"
    assert caps.arch == "x86_64"
    assert caps.domain == "kvm"
    assert caps.path == "/bin/emulatorbin"

    assert caps.os.loader.supported is True
    assert caps.os.loader.get_values() == ["/foo/bar", "/tmp/my_path"]
    assert caps.os.loader.enum_names() == ["type", "readonly"]
    assert caps.os.loader.get_enum("type").get_values() == ["rom", "pflash"]
    assert caps.os.loader.get_enum("idontexist").get_values() == []
Пример #7
0
    def testDomainCapabilitiesx86(self):
        xml = open("tests/capabilities-xml/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)
Пример #8
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")
Пример #9
0
    def testDomainCapabilitiesAArch64(self):
        xml = open(DATADIR + "/kvm-aarch64-domcaps.xml").read()
        caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

        assert "None" in caps.label_for_firmware_path(None)
Пример #10
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()