当前位置: 首页>>代码示例>>Python>>正文


Python utils.get_basic_fullyvirt_guest函数代码示例

本文整理汇总了Python中tests.utils.get_basic_fullyvirt_guest函数的典型用法代码示例。如果您正苦于以下问题:Python get_basic_fullyvirt_guest函数的具体用法?Python get_basic_fullyvirt_guest怎么用?Python get_basic_fullyvirt_guest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_basic_fullyvirt_guest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _image2XMLhelper

    def _image2XMLhelper(self, image_xml, output_xmls, qemu=False):
        image2guestdir = self.basedir + "image2guest/"
        image = virtimage.parse_file(self.basedir + image_xml)
        if type(output_xmls) is not list:
            output_xmls = [output_xmls]

        conn = qemu and self.qemuconn or self.conn
        gtype = qemu and "qemu" or "xen"

        for idx in range(len(output_xmls)):
            fname = output_xmls[idx]
            inst = virtimage.ImageInstaller(conn, image, boot_index=idx)
            capsguest, capsdomain = inst.get_caps_guest()
            if capsguest.os_type == "hvm":
                g = utils.get_basic_fullyvirt_guest(typ=gtype)
            else:
                g = utils.get_basic_paravirt_guest()

            utils.set_conn(conn)
            g.os.os_type = capsguest.os_type
            g.type = capsdomain.hypervisor_type
            g.os.arch = capsguest.arch

            g.installer = inst
            # pylint: disable=unpacking-non-sequence
            ignore, actual_out = g.start_install(return_xml=True, dry=True)

            actual_out = g.get_install_xml(install=False)
            expect_file = os.path.join(image2guestdir + fname)

            actual_out = actual_out.replace(os.getcwd(), "/tmp")
            utils.diff_compare(actual_out, expect_file)

            utils.reset_conn()
开发者ID:giuseppe,项目名称:virt-manager,代码行数:34,代码来源:image.py

示例2: testManyDisks2

    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)
开发者ID:aliceinwire,项目名称:virt-manager,代码行数:27,代码来源:xmlconfig.py

示例3: testUsb2

    def testUsb2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.add_usb_ich9_controllers()

        self._compare(g, "boot-usb2", False)
开发者ID:aliceinwire,项目名称:virt-manager,代码行数:7,代码来源:xmlconfig.py

示例4: testFedoraTreeinfo

 def testFedoraTreeinfo(self):
     i = utils.make_distro_installer(
                             location="tests/cli-test-xml/fakefedoratree")
     g = utils.get_basic_fullyvirt_guest(installer=i)
     g.type = "kvm"
     v = i.detect_distro(g)
     self.assertEquals(v, "fedora17")
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:7,代码来源:xmlconfig.py

示例5: testDoubleInstall

 def testDoubleInstall(self):
     # Make sure that installing twice generates the same XML, to ensure
     # we aren't polluting the device list during the install process
     i = utils.make_live_installer()
     g = utils.get_basic_fullyvirt_guest(installer=i)
     self._compare(g, "install-fullyvirt-livecd", False)
     self._compare(g, "install-fullyvirt-livecd", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:7,代码来源:xmlconfig.py

示例6: testManyNICs

    def testManyNICs(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        net1 = VirtualNetworkInterface(g.conn)
        net1.type = "user"
        net1.macaddr = "22:11:11:11:11:11"

        net2 = utils.get_virtual_network()
        net3 = utils.get_virtual_network()
        net3.model = "e1000"

        net4 = VirtualNetworkInterface(g.conn)
        net4.bridge = "foobr0"
        net4.macaddr = "22:22:22:22:22:22"
        net4.target_dev = "foo1"

        net5 = VirtualNetworkInterface(g.conn)
        net5.type = "ethernet"
        net5.macaddr = "00:11:00:22:00:33"
        net5.source_dev = "testeth1"

        g.add_device(net1)
        g.add_device(net2)
        g.add_device(net3)
        g.add_device(net4)
        g.add_device(net5)
        self._compare(g, "boot-many-nics", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:28,代码来源:xmlconfig.py

示例7: _image2XMLhelper

    def _image2XMLhelper(self, image_xml, output_xmls, qemu=False):
        image2guestdir = self.basedir + "image2guest/"
        image = virtinst.ImageParser.parse_file(self.basedir + image_xml)
        if type(output_xmls) is not list:
            output_xmls = [output_xmls]

        conn = qemu and self.qemuconn or self.conn
        caps = qemu and self.qemucaps or self.caps
        gtype = qemu and "qemu" or "xen"

        for idx in range(len(output_xmls)):
            fname = output_xmls[idx]
            inst = virtinst.ImageInstaller(image, caps, boot_index=idx,
                                           conn=conn)

            utils.set_conn(conn)

            if inst.is_hvm():
                g = utils.get_basic_fullyvirt_guest(typ=gtype)
            else:
                g = utils.get_basic_paravirt_guest()

            g.installer = inst
            g._prepare_install(None)

            actual_out = g.get_xml_config(install=False)
            expect_file = os.path.join(image2guestdir + fname)
            expect_out = utils.read_file(expect_file)
            expect_out = expect_out.replace("REPLACEME", os.getcwd())

            utils.diff_compare(actual_out,
                               expect_file,
                               expect_out=expect_out)

            utils.reset_conn()
开发者ID:aliceinwire,项目名称:virt-manager,代码行数:35,代码来源:image.py

示例8: testManyDisks2

    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)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:59,代码来源:xmlconfig.py

示例9: testInstallFVImportMulti

    def testInstallFVImportMulti(self):
        i = utils.make_import_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.os.enable_bootmenu = False
        g.os.bootorder = ["hd", "fd", "cdrom", "network"]
        g.add_device(utils.get_filedisk())
        self._compare(g, "install-fullyvirt-import-multiboot", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:8,代码来源:xmlconfig.py

示例10: make_guest

 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
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:8,代码来源:xmlconfig.py

示例11: testUsb2

    def testUsb2(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        for dev in virtinst.VirtualController.get_usb2_controllers(g.conn):
            g.add_device(dev)

        self._compare(g, "boot-usb2", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:8,代码来源:xmlconfig.py

示例12: testManyChars

    def testManyChars(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        dev1 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_SERIAL,
                                                  VirtualCharDevice.CHAR_NULL)
        dev2 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_PARALLEL,
                                                  VirtualCharDevice.CHAR_UNIX)
        dev2.source_path = "/tmp/foobar"
        dev3 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_SERIAL,
                                                  VirtualCharDevice.CHAR_TCP)
        dev3.protocol = "telnet"
        dev3.source_host = "my.source.host"
        dev3.source_port = "1234"
        dev4 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_PARALLEL,
                                                  VirtualCharDevice.CHAR_UDP)
        dev4.bind_host = "my.bind.host"
        dev4.bind_port = "1111"
        dev4.source_host = "my.source.host"
        dev4.source_port = "2222"

        dev5 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_CHANNEL,
                                                  VirtualCharDevice.CHAR_PTY)
        dev5.target_type = dev5.CHAR_CHANNEL_TARGET_VIRTIO
        dev5.target_name = "foo.bar.frob"

        dev6 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_CONSOLE,
                                                  VirtualCharDevice.CHAR_PTY)

        dev7 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_CONSOLE,
                                                  VirtualCharDevice.CHAR_PTY)
        dev7.target_type = dev5.CHAR_CONSOLE_TARGET_VIRTIO

        dev8 = VirtualCharDevice.get_dev_instance(g.conn,
                                                  VirtualCharDevice.DEV_CHANNEL,
                                                  VirtualCharDevice.CHAR_PTY)
        dev8.target_type = dev5.CHAR_CHANNEL_TARGET_GUESTFWD
        dev8.target_address = "1.2.3.4"
        dev8.target_port = "4567"

        g.add_device(dev1)
        g.add_device(dev2)
        g.add_device(dev3)
        g.add_device(dev4)
        g.add_device(dev5)
        g.add_device(dev6)
        g.add_device(dev7)
        g.add_device(dev8)
        self._compare(g, "boot-many-chars", False)
开发者ID:aliceinwire,项目名称:virt-manager,代码行数:56,代码来源:xmlconfig.py

示例13: testBootFVPXEAlways

    def testBootFVPXEAlways(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)
        g.add_device(utils.get_filedisk())

        g.os.bootorder = [
            g.os.BOOT_DEVICE_NETWORK]
        g.os.enable_bootmenu = True

        self._compare(g, "boot-fullyvirt-pxe-always", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:10,代码来源:xmlconfig.py

示例14: testF10

    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)
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:10,代码来源:xmlconfig.py

示例15: testQEMUDriverName

    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)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:19,代码来源:xmlconfig.py


注:本文中的tests.utils.get_basic_fullyvirt_guest函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。