Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to r6 D-Bus API for StopPool method #180

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions stratis_cli_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,9 @@ def test_pool_stop_started(self):
"""
Test stopping a started pool.
"""
pool_name = make_test_pool(StratisCliCertify.DISKS[0:1])
self._unittest_command(
[
_STRATIS_CLI,
"pool",
"stop",
make_test_pool(StratisCliCertify.DISKS[0:1]),
],
[_STRATIS_CLI, "pool", "stop", f"--name={pool_name}"],
0,
True,
True,
Expand All @@ -569,7 +565,7 @@ def test_pool_start_by_name(self):
_STRATIS_CLI,
"pool",
"stop",
pool_name,
f"--name={pool_name}",
],
0,
True,
Expand Down Expand Up @@ -936,7 +932,7 @@ def test_pool_stop_stopped(self):
_STRATIS_CLI,
"pool",
"stop",
pool_name,
f"--name={pool_name}",
],
0,
True,
Expand All @@ -947,7 +943,7 @@ def test_pool_stop_stopped(self):
_STRATIS_CLI,
"pool",
"stop",
pool_name,
f"--name={pool_name}",
],
1,
False,
Expand Down
16 changes: 8 additions & 8 deletions stratisd_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ def test_pool_stop_started(self):
Test stopping a started pool
"""
pool_name = p_n()
pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])
make_test_pool(pool_name, StratisCertify.DISKS[0:1])

self._unittest_command(
StratisDbus.pool_stop(pool_path),
StratisDbus.pool_stop(pool_name, "name"),
dbus.UInt16(0),
)

Expand All @@ -520,15 +520,15 @@ def test_pool_stop_stopped(self):
Test stopping a stopped pool
"""
pool_name = p_n()
pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])
make_test_pool(pool_name, StratisCertify.DISKS[0:1])

self._unittest_command(
StratisDbus.pool_stop(pool_path),
StratisDbus.pool_stop(pool_name, "name"),
dbus.UInt16(0),
)

self._unittest_command(
StratisDbus.pool_stop(pool_path),
StratisDbus.pool_stop(pool_name, "name"),
dbus.UInt16(0),
)

Expand All @@ -543,7 +543,7 @@ def test_pool_start_stopped(self):
pool_uuid = StratisDbus.pool_uuid(pool_path)

self._unittest_command(
StratisDbus.pool_stop(pool_path),
StratisDbus.pool_stop(pool_uuid, "uuid"),
dbus.UInt16(0),
)

Expand All @@ -558,10 +558,10 @@ def test_pool_start_by_name(self):
Test starting a stopped pool by its name
"""
pool_name = p_n()
pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])
make_test_pool(pool_name, StratisCertify.DISKS[0:1])

self._unittest_command(
StratisDbus.pool_stop(pool_path),
StratisDbus.pool_stop(pool_name, "name"),
dbus.UInt16(0),
)

Expand Down
4 changes: 2 additions & 2 deletions testlib/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def pool_start(id_string, id_type):
return manager_iface.StartPool(id_string, id_type, (False, ""))

@staticmethod
def pool_stop(pool_path):
def pool_stop(id_string, id_type):
"""
Stop a pool
"""
Expand All @@ -269,7 +269,7 @@ def pool_stop(pool_path):
StratisDbus._MNGR_IFACE,
)

return manager_iface.StopPool(pool_path)
return manager_iface.StopPool(id_string, id_type)

@staticmethod
def pool_uuid(pool_path):
Expand Down