diff --git a/tests/pressure-vessel/adverb.py b/tests/pressure-vessel/adverb.py index 4b466ac88ffa7052c239415c0a753691fccee5da..a7ea5c8afb1560b42cb1a3c902ab08f3f59f2000 100755 --- a/tests/pressure-vessel/adverb.py +++ b/tests/pressure-vessel/adverb.py @@ -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()