本文整理汇总了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()
示例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)
示例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()
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)