forked from osbuild/osbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devices: extract
get_parent_path()
, use for manage_devices_file()
This commit extract a helper `get_parent_path()` that is unit tested and also uses this generated parent_path for the call to manage_devices_file to be consistent with the exiting behavior of only including the device that actually contains the VG.
- Loading branch information
Showing
2 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
|
||
DEVICES_NAME = "org.osbuild.lvm2.lv" | ||
|
||
|
||
@pytest.mark.parametrize("parent,options,expected_parent_path", [ | ||
("loop2", {}, "/dev/loop2"), | ||
("loop1", {"vg_partnum": 2}, "/dev/loop1p2"), | ||
]) | ||
def test_lvm2_lv_get_parent_path(devices_module, parent, options, expected_parent_path): | ||
pp = devices_module.get_parent_path(parent, options) | ||
assert pp == expected_parent_path |