Skip to content

Commit

Permalink
same
Browse files Browse the repository at this point in the history
  • Loading branch information
mulkieran committed Jan 30, 2024
1 parent 4db52b5 commit 33af47b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/client-dbus/tests/udev/test_udev.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,21 @@ def _simple_initial_discovery_test(
device_tokens = self._lb_mgr.create_devices(num_devices)
devnodes = self._lb_mgr.device_files(device_tokens)
key_spec = None if key_spec is None else [key_spec]
pool_name = random_string(5)

with OptionalKeyServiceContextManager(key_spec=key_spec) as key_descriptions:
key_description = None if key_spec is None else key_descriptions[0]

self.wait_for_pools(0)
(_, (pool_object_path, device_object_paths)) = create_pool(
random_string(5), devnodes, key_description=key_description
pool_name, devnodes, key_description=key_description
)
wait_for_udev(STRATIS_FS_TYPE, get_devnodes(device_object_paths))
self.wait_for_pools(1)
pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path))

if take_down_dm:
remove_stratis_setup()
if take_down_dm:
stop_pool(pool_name, "name")

with OptionalKeyServiceContextManager(key_spec=key_spec):
((changed, _), exit_code, _) = Manager.Methods.StartPool(
Expand All @@ -287,6 +288,8 @@ def _simple_initial_discovery_test(

self.wait_for_pools(1)

stop_pool(pool_name, "name")

def test_encryption_simple_initial_discovery(self):
"""
See documentation for _simple_initial_discovery_test.
Expand Down Expand Up @@ -339,18 +342,18 @@ def _simple_event_test(self, *, key_spec=None): # pylint: disable=too-many-loca
device_tokens = self._lb_mgr.create_devices(num_devices)
devnodes = self._lb_mgr.device_files(device_tokens)
key_spec = None if key_spec is None else [key_spec]
pool_name = random_string(5)

with OptionalKeyServiceContextManager(key_spec=key_spec) as key_descriptions:
key_description = None if key_spec is None else key_descriptions[0]

self.wait_for_pools(0)
(_, (pool_object_path, _)) = create_pool(
random_string(5), devnodes, key_description=key_description
pool_name, devnodes, key_description=key_description
)
self.wait_for_pools(1)
pool_uuid = Pool.Properties.Uuid.Get(get_object(pool_object_path))

remove_stratis_setup()
stop_pool(pool_name, "name")

self._lb_mgr.unplug(device_tokens)
wait_for_udev(udev_wait_type, [])
Expand Down Expand Up @@ -408,6 +411,8 @@ def _simple_event_test(self, *, key_spec=None): # pylint: disable=too-many-loca

self.wait_for_pools(1)

stop_pool(pool_name, "name")

def test_simple_event(self):
"""
See documentation for _simple_event_test.
Expand Down

0 comments on commit 33af47b

Please sign in to comment.