コード例 #1
0
    def testManyDisks2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(VirtualDisk(conn=g.conn, path="/dev/loop0",
                                   device=VirtualDisk.DEVICE_CDROM,
                                   driverType="raw"))
        g.add_device(VirtualDisk(conn=g.conn, path="/dev/loop0",
                                   device=VirtualDisk.DEVICE_DISK,
                                   driverName="qemu", format="qcow2"))
        g.add_device(VirtualDisk(conn=g.conn, path=None,
                                   device=VirtualDisk.DEVICE_CDROM,
                                   bus="scsi"))
        g.add_device(VirtualDisk(conn=g.conn, path=None,
                                   device=VirtualDisk.DEVICE_FLOPPY))
        g.add_device(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.add_device(disk)

        self._compare(g, "boot-many-disks2", False)
コード例 #2
0
    def testManyDisks2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())

        d = VirtualDisk(g.conn)
        d.path = "/dev/loop0"
        d.device = d.DEVICE_CDROM
        d.driver_type = "raw"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/dev/loop0"
        d.device = d.DEVICE_DISK
        d.driver_name = "qemu"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = None
        d.device = d.DEVICE_CDROM
        d.bus = "scsi"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = None
        d.device = d.DEVICE_FLOPPY
        d.iotune_tbs = 1
        d.iotune_tis = 2
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/dev/loop0"
        d.device = d.DEVICE_FLOPPY
        d.driver_name = "phy"
        d.driver_cache = "none"
        d.iotune_rbs = 5555
        d.iotune_ris = 1234
        d.iotune_wbs = 3
        d.iotune_wis = 4
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/dev/loop0"
        d.bus = "virtio"
        d.driver_name = "qemu"
        d.driver_type = "qcow2"
        d.driver_cache = "none"
        d.driver_io = "threads"
        d.validate()
        g.add_device(d)

        self._compare(g, "boot-many-disks2", False)
コード例 #3
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
 def make_guest():
     g = utils.get_basic_fullyvirt_guest("xen")
     g.os_variant = "winxp"
     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
コード例 #4
0
ファイル: xmlconfig.py プロジェクト: aurex-linux/virt-manager
 def make_guest():
     g = utils.get_basic_fullyvirt_guest("xen")
     g.os_variant = "winxp"
     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
コード例 #5
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testBootParavirtManyDisks(self):
        g = utils.get_basic_paravirt_guest()
        disk = utils.get_filedisk("/dev/default-pool/test2.img")
        disk.driver_name = VirtualDisk.DRIVER_TAP
        disk.driver_type = VirtualDisk.DRIVER_TAP_QCOW

        g.add_device(utils.get_filedisk("/dev/default-pool/test1.img"))
        g.add_device(disk)
        g.add_device(utils.get_blkdisk())
        self._compare(g, "boot-paravirt-many-disks", False)
コード例 #6
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testF10(self):
        utils.set_conn(_plainkvm)
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

        g.os_variant = "fedora10"
        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        self._compare(g, "install-f10", True)
コード例 #7
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.add_device(utils.get_filedisk("/tmp/test1.img"))
        g.add_device(disk)
        g.add_device(utils.get_blkdisk())
        self._compare(g, "install-paravirt-many-disks", True)
コード例 #8
0
ファイル: xmlconfig.py プロジェクト: aurex-linux/virt-manager
    def testBootParavirtManyDisks(self):
        g = utils.get_basic_paravirt_guest()
        disk = utils.get_filedisk("/dev/default-pool/test2.img")
        disk.driver_name = VirtualDisk.DRIVER_TAP
        disk.driver_type = VirtualDisk.DRIVER_TAP_QCOW

        g.add_device(utils.get_filedisk("/dev/default-pool/test1.img"))
        g.add_device(disk)
        g.add_device(utils.get_blkdisk())
        self._compare(g, "boot-paravirt-many-disks", False)
コード例 #9
0
    def testQEMUDriverName(self):
        utils.set_conn(_plainkvm)
        g = utils.get_basic_fullyvirt_guest()
        g.add_device(utils.get_blkdisk())
        self._compare(g, "misc-qemu-driver-name", True)

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

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

        g = utils.get_basic_fullyvirt_guest()
        g.add_device(utils.get_filedisk("/default-pool/iso-vol"))
        g.get_devices("disk")[0].driver_type = "qcow2"
        self._compare(g, "misc-qemu-driver-overwrite", True)
コード例 #10
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.add_device(utils.get_filedisk("/tmp/test1.img"))
        g.add_device(disk)
        g.add_device(utils.get_blkdisk())
        self._compare(g, "install-paravirt-many-disks", True)
コード例 #11
0
    def testQEMUDriverName(self):
        utils.set_conn(_plainkvm)
        g = utils.get_basic_fullyvirt_guest()
        g.add_device(utils.get_blkdisk())
        self._compare(g, "misc-qemu-driver-name", True)

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

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

        g = utils.get_basic_fullyvirt_guest()
        g.add_device(utils.get_filedisk("/dev/default-pool/iso-vol"))
        g.get_devices("disk")[0].driver_type = "qcow2"
        self._compare(g, "misc-qemu-driver-overwrite", True)
コード例 #12
0
ファイル: xmlconfig.py プロジェクト: aurex-linux/virt-manager
    def testF10(self):
        utils.set_conn(_plainkvm)
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)

        g.os_variant = "fedora10"
        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        self._compare(g, "install-f10", True)
コード例 #13
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testF11Xen(self):
        utils.set_conn(_plainxen)
        i = utils.make_distro_installer()
        g = utils.get_basic_fullyvirt_guest("xen", 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())
        self._compare(g, "install-f11-xen", False)
コード例 #14
0
ファイル: xmlconfig.py プロジェクト: aurex-linux/virt-manager
    def testF11Xen(self):
        utils.set_conn(_plainxen)
        i = utils.make_distro_installer()
        g = utils.get_basic_fullyvirt_guest("xen", 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())
        self._compare(g, "install-f11-xen", False)
コード例 #15
0
ファイル: xmlconfig.py プロジェクト: aurex-linux/virt-manager
        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
コード例 #16
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
        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
コード例 #17
0
    def testF11Qemu(self):
        utils.set_conn(_plainkvm)
        i = utils.make_distro_installer(gtype="qemu")
        g = utils.get_basic_fullyvirt_guest("qemu", 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())
        self._compare(g, "install-f11-qemu", False)
コード例 #18
0
    def testFullKVMRHEL6(self):
        utils.set_conn(_plainkvm)
        i = utils.make_distro_installer(
                                  location="tests/cli-test-xml/fakerhel6tree")
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)
        g.add_device(utils.get_floppy())
        g.add_device(utils.get_filedisk("/dev/default-pool/rhel6.img", fake=False))
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        g.add_device(VirtualAudio(g.conn))
        g.add_device(VirtualVideoDevice(g.conn))
        g.os_autodetect = True

        self._testInstall(g, "rhel6-kvm-stage1", "rhel6-kvm-stage2")
コード例 #19
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testFullKVMRHEL6(self):
        utils.set_conn(_plainkvm)
        i = utils.make_distro_installer(
            location="tests/cli-test-xml/fakerhel6tree")
        g = utils.get_basic_fullyvirt_guest("kvm", installer=i)
        g.add_device(utils.get_floppy())
        g.add_device(
            utils.get_filedisk("/dev/default-pool/rhel6.img", fake=False))
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())
        g.add_device(VirtualAudio(g.conn))
        g.add_device(VirtualVideoDevice(g.conn))

        self._testInstall(g,
                          "rhel6-kvm-stage1",
                          "rhel6-kvm-stage2",
                          detect_distro=True)
コード例 #20
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.add_device(utils.get_floppy())
        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())
        g.add_device(utils.get_virtual_network())

        # Call get_xml_config 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)
コード例 #21
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    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)
コード例 #22
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)
コード例 #23
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.add_device(utils.get_floppy())
        g.add_device(utils.get_filedisk("/default-pool/rhel6.img"))
        g.add_device(utils.get_blkdisk())
        g.add_device(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)
コード例 #24
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testManyDisks2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.add_device(utils.get_filedisk())
        g.add_device(utils.get_blkdisk())

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.device = d.DEVICE_CDROM
        d.driver_type = "raw"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.device = d.DEVICE_DISK
        d.driver_name = "qemu"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = None
        d.device = d.DEVICE_CDROM
        d.bus = "scsi"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = None
        d.device = d.DEVICE_FLOPPY
        d.iotune_tbs = 1
        d.iotune_tis = 2
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.device = d.DEVICE_FLOPPY
        d.driver_name = "phy"
        d.driver_cache = "none"
        d.iotune_rbs = 5555
        d.iotune_ris = 1234
        d.iotune_wbs = 3
        d.iotune_wis = 4
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.bus = "virtio"
        d.driver_name = "qemu"
        d.driver_type = "qcow2"
        d.driver_cache = "none"
        d.driver_io = "threads"
        d.validate()
        g.add_device(d)

        self._compare(g, "boot-many-disks2", False)
コード例 #25
0
 def testInstallFullyvirtDiskBlock(self):
     g = utils.get_basic_fullyvirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "install-fullyvirt-disk-block", True)
コード例 #26
0
 def testInstallParavirtDiskDrvPhy(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_blkdisk()
     disk.driver_name = VirtualDisk.DRIVER_PHY
     g.add_device(disk)
     self._compare(g, "install-paravirt-disk-drv-phy", True)
コード例 #27
0
 def testBootFullyvirtDiskBlock(self):
     g = utils.get_basic_fullyvirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "boot-fullyvirt-disk-block", False)
コード例 #28
0
 def testBootParavirtDiskDrvPhy(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_blkdisk()
     disk.driver_name = VirtualDisk.DRIVER_PHY
     g.add_device(disk)
     self._compare(g, "boot-paravirt-disk-drv-phy", False)
コード例 #29
0
 def testBootParavirtDiskDrvPhy(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_blkdisk()
     disk.driver_name = VirtualDisk.DRIVER_PHY
     g.add_device(disk)
     self._compare(g, "boot-paravirt-disk-drv-phy", False)
コード例 #30
0
 def testBootFullyvirtDiskBlock(self):
     g = utils.get_basic_fullyvirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "boot-fullyvirt-disk-block", False)
コード例 #31
0
 def testInstallParavirtDiskDrvPhy(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_blkdisk()
     disk.driver_name = VirtualDisk.DRIVER_PHY
     g.add_device(disk)
     self._compare(g, "install-paravirt-disk-drv-phy", True)
コード例 #32
0
 def testInstallFullyvirtDiskBlock(self):
     g = utils.get_basic_fullyvirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "install-fullyvirt-disk-block", True)