Esempio n. 1
0
    def testInstallParavirtManyDisks(self):
        g = utils.get_basic_paravirt_guest()
        disk = utils.get_filedisk("/tmp/test2.img")
        disk.driver_name = VirtualDisk.DRIVER_TAP
        disk.driver_type = VirtualDisk.DRIVER_TAP_QCOW

        g.disks.append(utils.get_filedisk("/tmp/test1.img"))
        g.disks.append(disk)
        g.disks.append(utils.get_blkdisk())
        self._compare(g, "install-paravirt-many-disks", True)
Esempio n. 2
0
 def testInstallParavirtDiskDrvTapQCow(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_filedisk()
     disk.driver_name = VirtualDisk.DRIVER_TAP
     disk.driver_type = VirtualDisk.DRIVER_TAP_QCOW
     g.disks.append(disk)
     self._compare(g, "install-paravirt-disk-drv-tap-qcow", True)
Esempio n. 3
0
    def testManyDisks2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.disks.append(utils.get_filedisk())
        g.disks.append(utils.get_blkdisk())
        g.disks.append(VirtualDisk(conn=g.conn, path="/dev/loop0",
                                   device=VirtualDisk.DEVICE_CDROM,
                                   driverType="raw"))
        g.disks.append(VirtualDisk(conn=g.conn, path="/dev/loop0",
                                   device=VirtualDisk.DEVICE_DISK,
                                   driverName="qemu", format="qcow2"))
        g.disks.append(VirtualDisk(conn=g.conn, path=None,
                                   device=VirtualDisk.DEVICE_CDROM,
                                   bus="scsi"))
        g.disks.append(VirtualDisk(conn=g.conn, path=None,
                                   device=VirtualDisk.DEVICE_FLOPPY))
        g.disks.append(VirtualDisk(conn=g.conn, path="/dev/loop0",
                                   device=VirtualDisk.DEVICE_FLOPPY,
                                   driverName="phy", driverCache="none"))
        disk = VirtualDisk(conn=g.conn, path="/dev/loop0",
                           bus="virtio", driverName="qemu",
                           driverType="qcow2", driverCache="none")
        disk.driver_io = "threads"
        g.disks.append(disk)

        self._compare(g, "boot-many-disks2", False)
Esempio n. 4
0
    def testInstallFVImportMulti(self):
        i = utils.make_import_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.installer.bootconfig.enable_bootmenu = False
        g.installer.bootconfig.bootorder = ["hd", "fd", "cdrom", "network"]
        g.disks.append(utils.get_filedisk())
        self._compare(g, "install-fullyvirt-import-multiboot", False)
Esempio n. 5
0
 def testBootParavirtDiskFileBlktapCapable(self):
     oldblktap = virtinst._util.is_blktap_capable
     try:
         virtinst._util.is_blktap_capable = lambda: True
         g = utils.get_basic_paravirt_guest()
         g.disks.append(utils.get_filedisk())
         self._compare(g, "boot-paravirt-disk-drv-tap", False)
     finally:
         virtinst._util.is_blktap_capable = oldblktap
Esempio n. 6
0
 def make_guest():
     g = utils.get_basic_fullyvirt_guest("xen")
     g.os_type = "windows"
     g.os_variant = "winxp"
     g.disks.append(utils.get_filedisk())
     g.disks.append(utils.get_blkdisk())
     g.nics.append(utils.get_virtual_network())
     g.add_device(VirtualAudio())
     return g
Esempio n. 7
0
    def testInstallFVImportKernel(self):
        i = utils.make_import_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.disks.append(utils.get_filedisk())
        g.installer.bootconfig.kernel = "kernel"
        g.installer.bootconfig.initrd = "initrd"
        g.installer.bootconfig.kernel_args = "my kernel args"

        self._compare(g, "install-fullyvirt-import-kernel", False)
Esempio n. 8
0
    def testBootFVPXEAlways(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)
        g.disks.append(utils.get_filedisk())

        g.installer.bootconfig.bootorder = [
            g.installer.bootconfig.BOOT_DEVICE_NETWORK]
        g.installer.bootconfig.enable_bootmenu = True

        self._compare(g, "boot-fullyvirt-pxe-always", False)
Esempio n. 9
0
    def testQEMUDriverName(self):
        utils.set_conn(_plainkvm)
        g = utils.get_basic_fullyvirt_guest()
        g.disks.append(utils.get_blkdisk())
        self._compare(g, "misc-qemu-driver-name", True)

        g = utils.get_basic_fullyvirt_guest()
        g.disks.append(utils.get_filedisk())
        g.disks.append(utils.get_blkdisk("/iscsi-pool/diskvol1"))
        self._compare(g, "misc-qemu-driver-type", True)

        g = utils.get_basic_fullyvirt_guest()
        g.disks.append(utils.get_filedisk("/default-pool/iso-vol"))
        self._compare(g, "misc-qemu-iso-disk", True)

        g = utils.get_basic_fullyvirt_guest()
        g.disks.append(utils.get_filedisk("/default-pool/iso-vol"))
        g.disks[0].driver_type = "qcow2"
        self._compare(g, "misc-qemu-driver-overwrite", True)
Esempio n. 10
0
    def testF10(self):
        utils.set_conn(_plainkvm)
        i = utils.make_pxe_installer(gtype="kvm")
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

        g.os_type = "linux"
        g.os_variant = "fedora10"
        g.disks.append(utils.get_filedisk())
        g.disks.append(utils.get_blkdisk())
        g.nics.append(utils.get_virtual_network())
        self._compare(g, "install-f10", True)
Esempio n. 11
0
        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.disks.append(utils.get_floppy())
            g.disks.append(utils.get_filedisk())
            g.disks.append(utils.get_blkdisk())
            g.nics.append(utils.get_virtual_network())
            g.add_device(VirtualAudio())
            return g
Esempio n. 12
0
    def testF11Xen(self):
        utils.set_conn(_plainxen)
        i = utils.make_distro_installer(gtype="xen")
        g = utils.get_basic_fullyvirt_guest("xen", installer=i)

        g.os_type = "linux"
        g.os_variant = "fedora11"
        g.installer.cdrom = True
        g.disks.append(utils.get_floppy())
        g.disks.append(utils.get_filedisk())
        g.disks.append(utils.get_blkdisk())
        g.nics.append(utils.get_virtual_network())
        self._compare(g, "install-f11-xen", False)
Esempio n. 13
0
    def testDefaultDeviceRemoval(self):
        g = utils.get_basic_fullyvirt_guest()
        g.disks.append(utils.get_filedisk())

        inp = VirtualInputDevice(g.conn)
        cons = VirtualCharDevice.get_dev_instance(g.conn,
                                VirtualCharDevice.DEV_CONSOLE,
                                VirtualCharDevice.CHAR_PTY)
        g.add_device(inp)
        g.add_device(cons)

        g.remove_device(inp)
        g.remove_device(cons)

        self._compare(g, "boot-default-device-removal", False)
Esempio n. 14
0
    def testBootParavirtDiskFile(self):
        g = utils.get_basic_paravirt_guest()
        g.disks.append(utils.get_filedisk("/tmp/somerandomfilename.img"))
        self._compare(g, "boot-paravirt-disk-file", False)

        # Just cram some post_install_checks in here
        try:
            g.post_install_check()
            raise AssertionError("Expected OSError, none caught.")
        except OSError:
            pass

        g.disks[0].path = "virt-install"
        self.assertEquals(g.post_install_check(), False)

        g.disks[0].driver_type = "raw"
        self.assertEquals(g.post_install_check(), False)

        g.disks[0].driver_type = "foobar"
        self.assertEquals(g.post_install_check(), True)
Esempio n. 15
0
    def testOSDeviceDefaultChange(self):
        """
        Make sure device defaults are properly changed if we change OS
        distro/variant mid process
        """
        utils.set_conn(_plainkvm)

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

        do_install = False
        g.installer.cdrom = True
        g.disks.append(utils.get_floppy())
        g.disks.append(utils.get_filedisk())
        g.disks.append(utils.get_blkdisk())
        g.nics.append(utils.get_virtual_network())

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

        g.os_variant = "fedora11"
        self._compare(g, "install-f11", do_install)
Esempio n. 16
0
    def testFullKVMRHEL6(self):
        utils.set_conn(_plainkvm)
        i = utils.make_distro_installer(
                                  location="tests/cli-test-xml/fakerhel6tree",
                                  gtype="kvm")
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)
        g.disks.append(utils.get_floppy())
        g.disks.append(utils.get_filedisk("/default-pool/rhel6.img"))
        g.disks.append(utils.get_blkdisk())
        g.nics.append(utils.get_virtual_network())
        g.add_device(VirtualAudio())
        g.add_device(VirtualVideoDevice(g.conn))
        g.os_autodetect = True

        # Do this ugly hack to make sure the test doesn't try and use vol
        # upload
        origscratch = getattr(i, "_get_system_scratchdir")
        try:
            setattr(i, "_get_system_scratchdir",
                    lambda: i.scratchdir)
            self._testInstall(g, "rhel6-kvm-stage1", "rhel6-kvm-stage2")
        finally:
            setattr(i, "_get_system_scratchdir", origscratch)
Esempio n. 17
0
 def testBootParavirtDiskDrvTap(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_filedisk()
     disk.driver_name = VirtualDisk.DRIVER_TAP
     g.disks.append(disk)
     self._compare(g, "boot-paravirt-disk-drv-tap", False)
Esempio n. 18
0
 def testInstallParavirtDiskDrvFile(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_filedisk()
     disk.driver_name = VirtualDisk.DRIVER_FILE
     g.disks.append(disk)
     self._compare(g, "install-paravirt-disk-drv-file", True)
Esempio n. 19
0
 def testBootFullyvirtDiskFile(self):
     g = utils.get_basic_fullyvirt_guest()
     g.disks.append(utils.get_filedisk())
     self._compare(g, "boot-fullyvirt-disk-file", False)
Esempio n. 20
0
 def testInstallFullyvirtDiskFile(self):
     g = utils.get_basic_fullyvirt_guest()
     g.disks.append(utils.get_filedisk())
     self._compare(g, "install-fullyvirt-disk-file", True)
Esempio n. 21
0
 def testInstallFVPXE(self):
     i = utils.make_pxe_installer()
     g = utils.get_basic_fullyvirt_guest(installer=i)
     g.disks.append(utils.get_filedisk())
     self._compare(g, "install-fullyvirt-pxe", True)
Esempio n. 22
0
 def testXMLEscaping(self):
     g = utils.get_basic_fullyvirt_guest()
     g.description = "foooo barrrr \n baz && snarf. '' \"\" @@$\n"
     g.disks.append(utils.get_filedisk("/tmp/ISO&'&s"))
     self._compare(g, "misc-xml-escaping", True)
Esempio n. 23
0
 def testBootFVPXE(self):
     i = utils.make_pxe_installer()
     g = utils.get_basic_fullyvirt_guest(installer=i)
     g.disks.append(utils.get_filedisk())
     self._compare(g, "boot-fullyvirt-pxe", False)
Esempio n. 24
0
    def testInstallPVImport(self):
        i = utils.make_import_installer("xen")
        g = utils.get_basic_paravirt_guest(installer=i)

        g.disks.append(utils.get_filedisk())
        self._compare(g, "install-paravirt-import", False)