Skip to content

Commit

Permalink
Move Clevis tests to ParserTestCase
Browse files Browse the repository at this point in the history
Now that these test parsing failures that are caught while parsing they
do not need the engine to be running.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jan 18, 2024
1 parent 746d61d commit 7fbdd6a
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions tests/whitebox/integration/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,36 @@ def test_explain_non_existent_code(self):
for prefix in [[], ["--propagate"]]:
self.check_system_exit(prefix + command_line, _PARSE_ERROR)

def test_create_with_clevis_1(self):
"""
Test parsing when creating a pool w/ clevis tang but no URL.
"""
command_line = [
"--propagate",
"pool",
"create",
"--clevis=tang",
"pn",
"/dev/n",
]
self.check_error(StratisCliMissingClevisTangURLError, command_line, 1)

def test_create_with_clevis_2(self):
"""
Test parsing when creating a pool w/ clevis tang, a URL, but no
thumbprint or trust-url.
"""
command_line = [
"--propagate",
"pool",
"create",
"--clevis=tang",
"--tang-url=url",
"pn",
"/dev/n",
]
self.check_error(StratisCliMissingClevisThumbprintError, command_line, 1)


class TestFilesystemSizeParsing(RunTestCase):
"""
Expand Down Expand Up @@ -250,33 +280,3 @@ def test_stratis_list_default(self):
for subcommand in [["pool"], ["filesystem"], ["blockdev"]]:
for prefix in [[], ["--propagate"]]:
self.assertEqual(RUNNER(prefix + subcommand), 0)

def test_create_with_clevis_1(self):
"""
Test parsing when creating a pool w/ clevis tang but no URL.
"""
command_line = [
"--propagate",
"pool",
"create",
"--clevis=tang",
"pn",
"/dev/n",
]
self.check_error(StratisCliMissingClevisTangURLError, command_line, 1)

def test_create_with_clevis_2(self):
"""
Test parsing when creating a pool w/ clevis tang, a URL, but no
thumbprint or trust-url.
"""
command_line = [
"--propagate",
"pool",
"create",
"--clevis=tang",
"--tang-url=url",
"pn",
"/dev/n",
]
self.check_error(StratisCliMissingClevisThumbprintError, command_line, 1)

0 comments on commit 7fbdd6a

Please sign in to comment.