]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
cmdline: samba-tool test for bad option warning
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 5 Jul 2024 04:13:04 +0000 (16:13 +1200)
committerJule Anger <janger@samba.org>
Tue, 23 Jul 2024 07:32:13 +0000 (07:32 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674
(cherry picked from commit d2b119e34b4e523a3bc6699e4d8a370bf8403d0b)

python/samba/tests/samba_tool/help.py
selftest/knownfail.d/cmdline [new file with mode: 0644]

index fa7836d8432bfbf758895e38c9012157004b8abd..16eb6b74c5d3c1c298b4067a195029473748804f 100644 (file)
@@ -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 (file)
index 0000000..8048825
--- /dev/null
@@ -0,0 +1,2 @@
+^samba.tests.samba_tool.help.samba.tests.samba_tool.help.HelpTestCase.test_bad_password_option
+