• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.get_filedisk函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testInstallParavirtManyDisks

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


示例2: testBootParavirtManyDisks

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


示例3: 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


示例4: testInstallParavirtDiskDrvTapQCow

 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.add_device(disk)
     self._compare(g, "install-paravirt-disk-drv-tap-qcow", True)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:7,代码来源:xmlconfig.py


示例5: 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


示例6: 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


示例7: 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


示例8: testBootParavirtDiskFileBlktapCapable

 def testBootParavirtDiskFileBlktapCapable(self):
     oldblktap = virtinst.util.is_blktap_capable
     try:
         virtinst.util.is_blktap_capable = lambda ignore: True
         g = utils.get_basic_paravirt_guest()
         g.add_device(utils.get_filedisk())
         self._compare(g, "boot-paravirt-disk-drv-tap", False)
     finally:
         virtinst.util.is_blktap_capable = oldblktap
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:9,代码来源:xmlconfig.py


示例9: 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


示例10: 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


示例11: testInstallFVImportKernel

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

        g.add_device(utils.get_filedisk())
        g.os.kernel = "kernel"
        g.os.initrd = "initrd"
        g.os.kernel_args = "my kernel args"

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


示例12: 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


示例13: testF11Xen

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


示例14: build_guest

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


示例15: testF11Qemu

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


示例16: testFullKVMRHEL6

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


示例17: testDefaultDeviceRemoval

    def testDefaultDeviceRemoval(self):
        g = utils.get_basic_fullyvirt_guest()
        g.add_device(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)
开发者ID:aliceinwire,项目名称:virt-manager,代码行数:15,代码来源:xmlconfig.py


示例18: testOSDeviceDefaultChange

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


示例19: testOSDeviceDefaultChange

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


示例20: testFullKVMRHEL6

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.get_graphql_content函数代码示例发布时间:2022-05-27
下一篇:
Python utils.get_blkdisk函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap