Skip to content

Commit

Permalink
utils_misc: Reorg disk related APIs into utils_disk
Browse files Browse the repository at this point in the history
Reorganise disk related method to utils_disk and break circular
imports caused with respect to disk related APIs in utils_misc and
gluster to utils_disk for better work flow. Rename utils_disk.py to
disk.py

Signed-off-by: Srikanth Aithal <[email protected]>
Signed-off-by: Balamuruhan S <[email protected]>
  • Loading branch information
balamuruhans committed Aug 28, 2019
1 parent 6109022 commit 609f52f
Show file tree
Hide file tree
Showing 8 changed files with 407 additions and 457 deletions.
20 changes: 10 additions & 10 deletions selftests/unit/test_nfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from virttest.unittest_utils import mock
from virttest import nfs
from virttest import utils_misc
from virttest import disk
from virttest.staging import service


Expand Down Expand Up @@ -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)
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)
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,
disk.umount.expect_call(nfs_obj.mount_src,
nfs_obj.mount_dir,
"nfs")
nfs_obj.exportfs.reset_export.expect_call()
Expand All @@ -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(disk, "is_mount")
self.god.stub_function(disk, "mount")
self.god.stub_function(disk, "umount")
self.god.stub_function(service.Factory, "create_service")
attr = getattr(nfs, "Exportfs")
setattr(attr, "already_exported", False)
Expand Down
Loading

0 comments on commit 609f52f

Please sign in to comment.