Skip to content

Commit

Permalink
Add a test of an invalid integrity journal size
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Dec 20, 2024
1 parent 4f2fd7c commit 341adbc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/stratis_cli/_actions/_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def create_pool(namespace): # pylint: disable=too-many-locals
},
)

if return_code != StratisdErrors.OK: # pragma: no cover
if return_code != StratisdErrors.OK:
raise StratisCliEngineError(return_code, message)

if not changed: # pragma: no cover
Expand Down
20 changes: 20 additions & 0 deletions tests/whitebox/integration/pool/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# isort: LOCAL
from stratis_cli import StratisCliErrorCodes
from stratis_cli._errors import (
StratisCliEngineError,
StratisCliInUseSameTierError,
StratisCliNameConflictError,
)
Expand Down Expand Up @@ -165,3 +166,22 @@ def test_no_overprovision(self):
self._MENU + [self._POOLNAME] + self._DEVICES + ["--no-overprovision"]
)
TEST_RUNNER(command_line)


class Create7TestCase(SimTestCase):
"""
Test create with integrity options.
"""

_MENU = ["--propagate", "pool", "create"]
_DEVICES = _DEVICE_STRATEGY()
_POOLNAME = "thispool"

def test_invalid_journal_size(self):
"""
Test creating with an invalid journal size.
"""
command_line = (
self._MENU + [self._POOLNAME] + self._DEVICES + ["--journal-size=131079MiB"]
)
self.check_error(StratisCliEngineError, command_line, _ERROR)
2 changes: 1 addition & 1 deletion tests/whitebox/integration/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_PARSE_ERROR = StratisCliErrorCodes.PARSE_ERROR


class ParserTestCase(RunTestCase):
class ParserTestCase(RunTestCase): # pylint: disable=too-many-public-methods
"""
Test parser behavior. The behavior should be identical, regardless of
whether the "--propagate" flag is set. That is, stratis should never produce
Expand Down

0 comments on commit 341adbc

Please sign in to comment.