From 0c6749b12686d154a765055f08c6a66a971ced4e Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 5 Jul 2024 16:13:04 +1200 Subject: [PATCH] cmdline: samba-tool test for bad option warning Signed-off-by: Douglas Bagnall Reviewed-by: Jo Sutton BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674 (cherry picked from commit d2b119e34b4e523a3bc6699e4d8a370bf8403d0b) --- python/samba/tests/samba_tool/help.py | 9 +++++++++ selftest/knownfail.d/cmdline | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 selftest/knownfail.d/cmdline diff --git a/python/samba/tests/samba_tool/help.py b/python/samba/tests/samba_tool/help.py index fa7836d8432..16eb6b74c5d 100644 --- a/python/samba/tests/samba_tool/help.py +++ b/python/samba/tests/samba_tool/help.py @@ -79,3 +79,12 @@ class HelpTestCase(SambaToolCmdTest): known_commands = new_commands self.assertEqual(failed_commands, []) + + def test_bad_password_option(self): + """Do we get a warning with an invalid --pass option?""" + (result, out, err) = self.run_command(["samba-tool", + "processes", + "--pass-the-salt-please", + "pleeease"]) + self.assertIn("if '--pass-the-salt-please' is not misspelt", err) + self.assertIn("the appropriate list in is_password_option", err) diff --git a/selftest/knownfail.d/cmdline b/selftest/knownfail.d/cmdline new file mode 100644 index 00000000000..80488258617 --- /dev/null +++ b/selftest/knownfail.d/cmdline @@ -0,0 +1,2 @@ +^samba.tests.samba_tool.help.samba.tests.samba_tool.help.HelpTestCase.test_bad_password_option + -- 2.47.2