tests: ensure that most python scripts have usage text
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 17 Mar 2019 01:47:40 +0000 (14:47 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 5 Jul 2019 01:05:19 +0000 (01:05 +0000)
commit538ffe1960a8640875759ca194cc4cc9fae2c5bc
treebefa635a444d1a0c12ad1ef1a09c73d75daf0931
parenteb8f74f26d5d8facaaa13419e852aac727ba41a8
tests: ensure that most python scripts have usage text

When a script is run with the wrong arguments, it should at least say
something like this:

    Usage: samba-foo [OPTIONS]

For many samba scripts, especially without a server environment, having
no arguments is the wrong arguments.

Here we look for every executable file with '#![...]python[3]' on the
first line, and exclude certain files and directories that have excuses
to fail the test. For example, many selftest scripts are stream-oriented
and will hang forever waiting for stdin, which is not an error. Some
test modules are designed so they can be optionally run from the command
line, but this option is typically only used by the developer who is
writing them.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/usage.py [new file with mode: 0644]
selftest/knownfail.d/usage [new file with mode: 0644]
source4/selftest/tests.py