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

Python utils.get_basic_paravirt_guest函数代码示例

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

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



在下文中一共展示了get_basic_paravirt_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: 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


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


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


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


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


示例7: testInstallPVImport

    def testInstallPVImport(self):
        i = utils.make_import_installer()
        g = utils.get_basic_paravirt_guest(installer=i)

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


示例8: testInstallParavirtDiskDrvFile

 def testInstallParavirtDiskDrvFile(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_filedisk()
     disk.driver_name = VirtualDisk.DRIVER_FILE
     g.add_device(disk)
     self._compare(g, "install-paravirt-disk-drv-file", True)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:6,代码来源:xmlconfig.py


示例9: testInstallParavirtDiskDrvPhy

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


示例10: testInstallParavirtDiskBlock

 def testInstallParavirtDiskBlock(self):
     g = utils.get_basic_paravirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "install-paravirt-disk-block", True)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:4,代码来源:xmlconfig.py


示例11: testInstallParavirtDiskFile

 def testInstallParavirtDiskFile(self):
     g = utils.get_basic_paravirt_guest()
     g.add_device(utils.get_filedisk())
     self._compare(g, "install-paravirt-disk-file", True)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:4,代码来源:xmlconfig.py


示例12: testBootParavirtDiskDrvTap

 def testBootParavirtDiskDrvTap(self):
     g = utils.get_basic_paravirt_guest()
     disk = utils.get_filedisk()
     disk.driver_name = VirtualDisk.DRIVER_TAP
     g.add_device(disk)
     self._compare(g, "boot-paravirt-disk-drv-tap", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:6,代码来源:xmlconfig.py


示例13: testBootParavirtDiskDrvPhy

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


示例14: testBootParavirtDiskBlock

 def testBootParavirtDiskBlock(self):
     g = utils.get_basic_paravirt_guest()
     g.add_device(utils.get_blkdisk())
     self._compare(g, "boot-paravirt-disk-block", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:4,代码来源:xmlconfig.py


示例15: testBootParavirtDiskFile

 def testBootParavirtDiskFile(self):
     g = utils.get_basic_paravirt_guest()
     g.add_device(utils.get_filedisk("/tmp/somerandomfilename.img"))
     self._compare(g, "boot-paravirt-disk-file", False)
开发者ID:TelekomCloud,项目名称:virt-manager,代码行数:4,代码来源:xmlconfig.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utils.get_blkdisk函数代码示例发布时间:2022-05-27
下一篇:
Python utils.get_basic_fullyvirt_guest函数代码示例发布时间: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