Skip to content

Commit

Permalink
Fix up prediction tests to match new filesystem interface
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jan 3, 2024
1 parent 0325e7b commit d193a48
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/client-dbus/tests/udev/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _possibly_add_filesystems(pool_object_path, *, fs_specs=None):
:param str pool_object_path: the D-Bus object path
:param fs_specs: the filesystem specs
:type fs_specs: list of str * Range or NoneType
:type fs_specs: list of str * (Range or NoneType) * (Range or NoneType)
:returns: the change in size of pool's TotalPhysicalUsed value
:rtype: Range
Expand All @@ -123,7 +123,16 @@ def _possibly_add_filesystems(pool_object_path, *, fs_specs=None):
message,
) = Pool.Methods.CreateFilesystems(
pool_proxy,
{"specs": map(lambda x: (x[0], (True, str(x[1].magnitude))), fs_specs)},
{
"specs": map(
lambda x: (
x[0],
(False, "") if x[1] is None else (True, str(x[1].magnitude)),
(False, "") if x[2] is None else (True, str(x[2].magnitude)),
),
fs_specs,
)
},
)

if return_code != 0:
Expand Down Expand Up @@ -302,7 +311,7 @@ def test_prediction_filesystems(self):
pool_name = random_string(5)
create_pool(pool_name, devnodes)
self.wait_for_pools(1)
self._test_prediction(pool_name, fs_specs=[("fs1", Range(1, TiB))])
self._test_prediction(pool_name, fs_specs=[("fs1", Range(1, TiB), None)])

def test_prediction_no_overprov(self):
"""
Expand All @@ -317,5 +326,5 @@ def test_prediction_no_overprov(self):
create_pool(pool_name, devnodes, overprovision=False)
self.wait_for_pools(1)
self._test_prediction(
pool_name, fs_specs=[("fs1", Range(2, GiB))], overprovision=False
pool_name, fs_specs=[("fs1", Range(2, GiB), None)], overprovision=False
)

0 comments on commit d193a48

Please sign in to comment.