[Twisted-Python] Twisted 1.0.4 - `mktap --help SERVER'

Hi, still me. After having quickly glanced over the manual, I'm reading it a bit more carefully now, and if comments like this message continue to pop up, you will observe my progression, or non-progression if I cannot find enough time :-), without my real will. Sigh! OK, let not me be too shy... Page 21 (2.2.3 mktap and tapconvert) says: "For a given server, `mktap --help <name>' shows the possible configuration options.". The following shell script: ----------------------------------------------------------------------> #!/bin/bash for s in coil conch dns ftp im inetd mail manhole news parent pinger ponger \ portforward procmon sibling socks telnet toc web words zoot; do echo $s ===================================== mktap --help $s < /dev/null done ----------------------------------------------------------------------< seems to show that this is not completely true. * For coil, dns, ftp, im, mail, pinger, ponger, portforward, socks, telnet, toc, web, words and zoot, I got no output at all, so I presume this may be interpreted as meaning that these servers use no option. Yet, for all those, a `.tap' file was created, which is probably not what one expect from a mere `--help' option. So maybe the `--help' did not work so well after all. * I also got many DeprecationWarnings, which probably should not be there. Let's see: + conch yields: ----------------------------------------------------------------------> WARNING: exceptions.DeprecationWarning:: setApplication is deprecated, use setServiceCollection instead. file: /usr/lib/python2.2/site-packages/twisted/scripts/mktap.py; line: 217 ----------------------------------------------------------------------< + parent yields: ----------------------------------------------------------------------> WARNING: exceptions.DeprecationWarning:: You have to pass an authorizer separately from an application now. file: /usr/lib/python2.2/site-packages/twisted/sibling/parentserv.py; line: 23 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/cred/service.py; line: 84 WARNING: exceptions.DeprecationWarning:: setApplication is deprecated, use setServiceCollection instead. file: /usr/lib/python2.2/site-packages/twisted/python/reflect.py; line: 192 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/spread/pb.py; line: 959 ----------------------------------------------------------------------< + sibling yields: ----------------------------------------------------------------------> WARNING: exceptions.DeprecationWarning:: You have to pass an authorizer separately from an application now. file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 68 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/cred/service.py; line: 84 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 80 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 82 WARNING: exceptions.DeprecationWarning:: Application.authorizer attribute is deprecated, use Service.authorizer instead file: /usr/lib/python2.2/site-packages/twisted/spread/pb.py; line: 959 ----------------------------------------------------------------------< and for these three cases as well, a `.tap' file was created. So maybe `--help' does not work as documented for these either. * manhole did ask for supplementary information, like this: ----------------------------------------------------------------------> Password: Confirm: ----------------------------------------------------------------------< While sorting and cleaning out my various tries, I also found another case for `mktap --help manhole' which yielded the following: ----------------------------------------------------------------------> An error unexpected occurred: File "/usr/lib/python2.2/site-packages/twisted/tap/manhole.py", line 45, in opt_password self['password'] = util.getPassword(confirm=1) File "/usr/lib/python2.2/site-packages/twisted/python/util.py", line 154, in getPassword if password[-1] == '\n': IndexError: string index out of range ----------------------------------------------------------------------< yet I do not find back the exact recipe I use for producing this. Maybe the traceback will give hints about another problem? In any case, a `.tap' file was created. * For inetd, I got: ----------------------------------------------------------------------> An error unexpected occurred: File "/usr/lib/python2.2/site-packages/twisted/runner/inetdconf.py", line 90, in parseLine self.parseFields(*line.split()) File "/usr/lib/python2.2/site-packages/twisted/runner/inetdconf.py", line 174, in parseFields raise InvalidServicesConfError, 'Invalid port/protocol:' + \ InvalidServicesConfError: Invalid port/protocol:'3322-3325' ----------------------------------------------------------------------< At least, no `.tap' was created. :-) * Both news and procmon provided the expected help output, and created no `.tap'. However, the help was assorted with an error diagnostic, which is probably not appropriate for a mere help request. + news help output was prefixed with: ----------------------------------------------------------------------> Usage Error: No newsgroups specified ----------------------------------------------------------------------< + procmon help output was suffixed with: ----------------------------------------------------------------------> Wrong number of arguments. ----------------------------------------------------------------------< Even if the errors were expected, they should _ideally_ be presented both before, or both after; and both have the `Usage Error:' prefix, or both not have it. All in all, I'm left with the impression that `--help' does not work, or at least, not as documented in the book. It might be worth, maybe, adding another unit test which makes sure that `mktap --help <name>' produces for all servers, some output (on standard output ideally, not standard error), or no output at all, but surely no traceback, and with an exit status that would be consistently zero. -- François Pinard http://www.iro.umontreal.ca/~pinard

On Wed, Apr 23, 2003 at 07:06:24PM -0400, Francois Pinard wrote:
Hi, still me.
Hi :)
After looking at this for more minutes than it probably merited, I feel that this usage should stay gone (rather than have mktap be fixed to work as documented). It requires --help to be both a flag and a parameter, which usage does not support directly. It is also trivially achieved by reversing the order of the arguments to be "mktap <name> --help". Any objections? If not, I'll check in a doc fix tomorrow.
Thank you for pointing this out.
I agree. There are effectively no unit tests for either mktap or twistd, and the acceptance tests only test it in well-formed cases, which are nice, but probably the least important ones to *test*, since that is how the developers will all be invoked the tools (and so they will get plenty of testing that way). Jp -- A sad spectacle. If they be inhabited, what a scope for misery and folly. If they be not inhabited, what a waste of space. -- Thomas Carlyle, looking at the stars -- up 34 days, 19:03, 7 users, load average: 0.31, 0.48, 0.53

[Jp Calderone]
[Francois Pinard]
Page 21 (2.2.3 mktap and tapconvert) says: "For a given server, `mktap --help <name>' shows the possible configuration options.".
Sounds very reasonable.
My feeling is that we should wonder nevertheless. Consider that, in actual practice, 1.0.4 was issued with DeprecationWarnings still remaining for a few servers (conch, parent, sibling), that another server without arguments raises an exception (inetd). So we can doubt there was so plenty of testing, and a unit test for those would add more security to releases. -- François Pinard http://www.iro.umontreal.ca/~pinard

On Wed, Apr 23, 2003 at 07:06:24PM -0400, Francois Pinard wrote:
Hi, still me.
Hi :)
After looking at this for more minutes than it probably merited, I feel that this usage should stay gone (rather than have mktap be fixed to work as documented). It requires --help to be both a flag and a parameter, which usage does not support directly. It is also trivially achieved by reversing the order of the arguments to be "mktap <name> --help". Any objections? If not, I'll check in a doc fix tomorrow.
Thank you for pointing this out.
I agree. There are effectively no unit tests for either mktap or twistd, and the acceptance tests only test it in well-formed cases, which are nice, but probably the least important ones to *test*, since that is how the developers will all be invoked the tools (and so they will get plenty of testing that way). Jp -- A sad spectacle. If they be inhabited, what a scope for misery and folly. If they be not inhabited, what a waste of space. -- Thomas Carlyle, looking at the stars -- up 34 days, 19:03, 7 users, load average: 0.31, 0.48, 0.53

[Jp Calderone]
[Francois Pinard]
Page 21 (2.2.3 mktap and tapconvert) says: "For a given server, `mktap --help <name>' shows the possible configuration options.".
Sounds very reasonable.
My feeling is that we should wonder nevertheless. Consider that, in actual practice, 1.0.4 was issued with DeprecationWarnings still remaining for a few servers (conch, parent, sibling), that another server without arguments raises an exception (inetd). So we can doubt there was so plenty of testing, and a unit test for those would add more security to releases. -- François Pinard http://www.iro.umontreal.ca/~pinard
participants (2)
-
Francois Pinard
-
Jp Calderone