Skip to content

Commit

Permalink
stratisd_cert: Add tests for snapshot reverts
Browse files Browse the repository at this point in the history
Signed-off-by: Bryan Gurney <[email protected]>
  • Loading branch information
bgurney-rh committed Oct 7, 2024
1 parent 6807e00 commit f1935c1
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions stratisd_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,61 @@ def test_filesystem_snapshot(self):
StratisDbus.fs_snapshot(pool_path, fs_path, snapshot_name), dbus.UInt16(0)
)

@skip(_skip_condition(1))
def test_filesystem_snapshot_schedule_revert(self):
"""
Test scheduling a revert of a filesystem snapshot.
"""
pool_name = p_n()
pool_path, _ = make_test_pool(pool_name, StratisCertify.DISKS[0:1])

fs_name = fs_n()
fs_path = make_test_filesystem(pool_path, fs_name)

snapshot_name = fs_n()

((_, snapshot_path), _, _) = StratisDbus.fs_snapshot(
pool_path, fs_path, snapshot_name
)

StratisDbus.set_property(
snapshot_path,
StratisDbus.FS_IFACE,
"MergeScheduled",
dbus.Boolean(True),
)

@skip(_skip_condition(1))
def test_filesystem_snapshot_cancel_revert(self):
"""
Test canceling a revert of a filesystem snapshot.
"""
pool_name = p_n()
pool_path, _ = make_test_pool(pool_name, StratisCertify.DISKS[0:1])

fs_name = fs_n()
fs_path = make_test_filesystem(pool_path, fs_name)

snapshot_name = fs_n()

((_, snapshot_path), _, _) = StratisDbus.fs_snapshot(
pool_path, fs_path, snapshot_name
)

StratisDbus.set_property(
snapshot_path,
StratisDbus.FS_IFACE,
"MergeScheduled",
dbus.Boolean(True),
)

StratisDbus.set_property(
snapshot_path,
StratisDbus.FS_IFACE,
"MergeScheduled",
dbus.Boolean(False),
)

@skip(_skip_condition(1))
def test_filesystem_snapshot_destroy_filesystem(self):
"""
Expand Down

0 comments on commit f1935c1

Please sign in to comment.