Skip to content
Snippets Groups Projects
Commit 0773f4ed authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Add test coverage for passing incorrect options to pv-adverb

parent b2f117c1
No related branches found
No related tags found
1 merge request!350pv-adverb: Improve LD_AUDIT, LD_PRELOAD handling
......@@ -27,6 +27,9 @@ from testutils import (
logger = logging.getLogger('test-adverb')
EX_USAGE = 64
class TestAdverb(BaseTest):
def run_subprocess(
self,
......@@ -211,6 +214,26 @@ class TestAdverb(BaseTest):
proc.wait()
self.assertEqual(proc.returncode, 0)
def test_wrong_options(self) -> None:
for option in (
'--an-unknown-option',
'--pass-fd=-1',
'--shell=wrong',
'--terminal=wrong',
):
proc = subprocess.Popen(
self.adverb + [
option,
'--',
'sh', '-euc', 'exit 42',
],
stdout=2,
stderr=2,
universal_newlines=True,
)
proc.wait()
self.assertEqual(proc.returncode, EX_USAGE)
def tearDown(self) -> None:
super().tearDown()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment