Skip to content

Commit

Permalink
Adjust test_mount_filesystems to the latest blivet changes
Browse files Browse the repository at this point in the history
The next version of blivet will switch from calling the 'mount'
command for mounting to libblockdev FS plugin (which use libmount)
so the test needs to be changed. This way the check will work with
both the old and the new blivet's code.

Related: storaged-project/blivet#1163
(cherry picked from commit 5cffb0c)
  • Loading branch information
vojtechtrefny authored and VladimirSlavik committed Nov 16, 2023
1 parent e1ac735 commit 6c96ba4
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1548,29 +1548,26 @@ def test_activate_filesystems(self, patched_conf):

@patch("os.chmod")
@patch("os.makedirs")
@patch("blivet.util._run_program")
@patch("blivet.tasks.fsmount.FSMount.do_task")
@patch("pyanaconda.core.util._run_program")
def test_mount_filesystems(self, core_run_program, blivet_run_program, makedirs, chmod):
def test_mount_filesystems(self, core_run_program, blivet_mount, makedirs, chmod):
"""Test MountFilesystemsTask."""
storage = create_storage()
storage._bootloader = Mock()
blivet_run_program.return_value = (0, "")
blivet_mount.return_value = None
core_run_program.return_value = (0, "")

task = MountFilesystemsTask(storage)
task.run()

# created mount points
makedirs.assert_any_call('/mnt/sysimage/dev', 0o755)
makedirs.assert_any_call('/mnt/sysimage/tmp')

# fixed permissions
chmod.assert_any_call('/mnt/sysimage/tmp', 0o1777)

# mounted devices
blivet_run_program.assert_any_call([
'mount', '-t', 'bind', '-o', 'bind,defaults', '/dev', '/mnt/sysimage/dev'
])
blivet_mount.assert_any_call('/mnt/sysimage/dev', options='defaults')

# remounted the root filesystem
core_run_program.assert_any_call(
Expand Down

0 comments on commit 6c96ba4

Please sign in to comment.