Skip to content

Commit

Permalink
Merge pull request #234 from bgurney-rh/snapshot-origin-promote
Browse files Browse the repository at this point in the history
Add tests for deleting origin filesystem
  • Loading branch information
mulkieran authored Jan 2, 2024
2 parents 9be2859 + 453b798 commit 0ecceb5
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
34 changes: 34 additions & 0 deletions stratis_cli_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,40 @@ def test_filesystem_snapshot(self):
True,
)

@skip(_skip_condition(1))
def test_filesystem_snapshot_destroy_filesystem(self):
"""
Test snapshotting a filesystem, then destroying the original filesystem.
"""
pool_name = make_test_pool(StratisCliCertify.DISKS[0:1])
filesystem_name = make_test_filesystem(pool_name)
snapshot_name = fs_n()
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"snapshot",
pool_name,
filesystem_name,
snapshot_name,
],
0,
True,
True,
)
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"destroy",
pool_name,
filesystem_name,
],
0,
True,
True,
)

@skip(_skip_condition(1))
def test_filesystem_snapshot_permissions(self):
"""
Expand Down
21 changes: 21 additions & 0 deletions stratisd_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,27 @@ 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_destroy_filesystem(self):
"""
Test snapshotting a filesystem, then destroying the original filesystem.
"""
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()

self._unittest_command(
StratisDbus.fs_snapshot(pool_path, fs_path, snapshot_name), dbus.UInt16(0)
)

self._unittest_command(
StratisDbus.fs_destroy(pool_name, fs_name), dbus.UInt16(0)
)

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

0 comments on commit 0ecceb5

Please sign in to comment.