Skip to content

Commit

Permalink
Allow test_duplicate_pool_name to handle metadata V2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaublitz committed Jul 15, 2024
1 parent da2020f commit 9eef69e
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions tests/client-dbus/tests/udev/test_udev.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,17 +492,30 @@ def test_duplicate_pool_name(
(luks_tokens, non_luks_tokens) = (
[
dev
for sublist in (pool_tokens[i] for i in encrypted_indices)
for sublist in (
pool_tokens[i]
for i in (encrypted_indices if _LEGACY_POOL is not None else [])
)
for dev in sublist
],
[
dev
for sublist in (pool_tokens[i] for i in unencrypted_indices)
for sublist in (
pool_tokens[i]
for i in (
unencrypted_indices
if _LEGACY_POOL is not None
else unencrypted_indices + encrypted_indices
)
)
for dev in sublist
],
)

wait_for_udev(CRYPTO_LUKS_FS_TYPE, self._lb_mgr.device_files(luks_tokens))
wait_for_udev(
CRYPTO_LUKS_FS_TYPE if _LEGACY_POOL is not None else STRATIS_FS_TYPE,
self._lb_mgr.device_files(luks_tokens),
)
wait_for_udev(STRATIS_FS_TYPE, self._lb_mgr.device_files(non_luks_tokens))

variant_pool_uuids = Manager.Properties.StoppedPools.Get(
Expand Down Expand Up @@ -541,20 +554,28 @@ def test_duplicate_pool_name(
get_object(object_path), {"name": random_string(10)}
)

self._lb_mgr.generate_synthetic_udev_events(
non_luks_tokens, UDEV_ADD_EVENT
)
for pool_uuid, props in variant_pool_uuids.items():
if "key_description" in props:
Manager.Methods.StartPool(
get_object(TOP_OBJECT),
{
"id": pool_uuid,
"unlock_method": (True, str(EncryptionMethod.KEYRING)),
"id_type": "uuid",
"key_fd": (False, 0),
},
)
if _LEGACY_POOL is not None:
self._lb_mgr.generate_synthetic_udev_events(
non_luks_tokens, UDEV_ADD_EVENT
)
for pool_uuid, props in variant_pool_uuids.items():
if "key_description" in props:
Manager.Methods.StartPool(
get_object(TOP_OBJECT),
{
"id": pool_uuid,
"unlock_method": (
True,
str(EncryptionMethod.KEYRING),
),
"id_type": "uuid",
"key_fd": (False, 0),
},
)
else:
self._lb_mgr.generate_synthetic_udev_events(
non_luks_tokens + luks_tokens, UDEV_ADD_EVENT
)

settle()

Expand Down

0 comments on commit 9eef69e

Please sign in to comment.