Skip to content

Commit

Permalink
Merge pull request #226 from bgurney-rh/fslimit-stratis-cli
Browse files Browse the repository at this point in the history
stratis_cli_cert: Add simple tests for filesystem size limit
  • Loading branch information
mulkieran authored Oct 23, 2023
2 parents 34acd3c + cdaca9c commit 85421d4
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions stratis_cli_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,123 @@ def test_filesystem_create_specified_size_toosmall(self):
True,
)

@skip(_skip_condition(1))
def test_filesystem_create_specified_size_limit(self):
"""
Test creating a filesystem with a specified size limit.
"""
filesystem_name = fs_n()
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"create",
make_test_pool(StratisCliCertify.DISKS[0:1]),
filesystem_name,
"--size=512GiB",
"--size-limit=1024GiB",
],
0,
True,
True,
)

@skip(_skip_condition(1))
def test_filesystem_create_specified_size_limit_toosmall(self):
"""
Test creating a filesystem with a specified size limit that is too small.
"""
filesystem_name = fs_n()
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"create",
make_test_pool(StratisCliCertify.DISKS[0:1]),
filesystem_name,
"--size=524288KiB",
"--size-limit=524284KiB",
],
1,
False,
True,
)

@skip(_skip_condition(1))
def test_filesystem_set_size_limit(self):
"""
Test setting a size limit on an existing filesystem.
"""
pool_name = make_test_pool(StratisCliCertify.DISKS[0:1])
filesystem_name = make_test_filesystem(pool_name)
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"set-size-limit",
pool_name,
filesystem_name,
"2TiB",
],
0,
True,
True,
)

@skip(_skip_condition(1))
def test_filesystem_set_unset_size_limit(self):
"""
Test setting and unsetting a size limit on an existing filesystem.
"""
pool_name = make_test_pool(StratisCliCertify.DISKS[0:1])
filesystem_name = make_test_filesystem(pool_name)
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"set-size-limit",
pool_name,
filesystem_name,
"2TiB",
],
0,
True,
True,
)
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"unset-size-limit",
pool_name,
filesystem_name,
],
0,
True,
True,
)

@skip(_skip_condition(1))
def test_filesystem_set_size_limit_toosmall(self):
"""
Test setting a size limit on an existing filesystem that is too small.
"""
pool_name = make_test_pool(StratisCliCertify.DISKS[0:1])
filesystem_name = make_test_filesystem(pool_name)
self._unittest_command(
[
_STRATIS_CLI,
"filesystem",
"set-size-limit",
pool_name,
filesystem_name,
"1048572MiB",
],
1,
False,
True,
)

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

0 comments on commit 85421d4

Please sign in to comment.