Skip to content

Commit 341adbc

Browse files
committed
Add a test of an invalid integrity journal size
Signed-off-by: mulhern <[email protected]>
1 parent 4f2fd7c commit 341adbc

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/stratis_cli/_actions/_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def create_pool(namespace): # pylint: disable=too-many-locals
215215
},
216216
)
217217

218-
if return_code != StratisdErrors.OK: # pragma: no cover
218+
if return_code != StratisdErrors.OK:
219219
raise StratisCliEngineError(return_code, message)
220220

221221
if not changed: # pragma: no cover

tests/whitebox/integration/pool/test_create.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# isort: LOCAL
1919
from stratis_cli import StratisCliErrorCodes
2020
from stratis_cli._errors import (
21+
StratisCliEngineError,
2122
StratisCliInUseSameTierError,
2223
StratisCliNameConflictError,
2324
)
@@ -165,3 +166,22 @@ def test_no_overprovision(self):
165166
self._MENU + [self._POOLNAME] + self._DEVICES + ["--no-overprovision"]
166167
)
167168
TEST_RUNNER(command_line)
169+
170+
171+
class Create7TestCase(SimTestCase):
172+
"""
173+
Test create with integrity options.
174+
"""
175+
176+
_MENU = ["--propagate", "pool", "create"]
177+
_DEVICES = _DEVICE_STRATEGY()
178+
_POOLNAME = "thispool"
179+
180+
def test_invalid_journal_size(self):
181+
"""
182+
Test creating with an invalid journal size.
183+
"""
184+
command_line = (
185+
self._MENU + [self._POOLNAME] + self._DEVICES + ["--journal-size=131079MiB"]
186+
)
187+
self.check_error(StratisCliEngineError, command_line, _ERROR)

tests/whitebox/integration/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_PARSE_ERROR = StratisCliErrorCodes.PARSE_ERROR
2424

2525

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

0 commit comments

Comments
 (0)