[PATCH] test samba-tool --help

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Tue Dec 19 08:30:03 UTC 2017


On 18/12/17 21:13, Andrew Bartlett via samba-technical wrote:
> On Mon, 2017-12-18 at 17:37 +1300, Douglas Bagnall via samba-technical
> wrote:
>> Running `samba-tool --help` lists a number of subcommands, and if you
>> recurse into the help tree with a subcommand like so
>>
>> $ bin/samba-tool spn --help
>>
>> you are given a list of sub-subcommands.
>>
>> This patch climbs the samba-tool --help tree and checks that each call
>> succeeds. Incidentally, there are 109 nodes on the tree.
>>
>> Why bother, you are probably asking, given this test is doing very
>> little and exercising the same bit of code 109 times. Well, there are
>> two reasons:
>>
>> 1) I want to change some things in the help code.
>>
>> 2) as far as I can tell, some branches (like "spn") are not tested in
>> any way. This test will at least catch syntax errors.
> 
> G'Day Douglas,
> 
> This looks good, but why didn't you use self.check_output() from BlackBoxTestCase?
> 
> This finds the BINDIR without needing the environment by using the python file location.
> 
> Fix that up and a review will be easy to obtain :-)

Here you go, though I don't really like how that function insists on
passing arguments through a shell when there is no need.

cheers,

Douglas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-help-test-ensuring-help-tree-coverage.patch
Type: text/x-patch
Size: 3990 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20171219/46a92fd2/0001-samba-tool-help-test-ensuring-help-tree-coverage.bin>


More information about the samba-technical mailing list