From: Douglas Bagnall Date: Thu, 27 Jun 2019 04:57:22 +0000 (+1200) Subject: tests/samba-tool: test --help consistency X-Git-Tag: samba-4.11.0rc1~81 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=272a6c3c305a446ac5c40b5844d9169e15b85971;p=samba.git tests/samba-tool: test --help consistency Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/samba_tool/help.py b/python/samba/tests/samba_tool/help.py index db70f617355..669895041ea 100644 --- a/python/samba/tests/samba_tool/help.py +++ b/python/samba/tests/samba_tool/help.py @@ -20,8 +20,10 @@ import re from samba.tests.samba_tool.base import SambaToolCmdTest from samba.tests import BlackboxProcessError +from samba.tests import check_help_consistency from samba.compat import get_string + class HelpTestCase(SambaToolCmdTest): """Tests for samba-tool help and --help @@ -65,6 +67,12 @@ class HelpTestCase(SambaToolCmdTest): output2 = get_string(output2) self.assertEqual(output, output2) + err = check_help_consistency(output, + options_start='Options:', + options_end='Available subcommands:') + if err is not None: + self.fail("consistency error with %s:\n%s" % (line, err)) + if not new_commands: break