diff --git a/selftests/unit/test_nfs.py b/selftests/unit/test_nfs.py index 77d0720d6ad..ea98e50d169 100644 --- a/selftests/unit/test_nfs.py +++ b/selftests/unit/test_nfs.py @@ -14,7 +14,7 @@ from virttest.unittest_utils import mock from virttest import nfs -from virttest import utils_misc +from virttest import utils_disk from virttest.staging import service @@ -58,16 +58,16 @@ def setup_stubs_setup(self, nfs_obj): os.makedirs.expect_call(nfs_obj.export_dir) nfs_obj.exportfs.export.expect_call() os.makedirs.expect_call(nfs_obj.mount_dir) - utils_misc.mount.expect_call(nfs_obj.mount_src, nfs_obj.mount_dir, - "nfs", perm=nfs_obj.mount_options) + utils_disk.mount.expect_call(nfs_obj.mount_src, nfs_obj.mount_dir, + "nfs", nfs_obj.mount_options) def setup_stubs_is_mounted(self, nfs_obj): - utils_misc.is_mounted.expect_call(nfs_obj.mount_src, - nfs_obj.mount_dir, - "nfs").and_return(True) + utils_disk.is_mount.expect_call(nfs_obj.mount_src, + nfs_obj.mount_dir, + "nfs").and_return(True) def setup_stubs_cleanup(self, nfs_obj): - utils_misc.umount.expect_call(nfs_obj.mount_src, + utils_disk.umount.expect_call(nfs_obj.mount_src, nfs_obj.mount_dir, "nfs") nfs_obj.exportfs.reset_export.expect_call() @@ -84,9 +84,9 @@ def setUp(self): self.god.stub_function(process, "system_output") self.god.stub_function(os.path, "isfile") self.god.stub_function(os, "makedirs") - self.god.stub_function(utils_misc, "is_mounted") - self.god.stub_function(utils_misc, "mount") - self.god.stub_function(utils_misc, "umount") + self.god.stub_function(utils_disk, "is_mount") + self.god.stub_function(utils_disk, "mount") + self.god.stub_function(utils_disk, "umount") self.god.stub_function(service.Factory, "create_service") attr = getattr(nfs, "Exportfs") setattr(attr, "already_exported", False) diff --git a/virttest/env_process.py b/virttest/env_process.py index 34cedc171c5..175d1303809 100644 --- a/virttest/env_process.py +++ b/virttest/env_process.py @@ -31,6 +31,7 @@ from virttest import test_setup from virttest import virt_vm from virttest import utils_misc +from virttest import utils_disk from virttest import storage from virttest import qemu_storage from virttest import utils_libvirtd @@ -89,17 +90,17 @@ def preprocess_image(test, params, image_name, vm_process_status=None): if params.get("force_create_image") == "yes": create_image = True elif (params.get("create_image") == "yes" and not - storage.file_exists(params, image_filename)): + utils_disk.file_exists(params, image_filename)): create_image = True if params.get("backup_image_before_testing", "no") == "yes": image = qemu_storage.QemuImg(params, base_dir, image_name) image.backup_image(params, base_dir, "backup", True, True) if create_image: - if storage.file_exists(params, image_filename): + if utils_disk.file_exists(params, image_filename): # As rbd image can not be covered, so need remove it if we need # force create a new image. - storage.file_remove(params, image_filename) + utils_disk.file_remove(params, image_filename) image = qemu_storage.QemuImg(params, base_dir, image_name) logging.info("Create image on %s." % image.storage_type) image.create(params) diff --git a/virttest/gluster.py b/virttest/gluster.py index 04c128dc4c7..92bc339a2da 100644 --- a/virttest/gluster.py +++ b/virttest/gluster.py @@ -14,8 +14,6 @@ from avocado.utils import process -from virttest import data_dir -from virttest import utils_misc from virttest import utils_net from virttest import error_context from virttest.compat_52lts import decode_to_text @@ -177,48 +175,6 @@ def gluster_vol_create(vol_name, hostname, brick_path, force=False): return is_gluster_vol_avail(vol_name) -def glusterfs_mount(g_uri, mount_point): - """ - Mount gluster volume to mountpoint. - - :param g_uri: stripped gluster uri from create_gluster_uri(.., True) - :type g_uri: str - """ - utils_misc.mount(g_uri, mount_point, "glusterfs", None, - False, "fuse.glusterfs") - - -@error_context.context_aware -def create_gluster_vol(params): - vol_name = params.get("gluster_volume_name") - force = params.get('force_recreate_gluster') == "yes" - - brick_path = params.get("gluster_brick") - if not os.path.isabs(brick_path): # do nothing when path is absolute - base_dir = params.get("images_base_dir", data_dir.get_data_dir()) - brick_path = os.path.join(base_dir, brick_path) - - error_context.context("Host name lookup failed") - hostname = socket.gethostname() - if not hostname or hostname == "(none)": - if_up = utils_net.get_net_if(state="UP") - for i in if_up: - ipv4_value = utils_net.get_net_if_addrs(i)["ipv4"] - logging.debug("ipv4_value is %s", ipv4_value) - if ipv4_value != []: - ip_addr = ipv4_value[0] - break - hostname = ip_addr - - # Start the gluster dameon, if not started - glusterd_start() - # Check for the volume is already present, if not create one. - if not is_gluster_vol_avail(vol_name) or force: - return gluster_vol_create(vol_name, hostname, brick_path, force) - else: - return True - - @error_context.context_aware def create_gluster_uri(params, stripped=False): """ @@ -248,56 +204,6 @@ def create_gluster_uri(params, stripped=False): return gluster_uri -def file_exists(params, filename_path): - sg_uri = create_gluster_uri(params, stripped=True) - g_uri = create_gluster_uri(params, stripped=False) - # Using directly /tmp dir because directory should be really temporary and - # should be deleted immediately when no longer needed and - # created directory don't file tmp dir by any data. - tmpdir = "gmount-%s" % (utils_misc.generate_random_string(6)) - tmpdir_path = os.path.join(data_dir.get_tmp_dir(), tmpdir) - while os.path.exists(tmpdir_path): - tmpdir = "gmount-%s" % (utils_misc.generate_random_string(6)) - tmpdir_path = os.path.join(data_dir.get_tmp_dir(), tmpdir) - ret = False - try: - try: - os.mkdir(tmpdir_path) - glusterfs_mount(sg_uri, tmpdir_path) - mount_filename_path = os.path.join(tmpdir_path, - filename_path[len(g_uri):]) - if os.path.exists(mount_filename_path): - ret = True - except Exception as e: - logging.error("Failed to mount gluster volume %s to" - " mount dir %s: %s" % (sg_uri, tmpdir_path, e)) - finally: - if utils_misc.umount(sg_uri, tmpdir_path, "glusterfs", False, - "fuse.glusterfs"): - try: - os.rmdir(tmpdir_path) - except OSError: - pass - else: - logging.warning("Unable to unmount tmp directory %s with glusterfs" - " mount.", tmpdir_path) - return ret - - -def get_image_filename(params, image_name, image_format): - """ - Form the image file name using gluster uri - """ - - img_name = image_name.split('/')[-1] - gluster_uri = create_gluster_uri(params) - if params.get("image_raw_device") == "yes": - image_filename = "%s%s" % (gluster_uri, img_name) - else: - image_filename = "%s%s.%s" % (gluster_uri, img_name, image_format) - return image_filename - - @error_context.context_aware def gluster_allow_insecure(vol_name): """ diff --git a/virttest/nfs.py b/virttest/nfs.py index d101e1c2bd0..30ce50fd172 100644 --- a/virttest/nfs.py +++ b/virttest/nfs.py @@ -12,6 +12,7 @@ from avocado.core import exceptions from virttest import utils_misc +from virttest import utils_disk from virttest.utils_iptables import Iptables from virttest.utils_conn import SSHConnection from virttest.compat_52lts import results_stdout_52lts, results_stderr_52lts @@ -183,20 +184,20 @@ def is_mounted(self): :return: If the src is mounted as expect :rtype: Boolean """ - return utils_misc.is_mounted(self.mount_src, self.mount_dir, "nfs") + return utils_disk.is_mount(self.mount_src, self.mount_dir, "nfs") def mount(self): """ Mount source into given mount point. """ - return utils_misc.mount(self.mount_src, self.mount_dir, "nfs", - perm=self.mount_options) + return utils_disk.mount(self.mount_src, self.mount_dir, "nfs", + self.mount_options) def umount(self): """ Umount the given mount point. """ - return utils_misc.umount(self.mount_src, self.mount_dir, "nfs") + return utils_disk.umount(self.mount_src, self.mount_dir, "nfs") def setup(self): """ diff --git a/virttest/qemu_storage.py b/virttest/qemu_storage.py index 829c54e04f2..84926da482c 100644 --- a/virttest/qemu_storage.py +++ b/virttest/qemu_storage.py @@ -14,6 +14,7 @@ from avocado.utils import process from virttest import utils_misc +from virttest import utils_disk from virttest import virt_vm from virttest import storage from virttest import data_dir @@ -509,7 +510,7 @@ def check_image(self, params, root_dir, force_share=False): image_is_checkable = self.image_format in ['qcow2', 'qed'] force_share &= self.cap_force_share - if (storage.file_exists(params, image_filename) or + if (utils_disk.file_exists(params, image_filename) or self.is_remote_image()) and image_is_checkable: check_img = self.support_cmd("check") and self.support_cmd("info") if not check_img: @@ -566,7 +567,7 @@ def check_image(self, params, root_dir, force_share=False): "integrity problem was found " "though. (%s)" % image_filename) else: - if not storage.file_exists(params, image_filename): + if not utils_disk.file_exists(params, image_filename): logging.debug("Image file %s not found, skipping check", image_filename) elif not image_is_checkable: diff --git a/virttest/storage.py b/virttest/storage.py index 3e69e3b480c..52364868c94 100644 --- a/virttest/storage.py +++ b/virttest/storage.py @@ -17,8 +17,8 @@ from virttest import iscsi from virttest import utils_misc +from virttest import utils_storage from virttest import virt_vm -from virttest import gluster from virttest import lvm from virttest import ceph from virttest import data_dir @@ -41,7 +41,7 @@ def preprocess_image_backend(bindir, params, env): enable_gluster = params.get("enable_gluster") gluster_image = params.get("gluster_brick") if enable_gluster and gluster_image: - return gluster.create_gluster_vol(params) + return utils_storage.create_gluster_vol(params) return True @@ -54,61 +54,6 @@ def postprocess_images(bindir, params): image_obj.rm_cloned_image(params, vm, image, bindir) -def file_exists(params, filename_path): - """ - Check if image_filename exists. - - :param params: Dictionary containing the test parameters. - :param filename_path: path to file - :type filename_path: str - :param root_dir: Base directory for relative filenames. - :type root_dir: str - - :return: True if image file exists else False - """ - gluster_image = params.get("gluster_brick") - if gluster_image: - return gluster.file_exists(params, filename_path) - - if params.get("enable_ceph") == "yes": - image_name = params.get("image_name") - image_format = params.get("image_format", "qcow2") - ceph_monitor = params["ceph_monitor"] - rbd_pool_name = params["rbd_pool_name"] - rbd_image_name = "%s.%s" % (image_name.split("/")[-1], image_format) - return ceph.rbd_image_exist(ceph_monitor, rbd_pool_name, - rbd_image_name) - - return os.path.exists(filename_path) - - -def file_remove(params, filename_path): - """ - Remove the image - :param params: Dictionary containing the test parameters. - :param filename_path: path to file - """ - if params.get("enable_ceph") == "yes": - image_name = params.get("image_name") - image_format = params.get("image_format", "qcow2") - ceph_monitor = params["ceph_monitor"] - rbd_pool_name = params["rbd_pool_name"] - rbd_image_name = "%s.%s" % (image_name.split("/")[-1], image_format) - return ceph.rbd_image_rm(ceph_monitor, rbd_pool_name, rbd_image_name) - - if params.get("gluster_brick"): - # TODO: Add implementation for gluster_brick - return - - if params.get('storage_type') in ('iscsi', 'lvm'): - # TODO: Add implementation for iscsi/lvm - return - - if os.path.exists(filename_path): - os.unlink(filename_path) - return - - def get_image_blkdebug_filename(params, root_dir): """ Generate an blkdebug file path from params and root_dir. @@ -150,7 +95,8 @@ def get_image_filename(params, root_dir): if enable_gluster: image_name = params.get("image_name", "image") image_format = params.get("image_format", "qcow2") - return gluster.get_image_filename(params, image_name, image_format) + return utils_storage.get_gluster_image_filename(params, image_name, + image_format) if enable_ceph: image_format = params.get("image_format", "qcow2") ceph_monitor = params["ceph_monitor"] diff --git a/virttest/tests/unattended_install.py b/virttest/tests/unattended_install.py index 7086657bf05..1c826f0a55c 100644 --- a/virttest/tests/unattended_install.py +++ b/virttest/tests/unattended_install.py @@ -18,6 +18,7 @@ from avocado.utils import process from avocado.utils import crypto from avocado.utils import download +from avocado.utils import wait from virttest import virt_vm from virttest import asset @@ -1120,10 +1121,10 @@ def terminate_syslog_server_thread(): def copy_file_from_nfs(src, dst, mount_point, image_name): logging.info("Test failed before the install process start." " So just copy a good image from nfs for following tests.") - utils_misc.mount(src, mount_point, "nfs", perm="ro") + utils_disk.mount(src, mount_point, "nfs", "ro") image_src = utils_misc.get_path(mount_point, image_name) shutil.copy(image_src, dst) - utils_misc.umount(src, mount_point, "nfs") + utils_disk.umount(src, mount_point, "nfs") def string_in_serial_log(serial_log_file_path, string): @@ -1390,7 +1391,7 @@ def copy_images(): if params.get("medium", "cdrom") == "import": vm.shutdown() try: - if utils_misc.wait_for(vm.is_dead, shutdown_cleanly_timeout, 1, 1): + if wait.wait_for(vm.is_dead, shutdown_cleanly_timeout, 1, 1): logging.info("Guest managed to shutdown cleanly") except qemu_monitor.MonitorError as e: logging.warning("Guest apparently shut down, but got a " diff --git a/virttest/utils_disk.py b/virttest/utils_disk.py index 27c906355e2..4f7f360bf57 100644 --- a/virttest/utils_disk.py +++ b/virttest/utils_disk.py @@ -24,6 +24,11 @@ from virttest import error_context from virttest import utils_numeric +from virttest import utils_misc +from virttest import data_dir +from virttest import gluster +from virttest import ceph +from virttest.libvirt_xml import pool_xml from virttest.compat_52lts import decode_to_text from virttest.compat_52lts import results_stdout_52lts @@ -64,8 +69,19 @@ def copytree(src, dst, overwrite=True, ignore=''): shutil.copy(src_file, dst_dir) +def glusterfs_mount(g_uri, mount_point): + """ + Mount gluster volume to mountpoint. + + :param g_uri: stripped gluster uri from create_gluster_uri(.., True) + :type g_uri: str + """ + mount(g_uri, mount_point, "glusterfs", None, + False, "fuse.glusterfs") + + def is_mount(src, dst=None, fstype=None, options=None, verbose=False, - session=None): + session=None, fstype_mtab=None): """ Check is src or dst mounted. @@ -107,7 +123,8 @@ def is_mount(src, dst=None, fstype=None, options=None, verbose=False, return False -def mount(src, dst, fstype=None, options=None, verbose=False, session=None): +def mount(src, dst, fstype=None, options=None, verbose=False, session=None, + fstype_mtab=None): """ Mount src under dst if it's really mounted, then remout with options. @@ -135,7 +152,8 @@ def mount(src, dst, fstype=None, options=None, verbose=False, session=None): return process.system(cmd, verbose=verbose) == 0 -def umount(src, dst, fstype=None, verbose=False, session=None): +def umount(src, dst, fstype=None, verbose=False, session=None, + fstype_mtab=None): """ Umount src from dst, if src really mounted under dst. @@ -835,6 +853,115 @@ def get_disk_by_serial(serial_str, session=None): return disk +def new_disk_vol_name(pool_name): + """ + According to BZ#1138523, the new volume name must be the next + created partition(sdb1, etc.), so we need to inspect the original + partitions of the disk then count the new partition number. + + :param pool_name: Disk pool name + :return: New volume name or none + """ + poolxml = pool_xml.PoolXML.new_from_dumpxml(pool_name) + if poolxml.get_type(pool_name) != "disk": + logging.error("This is not a disk pool") + return None + disk = poolxml.get_source().device_path[5:] + part_num = len(list(filter(lambda s: s.startswith(disk), + get_parts_list()))) + return disk + str(part_num) + + +def gluster_file_exists(params, filename_path): + sg_uri = gluster.create_gluster_uri(params, stripped=True) + g_uri = gluster.create_gluster_uri(params, stripped=False) + # Using directly /tmp dir because directory should be really temporary and + # should be deleted immediately when no longer needed and + # created directory don't file tmp dir by any data. + tmpdir = "gmount-%s" % (utils_misc.generate_random_string(6)) + tmpdir_path = os.path.join(data_dir.get_tmp_dir(), tmpdir) + while os.path.exists(tmpdir_path): + tmpdir = "gmount-%s" % (utils_misc.generate_random_string(6)) + tmpdir_path = os.path.join(data_dir.get_tmp_dir(), tmpdir) + ret = False + try: + try: + os.mkdir(tmpdir_path) + glusterfs_mount(sg_uri, tmpdir_path) + mount_filename_path = os.path.join(tmpdir_path, + filename_path[len(g_uri):]) + if os.path.exists(mount_filename_path): + ret = True + except Exception as e: + logging.error("Failed to mount gluster volume %s to" + " mount dir %s: %s" % (sg_uri, tmpdir_path, e)) + finally: + if umount(sg_uri, tmpdir_path, "glusterfs", False, "fuse.glusterfs"): + try: + os.rmdir(tmpdir_path) + except OSError: + pass + else: + logging.warning("Unable to unmount tmp directory %s with glusterfs" + " mount.", tmpdir_path) + return ret + + +def file_remove(params, filename_path): + """ + Remove the image + :param params: Dictionary containing the test parameters. + :param filename_path: path to file + """ + if params.get("enable_ceph") == "yes": + image_name = params.get("image_name") + image_format = params.get("image_format", "qcow2") + ceph_monitor = params["ceph_monitor"] + rbd_pool_name = params["rbd_pool_name"] + rbd_image_name = "%s.%s" % (image_name.split("/")[-1], image_format) + return ceph.rbd_image_rm(ceph_monitor, rbd_pool_name, rbd_image_name) + + if params.get("gluster_brick"): + # TODO: Add implementation for gluster_brick + return + + if params.get('storage_type') in ('iscsi', 'lvm'): + # TODO: Add implementation for iscsi/lvm + return + + if os.path.exists(filename_path): + os.unlink(filename_path) + return + + +def file_exists(params, filename_path): + """ + Check if image_filename exists. + + :param params: Dictionary containing the test parameters. + :param filename_path: path to file + :type filename_path: str + :param root_dir: Base directory for relative filenames. + :type root_dir: str + + :return: True if image file exists else False + """ + gluster_image = params.get("gluster_brick") + if gluster_image: + return gluster_file_exists(params, filename_path) + + if params.get("enable_ceph") == "yes": + image_name = params.get("image_name") + image_format = params.get("image_format", "qcow2") + ceph_monitor = params["ceph_monitor"] + rbd_pool_name = params["rbd_pool_name"] + rbd_image_name = "%s.%s" % (image_name.split("/")[-1], image_format) + return ceph.rbd_image_exist(ceph_monitor, rbd_pool_name, + rbd_image_name) + + return os.path.exists(filename_path) + + class Disk(object): """ diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py index 4931059b5f5..b25217489d5 100644 --- a/virttest/utils_misc.py +++ b/virttest/utils_misc.py @@ -70,7 +70,6 @@ from virttest import error_context from virttest import cartesian_config from virttest import utils_selinux -from virttest import utils_disk from virttest import logging_manager from virttest.staging import utils_koji from virttest.staging import service @@ -991,56 +990,6 @@ def safe_rmdir(path, timeout=10): (path, timeout, attempts)) -def umount(src, mount_point, fstype, verbose=False, fstype_mtab=None): - """ - Umount the src mounted in mount_point. - - :src: mount source - :mount_point: mount point - :type: file system type - :param fstype_mtab: file system type in mtab could be different - :type fstype_mtab: str - """ - return utils_disk.umount(src, mount_point, fstype, verbose) - - -def mount(src, mount_point, fstype, perm=None, verbose=False, fstype_mtab=None): - """ - Mount the src into mount_point of the host. - - :src: mount source - :mount_point: mount point - :fstype: file system type - :perm: mount permission - :param fstype_mtab: file system type in mtab could be different - :type fstype_mtab: str - """ - return utils_disk.mount(src, mount_point, fstype, perm, verbose) - - -def is_mounted(src, mount_point, fstype, perm=None, verbose=False, - fstype_mtab=None): - """ - Check mount status from /etc/mtab - - :param src: mount source - :type src: string - :param mount_point: mount point - :type mount_point: string - :param fstype: file system type - :type fstype: string - :param perm: mount permission - :type perm: string - :param verbose: if display mtab content - :type verbose: Boolean - :param fstype_mtab: file system type in mtab could be different - :type fstype_mtab: str - :return: if the src is mounted as expect - :rtype: Boolean - """ - return utils_disk.is_mount(src, mount_point, fstype, perm, verbose) - - def install_host_kernel(job, params): """ Install a host kernel, given the appropriate params. diff --git a/virttest/utils_storage.py b/virttest/utils_storage.py new file mode 100644 index 00000000000..4565c566309 --- /dev/null +++ b/virttest/utils_storage.py @@ -0,0 +1,52 @@ +import logging +import socket +import os + +from virttest import utils_misc +from virttest import utils_net +from virttest import gluster + + +def create_gluster_vol(params): + vol_name = params.get("gluster_volume_name") + force = params.get('force_recreate_gluster') == "yes" + + brick_path = params.get("gluster_brick") + if not os.path.isabs(brick_path): # do nothing when path is absolute + base_dir = params.get("images_base_dir", data_dir.get_data_dir()) + brick_path = os.path.join(base_dir, brick_path) + + logging.error("Host name lookup failed") + hostname = socket.gethostname() + if not hostname or hostname == "(none)": + if_up = utils_net.get_net_if(state="UP") + for i in if_up: + ipv4_value = utils_net.get_net_if_addrs(i)["ipv4"] + logging.debug("ipv4_value is %s", ipv4_value) + if ipv4_value != []: + ip_addr = ipv4_value[0] + break + hostname = ip_addr + + # Start the gluster dameon, if not started + gluster.glusterd_start() + # Check for the volume is already present, if not create one. + if not gluster.is_gluster_vol_avail(vol_name) or force: + return gluster.gluster_vol_create(vol_name, hostname, brick_path, + force) + else: + return True + + +def get_gluster_image_filename(params, image_name, image_format): + """ + Form the image file name using gluster uri + """ + + img_name = image_name.split('/')[-1] + gluster_uri = gluster.create_gluster_uri(params) + if params.get("image_raw_device") == "yes": + image_filename = "%s%s" % (gluster_uri, img_name) + else: + image_filename = "%s%s.%s" % (gluster_uri, img_name, image_format) + return image_filename diff --git a/virttest/utils_test/libvirt.py b/virttest/utils_test/libvirt.py index 7f7500603c6..7a149ca6c63 100644 --- a/virttest/utils_test/libvirt.py +++ b/virttest/utils_test/libvirt.py @@ -3287,25 +3287,6 @@ def exec_virsh_edit(source, edit_cmd, connect_uri="qemu:///system"): return False -def new_disk_vol_name(pool_name): - """ - According to BZ#1138523, the new volume name must be the next - created partition(sdb1, etc.), so we need to inspect the original - partitions of the disk then count the new partition number. - - :param pool_name: Disk pool name - :return: New volume name or none - """ - poolxml = pool_xml.PoolXML.new_from_dumpxml(pool_name) - if poolxml.get_type(pool_name) != "disk": - logging.error("This is not a disk pool") - return None - disk = poolxml.get_source().device_path[5:] - part_num = len(list(filter(lambda s: s.startswith(disk), - utils_misc.utils_disk.get_parts_list()))) - return disk + str(part_num) - - def update_polkit_rule(params, pattern, new_value): """ This function help to update the rule during testing. diff --git a/virttest/utils_v2v.py b/virttest/utils_v2v.py index e74a2c19a8e..92b5d0bbdbd 100644 --- a/virttest/utils_v2v.py +++ b/virttest/utils_v2v.py @@ -11,6 +11,7 @@ from avocado.utils import path from avocado.utils import process +from avocado.utils import wait from avocado.core import exceptions from virttest.compat_52lts import results_stdout_52lts, results_stderr_52lts, decode_to_text @@ -21,7 +22,7 @@ from virttest import ppm_utils from virttest import data_dir from virttest import remote -from virttest import utils_misc +from virttest import utils_disk try: V2V_EXEC = path.find_command('virt-v2v') @@ -101,7 +102,7 @@ def __init__(self, target, uri): def cleanup(self): # Cleanup NFS mount records for src, dst, fstype in self.mount_record.values(): - utils_misc.umount(src, dst, fstype) + utils_disk.umount(src, dst, fstype) def get_cmd_options(self, params): """ @@ -154,7 +155,7 @@ def _compose_input_transport_options(): if not os.path.exists(mount_point): os.makedirs(mount_point) - if not utils_misc.mount( + if not utils_disk.mount( self.vddk_libdir_src, mount_point, 'nfs', @@ -469,7 +470,7 @@ def wait_for_x_start(self, timeout=30): cmd = 'xset -q' if self.run_cmd(cmd)[0] == 127: return - utils_misc.wait_for( + wait.wait_for( lambda: not bool( self.run_cmd( cmd,