Ejemplo n.º 1
0
    def testF11AC97(self):
        def build_guest():
            i = utils.make_distro_installer()
            g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

            g.os_type = "linux"
            g.os_variant = "fedora11"
            g.installer.cdrom = True
            g.add_device(utils.get_floppy())
            g.add_device(utils.get_filedisk())
            g.add_device(utils.get_blkdisk())
            g.add_device(utils.get_virtual_network())
            g.add_device(VirtualAudio(g.conn))
            return g

        utils.set_conn(utils.open_plainkvm(connver=11000))
        g = build_guest()
        self._compare(g, "install-f11-ac97", False)

        utils.set_conn(utils.open_plainkvm(libver=5000))
        g = build_guest()
        self._compare(g, "install-f11-noac97", False)

        utils.set_conn(utils.open_plainkvm(connver=10000))
        g = build_guest()
        self._compare(g, "install-f11-noac97", False)
Ejemplo n.º 2
0
    def testF11AC97(self):
        def build_guest():
            i = utils.make_distro_installer(gtype="kvm")
            g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

            g.os_type = "linux"
            g.os_variant = "fedora11"
            g.installer.cdrom = True
            g.add_device(utils.get_floppy())
            g.add_device(utils.get_filedisk())
            g.add_device(utils.get_blkdisk())
            g.add_device(utils.get_virtual_network())
            g.add_device(VirtualAudio())
            return g

        utils.set_conn(utils.open_plainkvm(connver=11000))
        g = build_guest()
        self._compare(g, "install-f11-ac97", False)

        oldver = libvirt.getVersion
        try:
            utils.set_conn(utils.open_plainkvm(libver=5000))
            g = build_guest()
            self._compare(g, "install-f11-noac97", False)
        finally:
            libvirt.getVersion = oldver

        utils.set_conn(utils.open_plainkvm(connver=10000))
        g = build_guest()
        self._compare(g, "install-f11-noac97", False)
Ejemplo n.º 3
0
    def testF11AC97(self):
        def build_guest():
            i = utils.make_distro_installer()
            g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

            g.os_variant = "fedora11"
            g.installer.cdrom = True
            g.add_device(utils.get_floppy())
            g.add_device(utils.get_filedisk())
            g.add_device(utils.get_blkdisk())
            g.add_device(utils.get_virtual_network())
            g.add_device(VirtualAudio(g.conn))
            return g

        utils.set_conn(utils.open_plainkvm(connver=11000))
        g = build_guest()
        self._compare(g, "install-f11-ac97", False)

        utils.set_conn(utils.open_plainkvm(libver=5000))
        g = build_guest()
        self._compare(g, "install-f11-noac97", False)

        utils.set_conn(utils.open_plainkvm(libver=7000, connver=7000))
        g = build_guest()
        self._compare(g, "install-f11-noac97", False)
Ejemplo n.º 4
0
    def testKVMKeymap(self):
        conn = utils.open_plainkvm(connver=10000)
        g = virtinst.VirtualGraphics(conn=conn, type="vnc")
        self.assertTrue(g.keymap is not None)

        conn = utils.open_plainkvm(connver=11000)
        g = virtinst.VirtualGraphics(conn=conn, type="vnc")
        self.assertTrue(g.keymap is None)
Ejemplo n.º 5
0
    def testOSDeviceDefaultChange(self):
        """
        Make sure device defaults are properly changed if we change OS
        distro/variant mid process
        """
        conn = utils.open_plainkvm(connver=12005)
        utils.set_conn(conn)

        i = utils.make_distro_installer()
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

        do_install = False
        g.installer.cdrom = True
        g.add_device(utils.get_floppy())
        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        g.add_device(VirtualAudio(g.conn))

        # Call get_xml_config sets first round of defaults w/o os_variant set
        g.get_install_xml(do_install)

        g.os_variant = "fedora11"
        self._compare(g, "install-f11-norheldefaults", do_install)

        try:
            virtinst.enable_rhel_defaults = True
            origemu = g.emulator
            g.emulator = "/usr/libexec/qemu-kvm"
            g.conn._support_cache = {}
            self._compare(g, "install-f11-rheldefaults", do_install)
            g.emulator = origemu
            g.conn._support_cache = {}
        finally:
            virtinst.enable_rhel_defaults = False

        # Verify main guest wasn't polluted
        self._compare(g, "install-f11-norheldefaults", do_install)
Ejemplo n.º 6
0
    def testOSDeviceDefaultChange(self):
        """
        Make sure device defaults are properly changed if we change OS
        distro/variant mid process
        """
        conn = utils.open_plainkvm(connver=12005)
        utils.set_conn(conn)

        i = utils.make_distro_installer()
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

        do_install = False
        g.installer.cdrom = True
        g.add_device(utils.get_floppy())
        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        g.add_device(VirtualAudio(g.conn))

        # Call get_xml_config sets first round of defaults w/o os_variant set
        g.get_install_xml(do_install)

        g.os_variant = "fedora11"
        self._compare(g, "install-f11-norheldefaults", do_install)

        try:
            virtinst.stable_defaults = True
            origemu = g.emulator
            g.emulator = "/usr/libexec/qemu-kvm"
            g.conn._support_cache = {}
            self._compare(g, "install-f11-rheldefaults", do_install)
            g.emulator = origemu
            g.conn._support_cache = {}
        finally:
            virtinst.stable_defaults = False

        # Verify main guest wasn't polluted
        self._compare(g, "install-f11-norheldefaults", do_install)
Ejemplo n.º 7
0
from virtinst import VirtualHostDevice
from virtinst import (VirtualChannelDevice, VirtualConsoleDevice,
                      VirtualParallelDevice, VirtualSerialDevice)
from virtinst import VirtualVideoDevice
from virtinst import VirtualController
from virtinst import VirtualWatchdog
from virtinst import VirtualMemballoon

from tests import utils

# pylint: disable=W0212
# Access to protected member, needed to unittest stuff

_testconn = utils.open_testdriver()
_kvmconn = utils.open_testkvmdriver()
_plainkvm = utils.open_plainkvm()
_plainxen = utils.open_plainxen()


def qemu_uri():
    return "qemu:///system"


def xen_uri():
    return "xen:///"


def build_xmlfile(filebase):
    if not filebase:
        return None
    return os.path.join("tests/xmlconfig-xml", filebase + ".xml")
Ejemplo n.º 8
0
from virtinst import VirtualHostDeviceUSB, VirtualHostDevicePCI
from virtinst import VirtualCharDevice
from virtinst import VirtualVideoDevice
from virtinst import VirtualController
from virtinst import VirtualWatchdog
from virtinst import VirtualInputDevice
from virtinst import VirtualMemballoon

from tests import utils

# pylint: disable=W0212
# Access to protected member, needed to unittest stuff

_testconn = utils.open_testdriver()
_kvmconn = utils.open_testkvmdriver()
_plainkvm = utils.open_plainkvm()
_plainxen = utils.open_plainxen()


def qemu_uri():
    return "qemu:///system"


def xen_uri():
    return "xen:///"


def build_xmlfile(filebase):
    if not filebase:
        return None
    return os.path.join("tests/xmlconfig-xml", filebase + ".xml")