From f1935c134ec551e293ea246bfb683ff50b2ab44f Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Thu, 12 Sep 2024 11:26:30 -0400 Subject: [PATCH] stratisd_cert: Add tests for snapshot reverts Signed-off-by: Bryan Gurney --- stratisd_cert.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/stratisd_cert.py b/stratisd_cert.py index 5e34629..bcce509 100644 --- a/stratisd_cert.py +++ b/stratisd_cert.py @@ -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): """